退出登录之后不能导航

This commit is contained in:
luyuan 2020-10-26 10:54:10 +08:00
parent 718caa7457
commit fa65e674d4
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
3 changed files with 9 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import { getValue } from '@/utils/common';
import { message } from 'ant-design-vue';
import router from '@/router';
import { MessageType } from 'ant-design-vue/types/message';
import store from '@/store';
// 泛型接口
export interface Get {
@ -21,6 +22,7 @@ axios.interceptors.response.use((response)=>{
login[0]();
login.splice(0,1);
if(response.data.code == 1001){
store.commit("login", false)
router.push("/")
}
return response;

View File

@ -255,6 +255,9 @@ export default defineComponent({
})
function navto(index: number | string){
if(!store.state.islogin){
return ;
}
if(typeof index == "number"){
router.push({
path: nav[index].route

View File

@ -270,6 +270,10 @@ export default defineComponent({
*/
async function next(e: number) {
if(!ifagree.value){
message.error("请同意用户协议");
return ;
}
if (stepnow.value > e) {
stepnow.value = e;
return;