diff --git a/src/api/jurisdiction.js b/src/api/jurisdiction.js index fc13873..fe36440 100644 --- a/src/api/jurisdiction.js +++ b/src/api/jurisdiction.js @@ -15,6 +15,17 @@ export function GET_LIST(params) { }).then(res => res.data) } +/** + * 管理员修改密码 + */ +export function MODIFY_PASSWORD(params) { + return request({ + url: `${admin}/modifyPassword`, + method: 'post', + data: params + }).then(res => res.data) +} + /** * 重置管理员密码 */ @@ -135,3 +146,14 @@ export function ROLE_ADD(params) { data: params }).then(res => res.data) } + +/** + * 获取当前角色所有的权限 + */ +export function GET_ALL_HAVE(params) { + return request({ + url: `${permission}/have`, + method: 'post', + data: params + }).then(res => res.data) +} diff --git a/src/router/menus/others.js b/src/router/menus/others.js index ce9216f..b07ae5a 100644 --- a/src/router/menus/others.js +++ b/src/router/menus/others.js @@ -4,6 +4,7 @@ const others = { path: '/others', component: Layout, meta: {title: '其他', icon: 'dingdan', noCache: true, affix: false}, + code: '9900', children: [ { path: '/configuration', diff --git a/src/router/modules/privilegeManagement.js b/src/router/modules/privilegeManagement.js index 332bcf3..17ecec0 100644 --- a/src/router/modules/privilegeManagement.js +++ b/src/router/modules/privilegeManagement.js @@ -4,19 +4,21 @@ const commodityManagement = { path: '/privilegeManagement', component: Layout, meta: {title: '权限管理', icon: 'shouquanguanli', noCache: true, affix: false}, + code: '6600', children: [ { path: '/privilegeManagement/account', component: () => import('@/views/privilegeManagement/account/index'), name: '账户管理', + code: '6601', meta: {title: '账户管理', noCache: false, affix: false} }, { path: '/privilegeManagement/role', component: () => import('@/views/privilegeManagement/role/index'), name: '角色管理', + code: '6602', meta: {title: '角色管理', noCache: false, affix: false}, - }, { path: '/privilegeManagement/role/permissions', @@ -24,7 +26,6 @@ const commodityManagement = { hidden:true, name: '新增角色', meta: {title: '新增角色', noCache: false, affix: false}, - }, { path: '/privilegeManagement/account/opiModel', @@ -32,7 +33,6 @@ const commodityManagement = { hidden:true, name: '用户增加/查看', meta: {title: '用户增加/查看', noCache: false, affix: false}, - } ] }; diff --git a/src/utils/request.js b/src/utils/request.js index 9c3b3fc..43ac3b5 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -46,27 +46,43 @@ service.interceptors.request.use( // response interceptor service.interceptors.response.use( - response => response, + // response => response, /** * 下面的注释为通过在response里,自定义code来标示请求状态 * 当code返回如下情况则说明权限有问题,登出并返回到登录页 * 如想通过 xmlhttprequest 来状态码标识 逻辑可写在下面error中 * 以下代码均为样例,请结合自生需求加以修改,若不需要,则可删除 */ - // response => { - // const res = response.data - - // if (res.code == 401) { - // debugger - // window.location.href = "#/login" - // return Promise.reject('error') - // } else { - // return response.data - // } - // }, + response => { + const res = response.data + if (res.code == 49) { + let time = 15 + // var timer = setInterval(() => { + // time -= 1 + // },1000) + var t = setTimeout(()=> { + window.location.href = "#/login" + // timer && clearInterval(timer) + },15000) + window._vm.$notify({ + type: 'warning', + title: '登录失效提示', + dangerouslyUseHTMLString: true, + message: `