Commit f82345ac authored by 朱国瑞's avatar 朱国瑞

支持使用传入的apikey

parent a6c2b12e
...@@ -190,7 +190,15 @@ export default { ...@@ -190,7 +190,15 @@ export default {
pageHeight: "", pageHeight: "",
_isMobile: false, _isMobile: false,
scale: 0, scale: 0,
lying: 0 lying: 0,
config: {
apiKey: "DLAB-customername-12345687",
region: "apac",
completeUrl: "https://bfai-service-apac-uat.d-lab-services.danone.com/demo/#/complete",
incompleteUrl: "https://bfai-service-eu.d-lab-services.danone.com/demo/#/",
sdkUrl: "https://bfai-service-eu.d-lab-services.danone.com/sdk/#/"
},
usagetrackingkey: "",
}; };
}, },
components: { components: {
...@@ -907,23 +915,23 @@ export default { ...@@ -907,23 +915,23 @@ export default {
console.log(import.meta.env); console.log(import.meta.env);
if (camera) { if (camera) {
let apiKey = "DLAB-customername-12345687"; let apiKey = this.config.apiKey;
let env = import.meta.env.VITE_TRACKING_ENV; let env = import.meta.env.VITE_TRACKING_ENV;
console.log(env); console.log(env);
let aiParams = { let aiParams = {
env: env, env: env,
apiKey: apiKey, apiKey: this.usagetrackingkey ? this.usagetrackingkey : apiKey,
region: "apac" region: this.config.region
}; };
localStorage.setItem("aiParams", JSON.stringify(aiParams)); localStorage.setItem("aiParams", JSON.stringify(aiParams));
let openDev = this.$route.query.openDev; let openDev = this.$route.query.openDev;
localStorage.setItem( localStorage.setItem(
"completeUrl", "completeUrl",
"https://bfai-service-apac-uat.d-lab-services.danone.com/demo/#/complete" this.config.completeUrl
); );
localStorage.setItem("incompleteUrl", "https://bfai-service-apac-uat.d-lab-services.danone.com/demo/#/"); localStorage.setItem("incompleteUrl", this.config.incompleteUrl);
let url = let url =
"https://bfai-service-apac-uat.d-lab-services.danone.com/sdk/#/?lying=" + this.config.sdkUrl + "?lying=" +
this.lying; this.lying;
if (openDev) { if (openDev) {
url = url + "&openDev=true"; url = url + "&openDev=true";
...@@ -951,6 +959,11 @@ export default { ...@@ -951,6 +959,11 @@ export default {
} }
}, },
created() { created() {
let usagetrackingkey = "";
if (this.$route.query.usagetrackingkey != null) {
usagetrackingkey = this.$route.query.usagetrackingkey;
}
this.usagetrackingkey = usagetrackingkey;
let lying = 0; // 默认0 为坐姿 let lying = 0; // 默认0 为坐姿
if (this.$route.query.lying != null) { if (this.$route.query.lying != null) {
lying = ~~this.$route.query.lying; lying = ~~this.$route.query.lying;
......
...@@ -140,11 +140,19 @@ export default { ...@@ -140,11 +140,19 @@ export default {
}, },
clickGestureItem(val) { clickGestureItem(val) {
let lying = Number(val.code); let lying = Number(val.code);
this.$router.push({ let usagetrackingkey = "";
path: "/introduce", if (this.$route.query.usagetrackingkey != null) {
query: { usagetrackingkey = this.$route.query.usagetrackingkey;
}
let query = {
lying: lying lying: lying
} }
if (usagetrackingkey) {
query.usagetrackingkey = usagetrackingkey;
}
this.$router.push({
path: "/introduce",
query: query
}); });
} }
}, },
......
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