Browse Source

避高峰强制登录

master
chenkainan 2 months ago
parent
commit
7e62b6e023
  1. 2
      app.js
  2. 52
      pages/index/index.js

2
app.js

@ -39,7 +39,7 @@ App({
// 获取前端配置文件 // 获取前端配置文件
commonApi._post("pbservice/Other/getClientConfig", {unique_key: "wechatxcx"}).then(res => { commonApi._post("pbservice/Other/getClientConfig", {unique_key: "wechatxcx"}).then(res => {
let data = JSON.parse(res.data); let data = JSON.parse(res.data);
data.isTest = data.isTest169? true : false; data.isTest = data.isTest170? true : false;
data.indexSeason = null data.indexSeason = null
this.globalData.configJson = data this.globalData.configJson = data
}).then(() => { }).then(() => {

52
pages/index/index.js

@ -1536,27 +1536,37 @@ Page({
}, },
// Ai避高峰 // Ai避高峰
gotoUrls() { gotoUrls() {
// 判断是否登录 // 强制登录
var token = wx.getStorageSync("jstrip_token"), commonApi.user_post("uservice/user/userEncry").then(res => {
userId = wx.getStorageSync("jstrip_userid"); if (res.code == 1) {
if (!token || !userId) { let url = 'https://wlsjzx.zdhxwl.cn/kt_h5/index.html?userEncry=' + res.data
let url = 'https://wlsjzx.zdhxwl.cn/kt_h5/index.html'
app.globalData.weburl = url; app.globalData.weburl = url;
wx.navigateTo({ wx.navigateTo({
url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url), url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url),
}) })
} else { }
commonApi.user_post("uservice/user/userEncry").then(res => { })
if (res.code == 1) { // var token = wx.getStorageSync("jstrip_token"),
let url = 'https://wlsjzx.zdhxwl.cn/kt_h5/index.html?userEncry=' + res.data // userId = wx.getStorageSync("jstrip_userid");
// if (!token || !userId) {
app.globalData.weburl = url; // let url = 'https://wlsjzx.zdhxwl.cn/kt_h5/index.html'
wx.navigateTo({
url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url), // app.globalData.weburl = url;
}) // wx.navigateTo({
} // url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url),
}) // })
} // } else {
// commonApi.user_post("uservice/user/userEncry").then(res => {
// if (res.code == 1) {
// let url = 'https://wlsjzx.zdhxwl.cn/kt_h5/index.html?userEncry=' + res.data
// app.globalData.weburl = url;
// wx.navigateTo({
// url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url),
// })
// }
// })
// }
}, },
}) })
Loading…
Cancel
Save