Commit 704327c6 by 李伟康

commit 提交

1 parent 567eb23c
......@@ -2,7 +2,7 @@ import {
preReleaseAppId
} from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 1
let index = 3
/**
*
......
......@@ -36,10 +36,18 @@ Page({
wx.p.wxApi.hideLoading()
if (code == 0) {
wx.p.storage.set('userInfo', data)
this.setData({
if (data.beiSenToken) this.setData({
indexUrl: `${data.beiSenToken}&return_url=${returnUrl}`
})
} else throw message
else wx.p.router.go('/pages/noAccess/noAccess', data)
} else {
setTimeout(() => {
wx.p.router.reLaunch('/pages/noAccess/noAccess', {
phone: userInfo.phone
})
}, 1e3)
throw message
}
} catch (error) {
wx.p.wxApi.hideLoading()
if (error) wx.p.wxApi.showToast(String(error))
......
// pages/login/login.js
Page({
Page({
/**
* 页面的初始数据
*/
......@@ -38,7 +38,7 @@ Page({
if (data.beiSenToken) wx.p.router.reLaunch('/packageIndex/pages/index/index', data)
else wx.p.router.go('/pages/noAccess/noAccess', data)
} else {
this.onLoad()
this.getWxCode(true)
throw message
}
} catch (error) {
......@@ -73,7 +73,7 @@ Page({
/**
* 生命周期函数--监听页面显示
*/
async onShow() {
onShow() {
let {
options
} = this
......@@ -81,14 +81,19 @@ Page({
this.wxCode = wxCode
return
}
this.getWxCode()
},
async getWxCode(flag = false) {
let {timeOut} = this
if (!flag && timeOut && Date.now() - timeOut < 1 * 60e3) return
wx.p.wxApi.showLoading()
const {
data
} = await wx.p.api.userApi.wxCodeLogin()
this.timeOut = Date.now()
if (data) this.wxCode = data
wx.hideLoading()
},
/**
* 生命周期函数--监听页面隐藏
*/
......@@ -115,12 +120,5 @@ Page({
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
......@@ -117,7 +117,7 @@ page {
line-height: 52rpx;
color: #222222;
text-align: center;
margin-bottom: 16rpx;
margin-bottom: 36rpx;
}
.modal-text {
......
......@@ -12,7 +12,8 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if(options.phone) options.phone = options.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
console.log(options)
if(options.phone) options.phone = String(options.phone).replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
this.setData({
options
})
......@@ -60,12 +61,5 @@ Page({
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
......@@ -7,12 +7,12 @@ const noScroll = () => {}
/**设置粘贴板内容 */
const setCopyData = (data, callBack) => {
wx.setClipboardData({
data: data,
success(res) {
if (callBack && typeof callBack === 'function') callBack(res)
}
})
// wx.setClipboardData({
// data: data,
// success(res) {
// if (callBack && typeof callBack === 'function') callBack(res)
// }
// })
}
/**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!