提交 93f981cf authored 作者: vipcxj's avatar vipcxj

上传文件路径需要进一步处理

上级 caa5da8e
......@@ -4,6 +4,7 @@ import post from '../utils/post';
import request from '../utils/request';
import { getToken } from '../utils/auth';
import config from '../utils/config';
import { encrypt } from '../utils/helper';
export class Operations {
constructor() {
......@@ -132,9 +133,9 @@ export async function uploadResource(path, error = () => {}, complete = () => {}
const token = await getToken();
let url;
if (uri) {
url = `${config.apiContextPath}/resource/${token}/${encodeURIComponent(uri)}`;
url = `${config.apiContextPath}/resource/${encrypt(token)}/${encodeURIComponent(uri)}`;
} else {
url = `${config.apiContextPath}/resource/${token}`;
url = `${config.apiContextPath}/resource/${encrypt(token)}`;
}
const uploadId = await Upload.startUpload({
url,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论