|
@@ -9,16 +9,16 @@ const PermDataList = [
|
|
|
value: 2
|
|
value: 2
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
-export async function render(oldRender) {
|
|
|
|
|
|
|
+export function render(oldRender) {
|
|
|
const path = window.location.pathname
|
|
const path = window.location.pathname
|
|
|
if (path !== '/user/login') {
|
|
if (path !== '/user/login') {
|
|
|
- const { data = [] } = await apiGetRoles()
|
|
|
|
|
- const permVal = PermDataList.find(item => path.startsWith(item.key))?.value
|
|
|
|
|
- if (permVal) {
|
|
|
|
|
- const prem = await getDataPerm()
|
|
|
|
|
- setAuthCache(PERM_LIST_KEY, prem?.data || [])
|
|
|
|
|
- }
|
|
|
|
|
- setAuthority(data)
|
|
|
|
|
|
|
+ apiGetRoles().then(roles => {
|
|
|
|
|
+ setAuthority(roles.data)
|
|
|
|
|
+ const permVal = PermDataList.find(item => path.startsWith(item.key))?.value
|
|
|
|
|
+ if (permVal) {
|
|
|
|
|
+ getDataPerm().then(prem => setAuthCache(PERM_LIST_KEY, prem?.data || []))
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
oldRender()
|
|
oldRender()
|
|
|
}
|
|
}
|