| | |
| | | </template> |
| | | </u-input> |
| | | </u-form-item> |
| | | <u-text type="primary" text="立即注册" @click="navGotoRegister()"></u-text> |
| | | <!-- <u-text type="primary" text="立即注册" @click="navGotoRegister()"></u-text> --> |
| | | <u-text type="primary" text="管理员电话:13800138008"></u-text> |
| | | <view class="login_content_button"> |
| | | <u-button |
| | | type="primary" |
| | |
| | | }, |
| | | onShow() { |
| | | const that = this; |
| | | uni.clearStorage(); |
| | | uni.clearStorageSync(); |
| | | wx.getSetting({ |
| | | complete: (info) => { |
| | | if(!info.authSetting['scope.userInfo']) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '是否授权获取您的信息,该信息仅用于确认身份信息', |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.login({ |
| | | success(res) { |
| | | uni.$u.toast('授权成功!'); |
| | | that.$api.system.getUserInfo(res.code).then((res) => { |
| | | if(res.success) { |
| | | uni.setStorageSync('openId', res.data.openid); |
| | | that.$api.system.changeWChartUser({ |
| | | openId: res.data.openid |
| | | }).then((reslut) => { |
| | | console.log(reslut); |
| | | that.switchUserInfo(reslut.data.regstatus, reslut.data.reginfo); |
| | | }) |
| | | } else { |
| | | uni.$u.toast(res.statusMsg); |
| | | } |
| | | }) |
| | | }, |
| | | fail: (err) => { |
| | | console.log(err,'---'); |
| | | } |
| | | }) |
| | | } else if (res.cancel) { |
| | | wx.exitMiniProgram({ |
| | | success: (res) => { |
| | | console.log(res,'--'); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | wx.login({ |
| | | success(res) { |
| | | that.$api.system.getUserInfo(res.code).then((res) => { |
| | | if(res.success) { |
| | | uni.setStorageSync('openId', res.data.openid); |
| | | that.$api.system.changeWChartUser({ |
| | | openId: res.data.openid |
| | | }).then((reslut) => { |
| | | that.switchUserInfo(reslut.data.regstatus, reslut.data.reginfo); |
| | | }) |
| | | } else { |
| | | uni.$u.toast(res.statusMsg); |
| | | } |
| | | }) |
| | | }, |
| | | fail: (err) => { |
| | | console.log(err,'---'); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | // uni.clearStorage(); |
| | | // uni.clearStorageSync(); |
| | | // wx.getSetting({ |
| | | // complete: (info) => { |
| | | // if(!info.authSetting['scope.userInfo']) { |
| | | // uni.showModal({ |
| | | // title: '提示', |
| | | // content: '是否授权获取您的信息,该信息仅用于确认身份信息', |
| | | // success: function (res) { |
| | | // if (res.confirm) { |
| | | // wx.login({ |
| | | // success(res) { |
| | | // uni.$u.toast('授权成功!'); |
| | | // that.$api.system.getUserInfo(res.code).then((res) => { |
| | | // if(res.success) { |
| | | // uni.setStorageSync('openId', res.data.openid); |
| | | // that.$api.system.changeWChartUser({ |
| | | // openId: res.data.openid |
| | | // }).then((reslut) => { |
| | | // console.log(reslut); |
| | | // that.switchUserInfo(reslut.data.regstatus, reslut.data.reginfo); |
| | | // }) |
| | | // } else { |
| | | // uni.$u.toast(res.statusMsg); |
| | | // } |
| | | // }) |
| | | // }, |
| | | // fail: (err) => { |
| | | // console.log(err,'---'); |
| | | // } |
| | | // }) |
| | | // } else if (res.cancel) { |
| | | // wx.exitMiniProgram({ |
| | | // success: (res) => { |
| | | // console.log(res,'--'); |
| | | // } |
| | | // }) |
| | | // } |
| | | // } |
| | | // }); |
| | | // } else { |
| | | // wx.login({ |
| | | // success(res) { |
| | | // that.$api.system.getUserInfo(res.code).then((res) => { |
| | | // if(res.success) { |
| | | // uni.setStorageSync('openId', res.data.openid); |
| | | // that.$api.system.changeWChartUser({ |
| | | // openId: res.data.openid |
| | | // }).then((reslut) => { |
| | | // that.switchUserInfo(reslut.data.regstatus, reslut.data.reginfo); |
| | | // // uni.navigateTo({ |
| | | // // url: '../../robePages/safeManage/addHidden' |
| | | // // }) |
| | | // }) |
| | | // } else { |
| | | // uni.$u.toast(res.statusMsg); |
| | | // } |
| | | // }) |
| | | // }, |
| | | // fail: (err) => { |
| | | // console.log(err,'---'); |
| | | // } |
| | | // }) |
| | | // } |
| | | // } |
| | | // }) |
| | | }, |
| | | onReady() { |
| | | this.$refs.form.setRules(this.rulesLogin); |