diff --git a/src/api/monitor/redis.js b/src/api/monitor/redis.js deleted file mode 100644 index a85f037..0000000 --- a/src/api/monitor/redis.js +++ /dev/null @@ -1,37 +0,0 @@ -import request from '@/utils/request' - -export function add(data) { - return request({ - url: 'api/redis', - method: 'post', - data - }) -} - -export function del(key) { - const data = { - key - } - return request({ - url: 'api/redis/', - method: 'delete', - data - }) -} - -export function delAll() { - return request({ - url: 'api/redis/all', - method: 'delete' - }) -} - -export function edit(data) { - return request({ - url: 'api/redis', - method: 'put', - data - }) -} - -export default { del, delAll } diff --git a/src/api/system/user.js b/src/api/system/user.js index c6f831d..45b2f1d 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -23,6 +23,14 @@ export function edit(data) { }) } +export function editUser(data) { + return request({ + url: 'api/users/center', + method: 'put', + data + }) +} + export function updatePass(user) { const data = { oldPass: user.oldPass, diff --git a/src/assets/icons/svg/login.svg b/src/assets/icons/svg/login.svg new file mode 100644 index 0000000..cc5a854 --- /dev/null +++ b/src/assets/icons/svg/login.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/run.svg b/src/assets/icons/svg/run.svg deleted file mode 100644 index 9eaddb6..0000000 --- a/src/assets/icons/svg/run.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/icons/svg/running.svg b/src/assets/icons/svg/running.svg deleted file mode 100644 index 59c5873..0000000 --- a/src/assets/icons/svg/running.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js index 0fb30a2..f997d12 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -15,7 +15,7 @@ const service = axios.create({ service.interceptors.request.use( config => { if (getToken()) { - config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 + config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 } config.headers['Content-Type'] = 'application/json' return config @@ -48,42 +48,42 @@ service.interceptors.response.use( if (error.toString().indexOf('Error: timeout') !== -1) { Notification.error({ title: '网络请求超时', - duration: 2500 - }) - return Promise.reject(error) - } - if (error.toString().indexOf('Error: Network Error') !== -1) { - Notification.error({ - title: '网络请求错误', - duration: 2500 + duration: 5000 }) return Promise.reject(error) } } - if (code === 401) { - MessageBox.confirm( - '登录状态已过期,您可以继续留在该页面,或者重新登录', - '系统提示', - { - confirmButtonText: '重新登录', - cancelButtonText: '取消', - type: 'warning' + if (code) { + if (code === 401) { + MessageBox.confirm( + '登录状态已过期,您可以继续留在该页面,或者重新登录', + '系统提示', + { + confirmButtonText: '重新登录', + cancelButtonText: '取消', + type: 'warning' + } + ).then(() => { + store.dispatch('LogOut').then(() => { + location.reload() // 为了重新实例化vue-router对象 避免bug + }) + }) + } else if (code === 403) { + router.push({ path: '/401' }) + } else { + const errorMsg = error.response.data.message + if (errorMsg !== undefined) { + Notification.error({ + title: errorMsg, + duration: 5000 + }) } - ).then(() => { - store.dispatch('LogOut').then(() => { - location.reload() // 为了重新实例化vue-router对象 避免bug - }) - }) - } else if (code === 403) { - router.push({ path: '/401' }) - } else { - const errorMsg = error.response.data.message - if (errorMsg !== undefined) { - Notification.error({ - title: errorMsg, - duration: 2500 - }) } + } else { + Notification.error({ + title: '接口请求失败', + duration: 5000 + }) } return Promise.reject(error) } diff --git a/src/views/components/Editor.vue b/src/views/components/Editor.vue index 91760c3..cfb243b 100644 --- a/src/views/components/Editor.vue +++ b/src/views/components/Editor.vue @@ -15,7 +15,7 @@ export default { data() { return { headers: { - 'Authorization': 'Bearer ' + getToken() + 'Authorization': getToken() }, editorContent: `
确定删除本条数据吗?
-