| | |
| | | const router = useRouter() |
| | | const userStore = useUserInfoStore() |
| | | const user = userStore.user.userName |
| | | //监听异步返回代码 |
| | | watch(()=>userStore.responseCode,(newVal) => { |
| | | switch (newVal){ |
| | | case 401:{ |
| | | if(userStore.msg.split('.')[1] === 'search'){ |
| | | router.push({path:'/main/order/notPermission'}); |
| | | router.push({path:'/main/user/notPermission'}); |
| | | }else{ |
| | | ElMessage.warning(t('error.Code_401')) |
| | | } |
| | |
| | | ) |
| | | |
| | | store.createWebSocket(); |
| | | |
| | | // 退出登录 |
| | | function quit(){ |
| | | userStore.$patch({ |
| | | user:null |
| | |
| | | let menuList=$ref([]) |
| | | onMounted(()=>{ |
| | | request.get(`/menu/getMenu/${lang}`).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | menuList= deepClone(res.data) |
| | | } |