宋杰 3 weeks ago
parent
commit
497b39c257
  1. 2
      .env.development
  2. 55
      src/views/wealth/goldenWheel.vue

2
.env.development

@ -20,7 +20,7 @@ VITE_APP_IMG_API_BASE_URL = "http://39.101.133.168:8828/hljw/api/aws/upload"
VITE_APP_MJ_API_BASE_URL = "http://192.168.9.19:8080/api" VITE_APP_MJ_API_BASE_URL = "http://192.168.9.19:8080/api"
#Link测试环境scms库 #Link测试环境scms库
VITE_APP_API_SCMS_URL = "http://39.101.133.168:8828/scms"
VITE_APP_API_SCMS_URL = "https://mp.homilychart.com/TestApi/scms"
# Whether to open mock # Whether to open mock
VITE_USE_MOCK = true VITE_USE_MOCK = true

55
src/views/wealth/goldenWheel.vue

@ -298,18 +298,45 @@ export default {
return chineseCharCount > 7 || englishCharCount > 15; return chineseCharCount > 7 || englishCharCount > 15;
} }
}, },
// onMounted(){
// this.getTokenFromURL();
// this.fetchWheelInfo();
// },
mounted() { mounted() {
this.getTokenFromURL(); this.getTokenFromURL();
this.fetchWheelInfo(); this.fetchWheelInfo();
//
this.preloadImages();
api.packageFun('JWsetTitle', function () {}, { api.packageFun('JWsetTitle', function () {}, {
platform: 5, platform: 5,
title: "财富金轮" title: "财富金轮"
}) })
//
this.preloadImages();
}, },
methods: { methods: {
getTokenFromURL() {
// URLtoken
const urlParams = new URLSearchParams(window.location.search);
const tokenParam = urlParams.get('token');
if (tokenParam) {
// URLtokenlocalStorage
const decodedToken = decodeURIComponent(tokenParam);
localStorage.setItem('fortuneWheelToken', decodedToken);
this.token = decodedToken;
} else {
// URLtokenlocalStorage
const storedToken = localStorage.getItem('fortuneWheelToken');
if (storedToken) {
this.token = storedToken;
} else {
console.log('URL和localStorage中都没有找到token');
// token
}
}
},
toggleHistory() { toggleHistory() {
this.historyRecordListVisible = !this.historyRecordListVisible this.historyRecordListVisible = !this.historyRecordListVisible
this.selected = 1 this.selected = 1
@ -391,27 +418,7 @@ async loadHistoryRecord() {
}); });
}, },
getTokenFromURL() {
// URLtoken
const urlParams = new URLSearchParams(window.location.search);
const tokenParam = urlParams.get('token');
if (tokenParam) {
// URLtokenlocalStorage
const decodedToken = decodeURIComponent(tokenParam);
localStorage.setItem('fortuneWheelToken', decodedToken);
this.token = decodedToken;
} else {
// URLtokenlocalStorage
const storedToken = localStorage.getItem('fortuneWheelToken');
if (storedToken) {
this.token = storedToken;
} else {
console.log('URL和localStorage中都没有找到token');
// token
}
}
},
// API // API
fetchWheelInfo() { fetchWheelInfo() {

Loading…
Cancel
Save