提交 3e997c64 编写于 作者: laizhilong's avatar laizhilong

统一请求路径格式

上级 3e40d54e
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
* return action * return action
*/ */
getAction() { getAction() {
const uploadUrl = '../net-disk/upload/' + this.getFolder + '?ownertype=' + this.getOwnertype + '&ownerid=' + this.getOwnerid; const uploadUrl = '/net-disk/upload/' + this.getFolder + '?ownertype=' + this.getOwnertype + '&ownerid=' + this.getOwnerid;
return uploadUrl; return uploadUrl;
}, },
/** /**
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
*/ */
getFiles() { getFiles() {
// 拼接url // 拼接url
const getUrl = 'net-disk/files/' + this.getFolder; const getUrl = '/net-disk/files/' + this.getFolder;
// 发送get请求 // 发送get请求
Axios.get(getUrl, { Axios.get(getUrl, {
params: { params: {
...@@ -310,7 +310,7 @@ ...@@ -310,7 +310,7 @@
// 拼接url // 拼接url
const id = typeof item.id == "string" ? item.id : JSON.stringify(item.id); const id = typeof item.id == "string" ? item.id : JSON.stringify(item.id);
const name = typeof item.name == "string" ? item.name : JSON.stringify(item.filename); const name = typeof item.name == "string" ? item.name : JSON.stringify(item.filename);
const downloadUrl = 'net-disk/download/' + this.getFolder + '/' + id + '/' + name; const downloadUrl = '/net-disk/download/' + this.getFolder + '/' + id + '/' + name;
// 发送get请求 // 发送get请求
Axios.get(downloadUrl, { Axios.get(downloadUrl, {
headers: { headers: {
...@@ -358,7 +358,7 @@ ...@@ -358,7 +358,7 @@
// 拼接url // 拼接url
const id = typeof item.id == "string" ? item.id : JSON.stringify(item.id); const id = typeof item.id == "string" ? item.id : JSON.stringify(item.id);
const name = typeof item.name == "string" ? item.name : JSON.stringify(item.name); const name = typeof item.name == "string" ? item.name : JSON.stringify(item.name);
const previewUrl = 'net-disk/preview/' + this.getFolder + '/' + id + '/' + name + '?authcode=' + item.authcode; const previewUrl = '/net-disk/preview/' + this.getFolder + '/' + id + '/' + name + '?authcode=' + item.authcode;
// 新窗口打开url // 新窗口打开url
window.open(previewUrl); window.open(previewUrl);
}, },
...@@ -370,7 +370,7 @@ ...@@ -370,7 +370,7 @@
// 拼接url // 拼接url
const id = typeof item.id == "string" ? item.id : JSON.stringify(item.id); const id = typeof item.id == "string" ? item.id : JSON.stringify(item.id);
const name = typeof item.name == "string" ? item.name : JSON.stringify(item.name); const name = typeof item.name == "string" ? item.name : JSON.stringify(item.name);
const editUrl = 'net-disk/edit/' + this.getFolder + '/' + id + '/' + name + '?authcode=' + item.authcode; const editUrl = '/net-disk/edit/' + this.getFolder + '/' + id + '/' + name + '?authcode=' + item.authcode;
// 新窗口打开url // 新窗口打开url
window.open(editUrl); window.open(editUrl);
}, },
...@@ -383,7 +383,7 @@ ...@@ -383,7 +383,7 @@
const folder = typeof this.folder == "string" ? this.folder : JSON.stringify(this.folder); const folder = typeof this.folder == "string" ? this.folder : JSON.stringify(this.folder);
const id = typeof item.id == "string" ? item.id : JSON.stringify(item.id); const id = typeof item.id == "string" ? item.id : JSON.stringify(item.id);
const name = typeof item.name == "string" ? item.name : JSON.stringify(item.name); const name = typeof item.name == "string" ? item.name : JSON.stringify(item.name);
const ocrUrl = 'net-disk/ocrview/' + this.getFolder + '/' + id + '/' + name + '?authcode=' + item.authcode; const ocrUrl = '/net-disk/ocrview/' + this.getFolder + '/' + id + '/' + name + '?authcode=' + item.authcode;
// 新窗口打开url // 新窗口打开url
window.open(ocrUrl); window.open(ocrUrl);
}, },
...@@ -400,7 +400,7 @@ ...@@ -400,7 +400,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// 拼接url // 拼接url
const deleteUrl = 'net-disk/files/' + item.id; const deleteUrl = '/net-disk/files/' + item.id;
// 发送delete请求 // 发送delete请求
Axios.delete(deleteUrl).then(response => { Axios.delete(deleteUrl).then(response => {
if (!response || response.status != 200) { if (!response || response.status != 200) {
...@@ -425,7 +425,7 @@ ...@@ -425,7 +425,7 @@
*/ */
updateFileBatch(files, opt) { updateFileBatch(files, opt) {
// 拼接url // 拼接url
const updateUrl = 'net-disk/files/' + this.getFolder + '?ownertype=' + this.getOwnertype + "&ownerid=" + this.getOwnerid; const updateUrl = '/net-disk/files/' + this.getFolder + '?ownertype=' + this.getOwnertype + "&ownerid=" + this.getOwnerid;
// requestBody参数 // requestBody参数
let requestBody = []; let requestBody = [];
if (files) { if (files) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册