【修改】登录市场和方法统一修改

This commit is contained in:
zer0Black
2022-04-17 23:13:28 +08:00
parent b5ac2c4a1b
commit 4dcbaf5b57
9 changed files with 29 additions and 34 deletions
+1 -8
View File
@@ -14,7 +14,6 @@ whiteList.push(OAUTH2_LOGIN_PAGE_PATH)
router.beforeEach((to, from, next) => {
NProgress.start() // start progress bar
if (Vue.ls.get(ACCESS_TOKEN)) {
/* has token */
if (to.path === '/user/login' || to.path === OAUTH2_LOGIN_PAGE_PATH) {
@@ -66,13 +65,7 @@ router.beforeEach((to, from, next) => {
})
})
.catch(() => {
/* notification.error({
message: '系统提示',
description: '请求用户信息失败,请重试!'
})*/
store.dispatch('Logout').then(() => {
next({ path: '/user/login', query: { redirect: to.fullPath } })
})
return Promise.reject()
})
} else {
next()
+10 -6
View File
@@ -1,6 +1,7 @@
import Vue from 'vue'
import { login, logout, phoneLogin, thirdLogin } from "@/api/login"
import { ACCESS_TOKEN, USER_NAME,USER_INFO,USER_AUTH,SYS_BUTTON_AUTH,UI_CACHE_DB_DICT_DATA,TENANT_ID,CACHE_INCLUDED_ROUTES } from "@/store/mutation-types"
import store from '@/store'
import { welcome } from "@/utils/util"
import { queryPermissionsByUser } from '@/api/api'
import { getAction } from '@/api/manage'
@@ -140,9 +141,14 @@ const user = {
//update--end--autor:qinfeng-----date:20200109------for 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
commit('SET_PERMISSIONLIST', menuData)
} else {
notification.error({
message: '系统提示',
description: '该用户无权限,请联系管理员'
Vue.prototype.$Jmodal.error({
title: '无权限',
content: '该用户无权限,请联系管理员',
okText: '确认',
mask: false,
onOk: () => {
store.dispatch('Logout')
}
})
reject('getPermissionList: permissions must be a non-null array !')
}
@@ -173,9 +179,7 @@ const user = {
window.location.href = process.env.VUE_APP_CAS_BASE_URL + '/logout?service=' + serviceUrl
}
resolve()
setTimeout (() => {
location.reload();
}, 1000)
window.location.replace("/user/login")
}).catch(() => {
resolve()
})