From 0a7f63e878719db3b9d48db2ff45353866662c4d Mon Sep 17 00:00:00 2001 From: wen <1515> Date: Sat, 5 Nov 2022 12:52:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E6=AC=A1=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=A4=9A=E5=BC=A0=E5=9B=BE=E7=89=87=EF=BC=8C=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=BF=9B=E5=BA=A6=E6=9D=A1=E3=80=82=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96vuex=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user.js | 13 ++- src/layout/components/Sidebar/index.vue | 15 +--- src/store/modules/settings.js | 18 ++-- src/views/filemange/index.vue | 2 +- src/views/subfile/index.vue | 115 ++++++++++++++++-------- 5 files changed, 103 insertions(+), 60 deletions(-) diff --git a/src/api/user.js b/src/api/user.js index 8012b4c..af7ce4e 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -26,6 +26,13 @@ export function requesterr(thiss, err) { } } +// 系统配置接口 +export function config() { + return request({ + url: '/api/config', + method: 'get' + }) +} // 登入接口 export function login(datas) { @@ -55,11 +62,13 @@ export function mkdir(datas) { } // 上传文件 -export function uploadrequest(datas) { +export function uploadrequest(datas, Progress) { return request({ url: '/api/uploadbase64', method: 'post', - data: datas + data: datas, + onUploadProgress: Progress + }) } diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 023bebb..db8c1fc 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -32,7 +32,7 @@ import EventBus from '@/utils/EventBus.js' import SidebarItem from './SidebarItem' import variables from '@/styles/variables.scss' import menusdata from './leftMenusData.js' -import { mirlist } from '@/api/user' +import {requesterr, mirlist } from '@/api/user' //console.log(menusdata); export default { @@ -150,18 +150,7 @@ export default { }).catch(function (error) { - if (error.response) { - if (error.response.status == 401) { - thiss.$message({showClose: true,message: error.response.data.err,type: 'error'}); - thiss.$router.push({path: '/login'}); - return; - } - thiss.$message({showClose: true,message: error.response.data.err,type: 'error'}); - } else if (error.request) { - thiss.$message({showClose: true,message: error.response.data.err,type: 'error'}); - } else { - thiss.$message({showClose: true,message: error.response.data.err,type: 'error'}); - } + requesterr(this, error); }); }, diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index b3f33f8..0587ca6 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -9,18 +9,18 @@ const state = { } const mutations = { - CHANGE_SETTING: (state, { key, value }) => { - // eslint-disable-next-line no-prototype-builtins - if (state.hasOwnProperty(key)) { - state[key] = value - } - } +// CHANGE_SETTING: (state, { key, value }) => { +// // eslint-disable-next-line no-prototype-builtins +// if (state.hasOwnProperty(key)) { +// state[key] = value +// } +// } } const actions = { - changeSetting({ commit }, data) { - commit('CHANGE_SETTING', data) - } +// changeSetting({ commit }, data) { +// commit('CHANGE_SETTING', data) +// } } export default { diff --git a/src/views/filemange/index.vue b/src/views/filemange/index.vue index e5a407b..55125b2 100644 --- a/src/views/filemange/index.vue +++ b/src/views/filemange/index.vue @@ -1,5 +1,5 @@