Archived
forked from admin/userbase
init: userbase front/service/deploy source (CI builds front via Gitea Actions)
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import config from "./host.config";
|
||||
import { AxiosRequestConfig } from "axios";
|
||||
import { PcDebugUser } from "@/types/Basics";
|
||||
|
||||
const serviceUrl = config.isMock ? "" : config.serviceHost,
|
||||
timeout: number = 15000;
|
||||
|
||||
let baseConfig: AxiosRequestConfig = {
|
||||
baseURL: serviceUrl + "/",
|
||||
headers: {
|
||||
// "Content-Type": "application/x-www-form-urlencoded",
|
||||
"Content-Type": "application/json;charset=urf-8",
|
||||
bschapirequest: "1",
|
||||
"Access-Control-Allow-Headers": "Set-Cookie",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
},
|
||||
params: {},
|
||||
data: {},
|
||||
timeout, // 接口超时限制(ms)
|
||||
withCredentials: true,
|
||||
responseType: "json",
|
||||
// transformRequest: [
|
||||
// function (data) {
|
||||
// if (typeof data == "string") return data;
|
||||
// let ret = "";
|
||||
// for (let it in data) {
|
||||
// ret += encodeURIComponent(it) + "=" + encodeURIComponent(data[it]) + "&";
|
||||
// }
|
||||
// return ret;
|
||||
// },
|
||||
// ],
|
||||
// maxContentLength: 2000,
|
||||
validateStatus(status) {
|
||||
return status >= 200 && status < 300; // default
|
||||
},
|
||||
};
|
||||
|
||||
let debugUser: PcDebugUser = {
|
||||
DebugUser: "zhd",
|
||||
AppType: "ChildOptCourse",
|
||||
};
|
||||
|
||||
export { baseConfig, debugUser };
|
||||
Reference in New Issue
Block a user