患者端提交

This commit is contained in:
zoujiandong 2023-11-17 16:40:45 +08:00
parent 7c0f376058
commit 63d7cb402d
6 changed files with 15 additions and 24 deletions

View File

@ -126,6 +126,7 @@ Page({
}
let token = wx.getStorageSync('AUTH_TOKEN_'+usertype);
console.log(token);
console.log(url);
if(token){
wx.switchTab({
url: url

View File

@ -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({

View File

@ -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);

View File

@ -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('用户点击取消')

View File

@ -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('用户点击取消')

7
app.js
View File

@ -151,7 +151,6 @@ App({
wx.$TUIKit.logout();
wx.$TUIKit = undefined;
}
wx.setStorageSync('usertype','');
this.clearAllInterval();
this.globalData.chat_sdk_ready = false;
},
@ -219,6 +218,7 @@ App({
wx.$TUIKit = undefined
}
this.globalData.chat_sdk_ready = false
this.globalData.isLogin=false;
this.go("/Pages/kickedout/index");
},
$onSystemPushReceived(e){
@ -307,6 +307,11 @@ App({
formatWenZhenInfo(){
this.getConversationList();
},
onHide(){
if(!this.globalData.isLogin){
wx.setStorageSync('usertype','');
}
},
getConversationList(){
wx.$TUIKit.getConversationList().then((imResponse) => {
// console.log("getConversationList from app js: ", imResponse.data.conversationList);