8
0
ZaiZai 1 rok pred
rodič
commit
f9c8f9c426

+ 0 - 5
src/api/modules/user.js

@@ -65,11 +65,6 @@ export const getCaptcha = () => HcApi({
     method: 'get',
 })
 
-export const getUserInfo = () => HcApi({
-    url: '/api/blade-auth/oauth/user-info',
-    method: 'get',
-})
-
 export const sendLogs = (list) => HcApi({
     url: '/api/blade-auth/oauth/logout',
     method: 'post',

+ 6 - 0
src/api/modules/userInfo/index.js

@@ -1,6 +1,12 @@
 import { HcApi } from '../../request/index'
 
 export default {
+    async getUserInfo() {
+        return HcApi({
+            url: '/api/blade-user/info',
+            method: 'get',
+        })
+    },
     //修改密码
     async updatePassword(form, msg = true) {
         return HcApi({

+ 22 - 1
src/layout/modules/Refresh.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="header-icon-bar">
+    <div class="header-icon-bar" @click="tapClick">
         <el-tooltip content="强刷新" placement="top">
             <hc-icon name="refresh" class="header-icon" />
         </el-tooltip>
@@ -7,7 +7,28 @@
 </template>
 
 <script setup>
+import { ref } from 'vue'
+import { setRouterData } from '~sto/user'
+import { initButtons } from '~sto/app'
+import { delStoreValue } from '~src/utils/storage'
 
+//被点击
+const isLoading = ref(false)
+const tapClick = async () => {
+    if (isLoading.value) return
+    isLoading.value = true
+    //获取路由菜单
+    const routerRes = await setRouterData()
+    if (routerRes.length <= 0) {
+        return { error: true, msg: '路由异常' }
+    }
+    //获取按钮权限数据
+    delStoreValue('buttons')
+    await initButtons()
+    isLoading.value = false
+    //刷新路由
+    //window.location.reload()
+}
 </script>
 
 <style lang="scss" scoped>