fix: 不同角色登陆之后跳转不同页面
This commit is contained in:
parent
b7d1bde4af
commit
1984a23783
|
@ -58,13 +58,10 @@ VueRouter.prototype.push = function push(location) {
|
||||||
|
|
||||||
// 登入后跳转至原路径
|
// 登入后跳转至原路径
|
||||||
function redirectLoginPath(originPath) {
|
function redirectLoginPath(originPath) {
|
||||||
let redirectUrl = '';
|
let redirectUrl = sessionStorage.getItem('redirectUrl');
|
||||||
let loginSuccess = sessionStorage.getItem('loginSuccess');
|
let loginSuccess = sessionStorage.getItem('loginSuccess');
|
||||||
|
|
||||||
if (getCurrentUserId() === sessionStorage.getItem('lastUser')) {
|
if (!redirectUrl || redirectUrl === '/') {
|
||||||
redirectUrl = sessionStorage.getItem('redirectUrl');
|
|
||||||
}
|
|
||||||
if (!redirectUrl) {
|
|
||||||
if (hasPermissions('PROJECT_USER:READ', 'PROJECT_ENVIRONMENT:READ', 'PROJECT_OPERATING_LOG:READ', 'PROJECT_FILE:READ+JAR', 'PROJECT_FILE:READ+FILE', 'PROJECT_CUSTOM_CODE:READ')) {
|
if (hasPermissions('PROJECT_USER:READ', 'PROJECT_ENVIRONMENT:READ', 'PROJECT_OPERATING_LOG:READ', 'PROJECT_FILE:READ+JAR', 'PROJECT_FILE:READ+FILE', 'PROJECT_CUSTOM_CODE:READ')) {
|
||||||
redirectUrl = '/project/home';
|
redirectUrl = '/project/home';
|
||||||
} else if (hasPermissions('WORKSPACE_SERVICE:READ', 'WORKSPACE_MESSAGE:READ', 'WORKSPACE_USER:READ', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_OPERATING_LOG:READ', 'WORKSPACE_TEMPLATE:READ')) {
|
} else if (hasPermissions('WORKSPACE_SERVICE:READ', 'WORKSPACE_MESSAGE:READ', 'WORKSPACE_USER:READ', 'WORKSPACE_PROJECT_MANAGER:READ', 'WORKSPACE_PROJECT_ENVIRONMENT:READ', 'WORKSPACE_OPERATING_LOG:READ', 'WORKSPACE_TEMPLATE:READ')) {
|
||||||
|
|
Loading…
Reference in New Issue