患者端提交
This commit is contained in:
@@ -126,6 +126,7 @@ Page({
|
||||
}
|
||||
let token = wx.getStorageSync('AUTH_TOKEN_'+usertype);
|
||||
console.log(token);
|
||||
console.log(url);
|
||||
if(token){
|
||||
wx.switchTab({
|
||||
url: url
|
||||
|
||||
+1
-12
@@ -6,7 +6,6 @@ Page({
|
||||
data: {
|
||||
showEntryTip:false,
|
||||
showEntryTip_second:false,
|
||||
isLogin:false,
|
||||
beforeClose(action){
|
||||
return new Promise((resolve) => {
|
||||
if (action === 'confirm') {
|
||||
@@ -24,14 +23,6 @@ Page({
|
||||
checked: false,
|
||||
static_host: api.getStaticHost()
|
||||
},
|
||||
|
||||
onUnload: function() {
|
||||
let isLogin=this.data.isLogin;
|
||||
if(!isLogin){
|
||||
wx.setStorageSync('usertype','');
|
||||
}
|
||||
// 页面销毁时执行
|
||||
},
|
||||
onLoad(){
|
||||
let usertype = wx.getStorageSync('usertype');
|
||||
this.setData({
|
||||
@@ -139,12 +130,10 @@ Page({
|
||||
api.wechatMobileLogin(params).then(response => {
|
||||
console.log(response);
|
||||
wx.setStorageSync('AUTH_TOKEN_'+usertype, response.data.token);
|
||||
THIS.setData({
|
||||
isLogin:true
|
||||
})
|
||||
wx.setStorageSync('user_id_'+usertype, response.data.user_id);
|
||||
wx.setStorageSync('client_user_id_'+usertype, response.data.client_user_id);
|
||||
app.globalData.config.userID = response.data.user_id;
|
||||
app.globalData.isLogin=true;
|
||||
app.imInit();
|
||||
//跳转页面
|
||||
wx.switchTab({
|
||||
|
||||
@@ -8,7 +8,6 @@ Page({
|
||||
title: '手机号登录', //导航栏 中间的标题
|
||||
},
|
||||
checked: false,
|
||||
isLogin:false,
|
||||
phone: "",
|
||||
sms: "",
|
||||
btn_msg: "获取验证码",
|
||||
@@ -52,13 +51,7 @@ Page({
|
||||
})
|
||||
}
|
||||
},
|
||||
onUnload: function() {
|
||||
let isLogin=this.data.isLogin;
|
||||
if(!isLogin){
|
||||
wx.setStorageSync('usertype','');
|
||||
}
|
||||
// 页面销毁时执行
|
||||
},
|
||||
|
||||
getCodePhone(e){
|
||||
let phone_reg = /^1[3-9]\d{9}$/;
|
||||
let phone = this.data.phone;
|
||||
@@ -136,9 +129,7 @@ Page({
|
||||
params.wx_code = res.code;
|
||||
|
||||
api.mobileLogin(params).then(response => {
|
||||
THIS.setData({
|
||||
isLogin:true
|
||||
})
|
||||
app.globalData.isLogin=true;
|
||||
console.log(response);
|
||||
wx.setStorageSync('AUTH_TOKEN_'+usertype, response.data.token);
|
||||
wx.setStorageSync('user_id_'+usertype, response.data.user_id);
|
||||
|
||||
@@ -38,6 +38,8 @@ Page({
|
||||
wx.setStorageSync('AUTH_TOKEN_'+usertype, "");
|
||||
wx.setStorageSync('user_id_'+usertype, "");
|
||||
wx.setStorageSync('client_user_id_'+usertype, "");
|
||||
app.globalData.isLogin=false;
|
||||
wx.setStorageSync('usertype','')
|
||||
app.go("/Pages/index/index");
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
|
||||
@@ -53,8 +53,11 @@ Page({
|
||||
let usertype = wx.getStorageSync('usertype');
|
||||
wx.setStorageSync('AUTH_TOKEN_'+usertype, "");
|
||||
wx.setStorageSync('user_id_'+usertype, "");
|
||||
|
||||
wx.setStorageSync('client_user_id_'+usertype, "");
|
||||
app.imLogout();
|
||||
app.globalData.isLogin=false;
|
||||
wx.setStorageSync('usertype','')
|
||||
app.go("/Pages/index/index");
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
|
||||
Reference in New Issue
Block a user