|
@@ -10,21 +10,26 @@ import "./styles/global.css";
|
|
|
|
|
|
import axiosPlugin from "./utils/axios";
|
|
import axiosPlugin from "./utils/axios";
|
|
|
|
|
|
|
|
+import MainLayout from "@/components/MainLayout/MainLayout.vue";
|
|
|
|
+
|
|
Vue.use(iView);
|
|
Vue.use(iView);
|
|
Vue.use(axiosPlugin);
|
|
Vue.use(axiosPlugin);
|
|
|
|
|
|
Vue.config.productionTip = false;
|
|
Vue.config.productionTip = false;
|
|
|
|
|
|
-new Vue({
|
|
|
|
- router,
|
|
|
|
- store,
|
|
|
|
- render: h => h(App)
|
|
|
|
-}).$mount("#app");
|
|
|
|
|
|
+Vue.component("main-layout", MainLayout);
|
|
|
|
|
|
if (process.env.NODE_ENV === "development") {
|
|
if (process.env.NODE_ENV === "development") {
|
|
console.log("非生产环境,自动登录");
|
|
console.log("非生产环境,自动登录");
|
|
(async () => {
|
|
(async () => {
|
|
if (window.localStorage.getItem("token")) {
|
|
if (window.localStorage.getItem("token")) {
|
|
|
|
+ //FIXME: vuex
|
|
|
|
+ window.wk_user = {
|
|
|
|
+ name: "mock name",
|
|
|
|
+ code: "mock code",
|
|
|
|
+ orgName: "mock org name"
|
|
|
|
+ };
|
|
|
|
+ console.log("非生产环境: mock user name");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
const response = await fetch("/api/ecs_core/auth/login", {
|
|
const response = await fetch("/api/ecs_core/auth/login", {
|
|
@@ -43,8 +48,21 @@ if (process.env.NODE_ENV === "development") {
|
|
if (data.token) {
|
|
if (data.token) {
|
|
window.localStorage.setItem("token", data.token);
|
|
window.localStorage.setItem("token", data.token);
|
|
window.localStorage.setItem("key", data.key);
|
|
window.localStorage.setItem("key", data.key);
|
|
|
|
+
|
|
|
|
+ //FIXME: vuex
|
|
|
|
+ window.wk_user = {
|
|
|
|
+ name: data.displayName,
|
|
|
|
+ code: data.studentCode,
|
|
|
|
+ orgName: data.orgName
|
|
|
|
+ };
|
|
} else {
|
|
} else {
|
|
console.log(data.desc);
|
|
console.log(data.desc);
|
|
}
|
|
}
|
|
})();
|
|
})();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+new Vue({
|
|
|
|
+ router,
|
|
|
|
+ store,
|
|
|
|
+ render: h => h(App)
|
|
|
|
+}).$mount("#app");
|