refactor: 项目简化

Former-commit-id: 73a4a6c9c41e013928e6205dd7c078d0e955f487
This commit is contained in:
horizons
2022-09-13 07:44:55 +08:00
parent 90c6059f3f
commit 81d7880ebc
64 changed files with 204 additions and 5279 deletions

View File

@@ -1,6 +1,7 @@
import router from '@/router';
import { ElMessage } from 'element-plus';
import useStore from '@/store';
import { hasLogin } from '@/utils/auth';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
NProgress.configure({ showSpinner: false }); // 进度环显示/隐藏
@@ -11,8 +12,8 @@ const whiteList = ['/login'];
router.beforeEach(async (to, from, next) => {
NProgress.start();
const { user, permission } = useStore();
const hasToken = user.token;
if (hasToken) {
if (hasLogin()) {
// 登录成功,跳转到首页
if (to.path === '/login') {
next({ path: '/' });