Commit 40d67418 by wufan

feat:替换云盘接口

parent de8085ee
......@@ -39,7 +39,7 @@ class ChooseMembersModal extends React.Component {
folderTypeEnum : folderType,
id
}
Service.Apollo('public/apollo/getFileUser', _params).then((res) => {
Service.Hades('public/apollo/getFileUser', _params).then((res) => {
if (res.result) {
let _allUserList = [];
_allUserList = res.result;
......@@ -166,7 +166,7 @@ class ChooseMembersModal extends React.Component {
createId,
rightsList,
}
Service.Apollo('public/apollo/addFileUserAuthorityList', _params).then((res) => {
Service.Hades('public/apollo/addFileUserAuthorityList', _params).then((res) => {
if (res.code === '200') {
this.handleClose();
this.setState({
......
......@@ -101,7 +101,7 @@ class CopyFileModal extends React.Component {
})
if (allowCopy === 0) {
Service.Apollo('public/apollo/copyFolder', _params).then((res) => {
Service.Hades('public/hadesStore/copyFolder', _params).then((res) => {
if (res.success) {
this.getFileList(disk, newParentId)
}
......@@ -189,7 +189,7 @@ class CopyFileModal extends React.Component {
}
}
this.setState({ disk });
Service.Apollo(folder_list_url[disk], _params).then((res) => {
Service.Hades(folder_list_url[disk], _params).then((res) => {
if (res.result) {
if (hasMore) { // 是否是由滑动获取更多触发
const _folderList = JSON.parse(JSON.stringify(folderList)).concat(res.result.records);
......
......@@ -120,7 +120,7 @@ class Introduction extends React.Component {
bizCode: 'LIVE_COURSE_MEDIA',
instId: instId,
}
Service.Apollo("public/apollo/commonOssAuthority", params).then((res) => {
Service.Hades("public/apollo/commonOssAuthority", params).then((res) => {
const { resourceId } = res.result;
const signInfo = res.result;
......
......@@ -38,7 +38,7 @@ class ManagingMembersModal extends React.Component {
id
}
Service.Apollo('public/apollo/getFileUserAuthority', _params).then((res) => {
Service.Hades('public/apollo/getFileUserAuthority', _params).then((res) => {
if(res.result) {
// 数据排序,文件创建者在最前,并修改文案为所有者
let _selectUserList = [], _dataSource = [], flag = [], _iconRotateList = [];
......@@ -83,7 +83,7 @@ class ManagingMembersModal extends React.Component {
delete _params.currentRight;
// 此接口只返回成功与失败,没有其他数据
Service.Apollo('public/apollo/updateFileUserAuthority', _params).then((res) => {
Service.Hades('public/apollo/updateFileUserAuthority', _params).then((res) => {
this.getFileUserAuthority()
message.success(res.message);
})
......@@ -100,7 +100,7 @@ class ManagingMembersModal extends React.Component {
content: '确定要移除该成员',
icon: <span className="icon iconfont default-confirm-icon">&#xe6f4;</span>,
onOk: () => {
Service.Apollo('public/apollo/updateFileUserAuthority', _params).then((res) => {
Service.Hades('public/apollo/updateFileUserAuthority', _params).then((res) => {
if (res.code === '200') {
message.success('删除成功');
this.getFileUserAuthority();
......
......@@ -108,7 +108,7 @@ class SelectPrepareFileModal extends React.Component {
_params.fileType = 'VEDIOFILE';
}
Service.Apollo(FOLDERLIST_URL_MAP[currentRootDisk.disk], _params).then((res) => {
Service.Hades(FOLDERLIST_URL_MAP[currentRootDisk.disk], _params).then((res) => {
const { result = {} } = res;
const { records = [], total = 0 } = result;
this.setState({
......@@ -405,7 +405,7 @@ class SelectPrepareFileModal extends React.Component {
parentId: id
}
Service.Apollo('public/apollo/saveFolder', params).then((res) => {
Service.Hades('public/apollo/saveFolder', params).then((res) => {
const { query, selectedFileList, currentRootDisk } = this.state;
const _query = _.clone(query);
const _selectedFileList = [...selectedFileList, res.result];
......
......@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-31 09:34:51
* @LastEditors: wufan
* @LastEditTime: 2020-12-16 14:59:13
* @LastEditTime: 2020-12-17 14:14:43
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
......
......@@ -44,7 +44,7 @@ class ImgCutModal extends React.Component {
resourceName: fileName
}
const cutImage = this.convertBase64UrlToBlob(dataUrl);
Service.Apollo("public/apollo/commonOssAuthority", params).then((res) => {
Service.Hades("public/apollo/commonOssAuthority", params).then((res) => {
const { resourceId, accessId, policy, callback, signature,key, host } = res.result;
const localUrl = URL.createObjectURL(cutImage);
// 构建上传的表单
......
......@@ -43,15 +43,6 @@ function DiskList(props) {
})
}
</div>
<a
className="guide-href"
href={window.NewVersion ? 'https://mp.weixin.qq.com/s/s0XN0Gk4Xul192SmTd6znw' : 'https://mp.weixin.qq.com/s/2EMWaaa3LQwkJd59bmy8pA'}
target="_blank"
rel="noopener noreferrer"
>
进一步了解资料云盘
</a>
</div>
)
};
......
......@@ -163,7 +163,7 @@ class FolderList extends React.Component {
disk: currentRootDisk.disk,
}
Service.Apollo('public/apollo/folderPath', params).then((res) => {
Service.Hades('public/apollo/folderPath', params).then((res) => {
const { result = [] } = res;
this.props.onChangeFolderPath(result, false);
})
......@@ -291,7 +291,7 @@ class FolderList extends React.Component {
const { currentRootDisk: { disk } } = this.props;
const { instId } = window.currentUserInstInfo;
// 判断此文件是否有关联的课次
Service.Apollo('public/apollo/judgeRelation', {
Service.Hades('public/apollo/judgeRelation', {
instId,
folderIds: [folder.id],
}).then((res) => {
......@@ -303,7 +303,7 @@ class FolderList extends React.Component {
// icon: <span className="icon iconfont default-confirm-icon">&#xe6f4;</span>,
onOk: () => {
const { currentFolder } = this.state;
Service.Apollo(DEL_FOLDER_URL_MAP[disk], {
Service.Hades(DEL_FOLDER_URL_MAP[disk], {
instId,
ids: [folder.id],
}).then(() => {
......@@ -347,7 +347,7 @@ class FolderList extends React.Component {
return;
}
Service.Apollo('public/apollo/renameFolder', {
Service.Hades('public/apollo/renameFolder', {
id: renameModalData.id,
name: folderName
}).then(() => {
......@@ -371,7 +371,7 @@ class FolderList extends React.Component {
folderType: 'FOLDER',
}
const res = await Service.Apollo('public/apollo/sameNameFile', params);
const res = await Service.Hades('public/apollo/sameNameFile', params);
const { result } = res;
return result;
}
......
......@@ -96,7 +96,7 @@ class FolderManage extends React.Component {
if (parentRights) {
this.setState({ _parentRights: parentRights });
}
Service.Apollo(FOLDERLIST_URL_MAP[disk], _params).then((res) => {
Service.Hades(FOLDERLIST_URL_MAP[disk], _params).then((res) => {
const { result = {} } = res;
const { records = [], total = 0 } = result;
let _records = [];
......@@ -189,7 +189,7 @@ class FolderManage extends React.Component {
parentId: id
}
Service.Apollo('public/apollo/saveFolder', params).then((res) => {
Service.Hades('public/apollo/saveFolder', params).then((res) => {
const query = _.clone(this.state.query);
query.current = 1;
this.setState({ query }, () => {
......@@ -214,7 +214,7 @@ class FolderManage extends React.Component {
if (selectFolderPathList.length > 1) {
params.newParentId = id
}
Service.Apollo('public/apollo/moveFolder', params).then((res) => {
Service.Hades('public/apollo/moveFolder', params).then((res) => {
// 判断是否将文件移动到了自身或者子目录
const { result = {} } = res;
......
......@@ -105,7 +105,7 @@ class OperateArea extends React.Component {
folderType: 'FOLDER',
}
const res = await Service.Apollo('public/apollo/sameNameFile', params);
const res = await Service.Hades('public/apollo/sameNameFile', params);
const { result } = res;
return (!!result) || (result && Object.keys(result).length);
}
......@@ -206,7 +206,7 @@ class OperateArea extends React.Component {
const { instId } = window.currentUserInstInfo;
// 判断此文件是否有关联的课次
const { selectedFileIds, currentRootDisk: { disk }, folderPathList } = this.props;
Service.Apollo('public/apollo/judgeRelation', {
Service.Hades('public/apollo/judgeRelation', {
instId,
folderIds: selectedFileIds,
}).then((res) => {
......@@ -218,7 +218,7 @@ class OperateArea extends React.Component {
icon: <span className="icon iconfont default-confirm-icon">&#xe6f4;</span>,
onOk: () => {
const currentFolder = folderPathList[folderPathList.length - 1];
Service.Apollo(DEL_FOLDER_URL_MAP[disk], {
Service.Hades(DEL_FOLDER_URL_MAP[disk], {
instId,
ids: selectedFileIds,
}).then(() => {
......
import React from 'react';
import { Modal } from 'antd';
import Service from '@/common/js/service';
import { DISK_MAP } from '@/domains/resource-disk/constants';
import FolderManage from './components/FolderManage';
import DiskList from './components/DiskList';
import './index.less';
const { gmtCreate } = window.currentUserInstInfo || {};
// 判断是新用户还是老用户(gmtCreate小于上线日期的话就是老用户)
const onlineDate = +new Date('2020-07-17 00:00:00');
const isOldUser = gmtCreate <= onlineDate;
const defaultRootDisk = {
folderName: '我的文件',
folderName: '公共文件',
disk: 'MYSELF',
uploadPower: false
}
......@@ -25,9 +16,7 @@ class PrepareLessonPage extends React.Component {
constructor(props) {
super(props);
const prepareLessonTips = localStorage.getItem('prepare_lesson_tips');
this.state = {
prepareLessonTips,
diskList: [], // 可见磁盘目录
currentRootDisk: defaultRootDisk
}
......@@ -38,7 +27,7 @@ class PrepareLessonPage extends React.Component {
}
handleFetchDiskList = async () => {
const res = await Service.Apollo('public/apollo/getUserDisk', {});
const res = await Service.Hades('public/apollo/getUserDisk', {});
const { result = [] } = res;
const diskList = result.map((item) => {
return {
......@@ -59,7 +48,7 @@ class PrepareLessonPage extends React.Component {
}
render() {
const { currentRootDisk, prepareLessonTips, diskList } = this.state;
const { currentRootDisk, diskList } = this.state;
return (
<div className="prepare-lesson-page page">
......@@ -74,48 +63,6 @@ class PrepareLessonPage extends React.Component {
currentRootDisk={currentRootDisk}
/>
</div>
{/* 老用户显示弹窗提示 */}
<Modal
title="备课本改版"
visible={!prepareLessonTips && isOldUser}
footer={null}
width={680}
maskClosable={false}
className="prepare-lesson-upgrade-modal"
onCancel={() => {
this.setState({
prepareLessonTips: true
})
}}
>
<div className="title">“备课本” 升级为 “资料云盘” 了!</div>
<div className="upgrade-list">
<div className="upgrade-list__item">
<img src="https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594780611301.png" alt=""/>
<div className="item-title">存储更便捷</div>
<div className="item-sub-title">讲次关联模式升级文件夹模式,存储不再受讲次限制</div>
</div>
<div className="upgrade-list__item">
<img src="https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594780629259.png" alt=""/>
<div className="item-title">结构更清晰</div>
<div className="item-sub-title">新增“我的文件”“公共文件”“员工文件”,满足机构存储需求</div>
</div>
<div className="upgrade-list__item">
<img src="https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594780641665.png" alt=""/>
<div className="item-title">同步更方便</div>
<div className="item-sub-title">支持主管直接查看员工文件,优质资料一目了然</div>
</div>
</div>
<div
className="footer"
onClick={() => {
this.setState({ prepareLessonTips: true });
localStorage.setItem('prepare_lesson_tips', true);
}}
>我知道了</div>
</Modal>
</div>
)
}
......
......@@ -210,7 +210,7 @@
&__title {
color: #999;
.upload-btn {
color: #FF7519;
color: #5A8EFA;
margin: 0 4px;
cursor: pointer;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment