|
@@ -17,13 +17,19 @@ const user = ref({
|
|
|
token: localStorage.getItem('token'),
|
|
|
info: strToJson(localStorage.getItem('info'), {}),
|
|
|
permission: strToJson(localStorage.getItem('permission'), []),
|
|
|
- roleKeyList:strToJson(localStorage.getItem('roleKeyList'), [])
|
|
|
+ roleKeyList:strToJson(localStorage.getItem('roleKeyList'), []),
|
|
|
+ roleKey: localStorage.getItem('roleKey'),
|
|
|
+
|
|
|
})
|
|
|
|
|
|
watch(
|
|
|
() => user.value.token,
|
|
|
() => localStorage.setItem('token', user.value.token)
|
|
|
)
|
|
|
+watch(
|
|
|
+ () => user.value.roleKey,
|
|
|
+ () => localStorage.setItem('roleKey', user.value.roleKey)
|
|
|
+)
|
|
|
|
|
|
watch(
|
|
|
() => user.value.info,
|
|
@@ -93,6 +99,7 @@ export const setInfo = val => {
|
|
|
}
|
|
|
|
|
|
export const setRoleKey = val => {
|
|
|
+ alert(val)
|
|
|
user.value.roleKey = val
|
|
|
}
|
|
|
|