|
@@ -8,6 +8,8 @@
|
|
|
import { useMessage } from 'naive-ui';
|
|
|
import { useUserStore } from '@/store/modules/user';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
+ import { storage } from '@/utils/Storage';
|
|
|
+ import { ACCESS_TOKEN } from '@/store/mutation-types';
|
|
|
|
|
|
export default {
|
|
|
setup() {
|
|
@@ -37,18 +39,24 @@
|
|
|
// this.openModal();
|
|
|
await this.router.push('/selectSystem');
|
|
|
} else {
|
|
|
- if (code === 9999) {
|
|
|
- this.message.info(msg);
|
|
|
- await this.router.push('/login');
|
|
|
- }
|
|
|
+ // if (code === 9999) {
|
|
|
+ // this.message.info(msg);
|
|
|
+ // await this.router.push('/login');
|
|
|
+ // }
|
|
|
this.message.info(msg || '登录失败1');
|
|
|
+ storage.remove(ACCESS_TOKEN);
|
|
|
+ await this.router.push('/login');
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('登录失败:', error);
|
|
|
this.message.info('登录失败2');
|
|
|
+ storage.remove(ACCESS_TOKEN);
|
|
|
+ await this.router.push('/login');
|
|
|
}
|
|
|
} else {
|
|
|
this.message.info('取消授权');
|
|
|
+ storage.remove(ACCESS_TOKEN);
|
|
|
+ await this.router.push('/login');
|
|
|
}
|
|
|
},
|
|
|
},
|