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 => {
let data = JSON.parse(res.data);
data.isTest = data.isTest169? true : false;
data.isTest = data.isTest170? true : false;
data.indexSeason = null
this.globalData.configJson = data
}).then(() => {

52
pages/index/index.js

@ -1536,27 +1536,37 @@ Page({
},
// Ai避高峰
gotoUrls() {
// 判断是否登录
var token = wx.getStorageSync("jstrip_token"),
userId = wx.getStorageSync("jstrip_userid");
if (!token || !userId) {
let url = 'https://wlsjzx.zdhxwl.cn/kt_h5/index.html'
// 强制登录
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),
})
} 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),
})
}
})
}
app.globalData.weburl = url;
wx.navigateTo({
url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url),
})
}
})
// var token = wx.getStorageSync("jstrip_token"),
// userId = wx.getStorageSync("jstrip_userid");
// if (!token || !userId) {
// let url = 'https://wlsjzx.zdhxwl.cn/kt_h5/index.html'
// 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