|
@@ -141,24 +141,26 @@
|
|
|
'isSystemAdministrator': false
|
|
|
});
|
|
|
// console.log('本地没有用户信息,开始加载用户信息')
|
|
|
- this.user = storageGet('user')
|
|
|
- this.rolesPermissions = getRolesPermissions(storageGet('user')&&storageGet('user').roleList)
|
|
|
- storageSave('rolesPermissions', getRolesPermissions(torageGet('user')&&storageGet('user').roleList))
|
|
|
- this.isLogin = true
|
|
|
- this.fullScreenLoading = false
|
|
|
- // getCurrentUser().then((res) => {
|
|
|
- // // console.log(res)
|
|
|
- // storageSave('user', res)
|
|
|
- // this.user = res
|
|
|
- // this.rolesPermissions = getRolesPermissions(res.roleList)
|
|
|
- // storageSave('rolesPermissions', getRolesPermissions(res.roleList))
|
|
|
- // console.log('用户信息加载成功')
|
|
|
- // this.isLogin = true
|
|
|
- // this.fullScreenLoading = false
|
|
|
- // }).catch((error) => {
|
|
|
- // console.log('用户信息加载失败')
|
|
|
- // this.fullScreenLoading = false
|
|
|
- // })
|
|
|
+ //暂时注释
|
|
|
+ // this.user = storageGet('user')
|
|
|
+ // this.rolesPermissions = getRolesPermissions(storageGet('user')&&storageGet('user').roleList)
|
|
|
+ // storageSave('rolesPermissions', getRolesPermissions(torageGet('user')&&storageGet('user').roleList))
|
|
|
+ // this.isLogin = true
|
|
|
+ // this.fullScreenLoading = false
|
|
|
+
|
|
|
+ getCurrentUser().then((res) => {
|
|
|
+ // console.log(res)
|
|
|
+ storageSave('user', res)
|
|
|
+ this.user = res
|
|
|
+ this.rolesPermissions = getRolesPermissions(res.roleList)
|
|
|
+ storageSave('rolesPermissions', getRolesPermissions(res.roleList))
|
|
|
+ console.log('用户信息加载成功')
|
|
|
+ this.isLogin = true
|
|
|
+ this.fullScreenLoading = false
|
|
|
+ }).catch((error) => {
|
|
|
+ console.log('用户信息加载失败')
|
|
|
+ this.fullScreenLoading = false
|
|
|
+ })
|
|
|
} else {
|
|
|
this.user = storageGet('user')
|
|
|
this.fullScreenLoading = false
|
|
@@ -182,7 +184,7 @@
|
|
|
userLogout () {
|
|
|
this.isLogin = false
|
|
|
logout().then((res) => {
|
|
|
- // location.reload();
|
|
|
+ location.reload();
|
|
|
this.$router.push('/home')
|
|
|
})
|
|
|
|