|
@@ -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>
|