控制台只展示有权限的菜单,登录和提示优化
This commit is contained in:
@@ -13,6 +13,9 @@ export default {
|
||||
},
|
||||
getSelfUserInfo: data => {
|
||||
return request({url: '/user/info/selfInfo', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
selfInfoWithAuth: data => {
|
||||
return request({url: '/user/info/selfInfoWithAuth', method: 'post', data: Qs.stringify(data)});
|
||||
},
|
||||
getUserInfoList: data => {
|
||||
return request({url: '/user/info/list', method: 'post', data: Qs.stringify(data)});
|
||||
|
||||
@@ -12,6 +12,7 @@ const noValidate = {
|
||||
"/zyplayer-doc-db/executor/execute": true,
|
||||
"/zyplayer-doc-db/datasource/test": true,
|
||||
};
|
||||
let lastToastLoginTime = 0;
|
||||
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
@@ -36,7 +37,11 @@ service.interceptors.response.use(
|
||||
if (!response.config.needValidateResult || response.data.errCode == 200) {
|
||||
return response.data;
|
||||
} else if (response.data.errCode == 400) {
|
||||
vue.$message.error('请先登录');
|
||||
// 一秒钟只提示一次
|
||||
if (new Date().getTime() - lastToastLoginTime > 1000) {
|
||||
vue.$message.error('请先登录');
|
||||
lastToastLoginTime = new Date().getTime();
|
||||
}
|
||||
let redirectUrl = '';
|
||||
let locationHref = window.location.href;
|
||||
if (locationHref.indexOf("?") >= 0) {
|
||||
|
||||
Reference in New Issue
Block a user