fix
This commit is contained in:
23
src/main.ts
23
src/main.ts
@@ -17,10 +17,7 @@ import { Https } from "@/tool/https";
|
||||
|
||||
flexible()
|
||||
import { getCookie, setCookie } from "@/tool/cookie";
|
||||
// console.log(process.env)
|
||||
let token = getCookie("token");
|
||||
console.log(window.location.search.substring(1));
|
||||
|
||||
// Https.axiosGet(Https.httpUrls.endpoint)
|
||||
// .then((rv) => {
|
||||
// console.log(rv);
|
||||
@@ -29,18 +26,7 @@ console.log(window.location.search.substring(1));
|
||||
// .catch((res) => {
|
||||
// });
|
||||
|
||||
nextTick().then(()=>{
|
||||
console.log(router.currentRoute.value);
|
||||
|
||||
})
|
||||
let routerName:any = ''
|
||||
function getRouter (){
|
||||
routerName = (router.currentRoute as any)._value.name
|
||||
}
|
||||
router.beforeEach((to, from, next) => {
|
||||
console.log(`即将从 ${from.path} 跳转到 ${to.path}`);
|
||||
// if(to.path)
|
||||
console.log(to);
|
||||
if(to.name != "setIdentification"){
|
||||
isMurmur()
|
||||
}
|
||||
@@ -49,7 +35,7 @@ router.beforeEach((to, from, next) => {
|
||||
async function isMurmur() {
|
||||
let murmurStr: any = localStorage.getItem('murmurStr')
|
||||
let id: any = localStorage.getItem('id')
|
||||
let isSxis = false
|
||||
// let isSxis = false
|
||||
let data = {
|
||||
browserIdentifiers: murmurStr,
|
||||
id:id?id:window.location.search.substring(1)
|
||||
@@ -60,7 +46,8 @@ async function isMurmur() {
|
||||
// })
|
||||
// .catch((res) => {
|
||||
// });
|
||||
Https.axiosPost(Https.httpUrls.noLoginRequired, data)
|
||||
if(data.id){
|
||||
Https.axiosPost(Https.httpUrls.noLoginRequired, data)
|
||||
.then((rv) => {
|
||||
let isTest = rv.isTrial == 1 ? true : false
|
||||
let isBeginner = rv.isBeginner == 1 ? true : false
|
||||
@@ -73,11 +60,13 @@ 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");
|
||||
router.push("/home");
|
||||
// localStorage.setItem('murmurStr',murmurStr)
|
||||
})
|
||||
.catch((res) => {
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ module.exports = defineConfig({
|
||||
}
|
||||
}
|
||||
},
|
||||
// https:true,
|
||||
https:true,
|
||||
},
|
||||
pluginOptions: {
|
||||
"style-resources-loader": {
|
||||
|
||||
Reference in New Issue
Block a user