diff --git a/.env.test b/.env.test index c3d5c2cb..16638ad5 100644 --- a/.env.test +++ b/.env.test @@ -1,4 +1,4 @@ NODE_ENV = 'development' -VUE_APP_BASE_URL = 'https://develop.api.aida.com.hk' +# VUE_APP_BASE_URL = 'https://develop.api.aida.com.hk' # VUE_APP_BASE_URL = 'http://18.167.251.121:10086' -# VUE_APP_BASE_URL = 'http://192.168.1.6:5567' +VUE_APP_BASE_URL = 'http://192.168.1.9:5567' diff --git a/src/main.ts b/src/main.ts index f19345a6..f1a30a6c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -21,28 +21,31 @@ import { getCookie, setCookie } from "@/tool/cookie"; let token = getCookie("token"); let routerName:any = router.currentRoute let isLogin = routerName._value.name +console.log(window.location.search.substring(1)); + +// Https.axiosGet(Https.httpUrls.endpoint) +// .then((rv) => { +// console.log(rv); + +// }) +// .catch((res) => { +// }); + async function isMurmur() { let murmurStr: any = localStorage.getItem('murmurStr') - if (!murmurStr) { - await murmur().then((rv) => { - murmurStr = rv - }) - } + let id: any = localStorage.getItem('id') let isSxis = false let data = { - browserIdentifiers: murmurStr + browserIdentifiers: murmurStr, + id:id?id:window.location.search.substring(1) } - await Https.axiosPost(Https.httpUrls.existNoLoginRequired, data) - .then((rv) => { - isSxis = rv - }) - .catch((res) => { - }); - if (isSxis && (router.currentRoute as any)._value.name != 'setIdentification') { - // if (isSxis&&!token) { - // if(isLogin != 'login'){ - // return - // } + // await Https.axiosPost(Https.httpUrls.existNoLoginRequired, data) + // .then((rv) => { + // isSxis = rv + // }) + // .catch((res) => { + // }); + if ((router.currentRoute as any)._rawValue.name != 'setIdentification') { Https.axiosPost(Https.httpUrls.noLoginRequired, data) .then((rv) => { let isTest = rv.isTrial == 1 ? true : false @@ -56,8 +59,8 @@ async function isMurmur() { sessionStorage.setItem('isTimeOne', JSON.stringify(false));//是否需要公告 提示 弹窗 let randomNum: any = Math.floor(Math.random() * 9000000000000000) + 1000000000000000; sessionStorage.setItem('sessionId', randomNum); - router.push("/home"); - localStorage.setItem('murmurStr',murmurStr) + // router.push("/home"); + // localStorage.setItem('murmurStr',murmurStr) }) .catch((res) => { }); diff --git a/src/tool/https.js b/src/tool/https.js index 19aa6cfb..72714883 100644 --- a/src/tool/https.js +++ b/src/tool/https.js @@ -38,6 +38,7 @@ axios.interceptors.request.use((config) => { // config.data = JSON.stringify(config.data); } + // config.headers.Authorization = 'Bearer-eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIyIiwic3ViIjoie1wiaWRcIjoyLFwidXNlcm5hbWVcIjpcImxpcnNcIn0iLCJpYXQiOjE2NjU3NDEwODcsImlzcyI6IkRXSiIsImF1dGhvcml0aWVzIjoiW10iLCJleHAiOjE2NzQzODEwODd9.ShM9R_NNFD7oo1OvxrEgg7PFeWinOuAKkuInUCMQupp66s64Hhv8tN0Wwr83nIN4rHPqtn95wmd4msWcvaFYJA'; config.headers.Authorization = getCookie('token'); return config; },(error) =>{ @@ -106,6 +107,11 @@ export const Https = { deleteNoLoginRequired:`/api/third/party/deleteNoLoginRequired`, //机房用户注销 noLoginRequired:`api/account/noLoginRequired`, //机房用户登录 existNoLoginRequired:`/api/third/party/existNoLoginRequired`, //获取唯一标识是否存在 + + deleteNoLoginRequiredNew:`/api/third/party/deleteNoLoginRequiredNew`, //机房用户注销 + addNoLoginRequiredNew:`api/third/party/addNoLoginRequiredNew`, //机房用户注册 + + endpoint:`api/third/party/your-secured-endpoint`, //获取唯一标识是否存在 diff --git a/src/views/setIdentification.vue b/src/views/setIdentification.vue index efb0453c..bbf38f06 100644 --- a/src/views/setIdentification.vue +++ b/src/views/setIdentification.vue @@ -1,6 +1,7 @@