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