Commit 2b4a467d authored by 朱国瑞's avatar 朱国瑞

动态获取域名

parent f843f995
......@@ -194,9 +194,10 @@ export default {
config: {
apiKey: "DLAB-customername-12345687",
region: "apac",
completeUrl: "https://bfai-service-apac-uat.d-lab-services.danone.com/demo/#/complete",
incompleteUrl: "https://bfai-service-apac-uat.d-lab-services.danone.com/demo/#/",
sdkUrl: "https://bfai-service-apac-uat.d-lab-services.danone.com/sdk/#/"
host: "https://bfai-service-apac-uat.d-lab-services.danone.com",
completeUrl: "/demo/#/complete",
incompleteUrl: "/demo/#/",
sdkUrl: "/sdk/#/"
},
usagetrackingkey: "",
};
......@@ -918,6 +919,10 @@ export default {
let apiKey = this.config.apiKey;
let env = import.meta.env.VITE_TRACKING_ENV;
console.log(env);
let host = this.config.host;
let currentDomain = window.location.origin;
host = currentDomain;
// 获取当前域名
let aiParams = {
env: env,
apiKey: this.usagetrackingkey ? this.usagetrackingkey : apiKey,
......@@ -925,8 +930,8 @@ export default {
};
localStorage.setItem("aiParams", JSON.stringify(aiParams));
let openDev = this.$route.query.openDev;
let completeUrl = this.config.completeUrl;
let incompleteUrl = this.config.incompleteUrl;
let completeUrl = `${host}${this.config.completeUrl}`;
let incompleteUrl = `${host}${this.config.incompleteUrl}`;
if (this.usagetrackingkey) {
completeUrl =
completeUrl + "?usagetrackingkey=" + this.usagetrackingkey;
......@@ -935,7 +940,7 @@ export default {
localStorage.setItem("completeUrl", completeUrl);
localStorage.setItem("incompleteUrl", incompleteUrl);
let url =
this.config.sdkUrl + "?lying=" +
`${host}${this.config.sdkUrl}` + "?lying=" +
this.lying;
if (openDev) {
url = url + "&openDev=true";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment