|
@@ -3,7 +3,7 @@ import { Dialog, Message } from "bill/index";
|
|
|
import { showLoad, hideLoad } from "@/utils";
|
|
|
import * as URL from "./constant";
|
|
|
import { ResCode, ResCodeDesc } from "./constant";
|
|
|
-import { baseURL, params } from "@/env";
|
|
|
+import { appBackRoot, baseURL, params } from "@/env";
|
|
|
import GAxios from "axios";
|
|
|
|
|
|
const instance = axiosFactory();
|
|
@@ -27,27 +27,20 @@ export const {
|
|
|
} = instance;
|
|
|
|
|
|
const gotoLogin = () => {
|
|
|
- GAxios.post("/service/manage/login", {
|
|
|
- password: "MRinIEn3ExMjM0NTY=Q5Lm39urQWzN7k4oCG",
|
|
|
- userName: "super-admin",
|
|
|
- username: "super-admin",
|
|
|
- }).then((res) => {
|
|
|
- setToken(res.data.data.token)
|
|
|
- setTimeout(() => location.reload())
|
|
|
- });
|
|
|
- // if (import.meta.env.DEV) {
|
|
|
- // GAxios.post("/service/manage/login", {
|
|
|
- // password: "MRinIEn3ExMjM0NTY=Q5Lm39urQWzN7k4oCG",
|
|
|
- // userName: "super-admin",
|
|
|
- // username: "super-admin",
|
|
|
- // }).then((res) => {
|
|
|
- // setToken(res.data.data.token)
|
|
|
- // setTimeout(() => location.reload())
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // const loginHref = `/admin/#/statistics/scene`
|
|
|
- // location.href = loginHref + '?redirect=' + escape(location.href)
|
|
|
- // }
|
|
|
+ if (import.meta.env.DEV) {
|
|
|
+ // GAxios.post("/service/manage/login", {
|
|
|
+ // password: "MRinIEn3ExMjM0NTY=Q5Lm39urQWzN7k4oCG",
|
|
|
+ // userName: "super-admin",
|
|
|
+ // username: "super-admin",
|
|
|
+ // }).then((res) => {
|
|
|
+ // setToken(res.data.data.token)
|
|
|
+ // setTimeout(() => location.reload())
|
|
|
+ // });
|
|
|
+ } else {
|
|
|
+ const appID = params.app
|
|
|
+ const loginHref = `${appBackRoot[appID]}/#/login`
|
|
|
+ location.href = loginHref + '?redirect=' + escape(location.href)
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
addReqErrorHandler((err) => {
|