登录权限判断

This commit is contained in:
zzyuan 2025-03-07 11:20:25 +08:00
parent 28019a4f7b
commit 68614ae0d6
1 changed files with 4 additions and 0 deletions

View File

@ -114,6 +114,10 @@ const user = {
return getInfo()
.then(res => {
const user = res.user
if(!user.loginType || user.loginType.indexOf("0")==-1){
// this.$router.push("/login")
return Promise.reject(new Error('无登录权限!'))
}
const avatar = user.avatar ? user.avatar : require('@/assets/images/profile.jpg')
commit('SET_ROLES', res.roles && res.roles.length > 0 ? res.roles : ['ROLE_DEFAULT'])
commit('SET_PERMISSIONS', res.permissions)