From 071a3bc598f607296cfe32b61a295689afe0c1dd Mon Sep 17 00:00:00 2001 From: dqjdda <201507802@qq.com> Date: Sat, 30 Nov 2019 19:43:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=BC=93=E5=AD=98=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97=E9=81=BF=E5=85=8D=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E6=93=8D=E4=BD=9Credis=E5=B8=A6=E6=9D=A5=E7=9A=84=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E9=9A=90=E6=82=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/monitor/redis.js | 37 --------- src/utils/request.js | 60 +++++++-------- src/views/monitor/redis/index.vue | 120 ------------------------------ 3 files changed, 30 insertions(+), 187 deletions(-) delete mode 100644 src/api/monitor/redis.js delete mode 100644 src/views/monitor/redis/index.vue 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/utils/request.js b/src/utils/request.js index 84cd03b..f997d12 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -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/monitor/redis/index.vue b/src/views/monitor/redis/index.vue deleted file mode 100644 index 017c837..0000000 --- a/src/views/monitor/redis/index.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - 搜索 - - 清空 - - 导出 - - - - - - - - {{ scope.row.value }} - - - - - - - 确定删除本条数据吗? - - 取消 - 确定 - - - - - - - - - - - - - -
确定删除本条数据吗?