mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-13 14:13:47 +08:00
v3.0.0
This commit is contained in:
@@ -15,14 +15,14 @@ import JsonViewer from 'vue3-json-viewer';
|
||||
import 'vue3-json-viewer/dist/index.css';
|
||||
import App from './App.vue';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { loginApi } from '/@/api/system/login/login-api';
|
||||
import { loginApi } from '/src/api/system/login-api';
|
||||
import constantsInfo from '/@/constants/index';
|
||||
import { privilegeDirective } from '/@/directives/privilege';
|
||||
import i18n from '/@/i18n/index';
|
||||
import privilegePlugin from '/@/plugins/privilege-plugin';
|
||||
import smartEnumPlugin from '/@/plugins/smart-enums-plugin';
|
||||
import { buildRoutes, router } from '/@/router/index';
|
||||
import { store } from '/@/store/index';
|
||||
import { buildRoutes, router } from '/@/router';
|
||||
import { store } from '/@/store';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import '/@/theme/index.less';
|
||||
import { getTokenFromCookie } from '/@/utils/cookie-util';
|
||||
@@ -36,7 +36,7 @@ import { getTokenFromCookie } from '/@/utils/cookie-util';
|
||||
* 2.1)如果存在登录信息,则先ajax请求用户的所有路由,然后加载,再去创建vue实例和挂载路由
|
||||
* 2.2)如果不存在路由信息,则创建vue实例和挂载路由(此时的路由应该只有login页面,因为用户拥有哪些路由是登录之后才知道的)
|
||||
* 3、以上,在main.js里两个方法,一个是 获取登录信息getLoginInfo,另一个初始化vue: initVue,在最下的if操作里
|
||||
*
|
||||
*
|
||||
* -------------------- ※ 着重 解释说明下main.js的初始化逻辑 end ※ --------------------
|
||||
*/
|
||||
|
||||
@@ -54,7 +54,7 @@ async function getLoginInfo() {
|
||||
//更新用户信息到pinia
|
||||
useUserStore().setUserLoginInfo(res.data);
|
||||
} catch (e) {
|
||||
message.error(e);
|
||||
message.error(e.data ? e.data.msg : e.message);
|
||||
smartSentry.captureError(e);
|
||||
initVue();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user