退出登录之后不能导航
This commit is contained in:
parent
718caa7457
commit
fa65e674d4
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user