|
@@ -194,31 +194,58 @@
|
|
|
return;
|
|
|
}
|
|
|
this.$refs.uCode.start();
|
|
|
+ },
|
|
|
+ query(){
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+
|
|
|
+ API.findByOpenId({
|
|
|
+
|
|
|
+ openId: this.carhelp.getOpenId(),
|
|
|
+
|
|
|
+ }).then((response) => {
|
|
|
+
|
|
|
+ var token = response ? response.data.token : '';
|
|
|
+ this.carhelp.setToken(token);
|
|
|
+ this.carhelp.setPersonInfo(response.data.regUser);
|
|
|
+ //this.gotoUrl("pages/user/index")
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/index/index'
|
|
|
+ })
|
|
|
+
|
|
|
+ }).catch(error => {
|
|
|
+ uni.hideLoading();
|
|
|
+ if (!this.carhelp.getOpenId()) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请使用“微信”访问本系统登录"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ } else if (this.message) {
|
|
|
+ uni.showToast({
|
|
|
+ title: this.message.split(",")[0],
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ var time = this.carhelp.get("getvcodetime");
|
|
|
+ if (time) {
|
|
|
+ //this.$refs.uCode.start();
|
|
|
+ var nowtime = new Date().getTime()
|
|
|
+ var differ = (nowtime - time) / 1000
|
|
|
+ if (differ < 2 * 60) {
|
|
|
+ this.sendMsgSecond = 2 * 60 - parseInt(differ)
|
|
|
+ this.isSendMsgIng = true;
|
|
|
+ this.$refs.uCode.start();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
- onReady() {
|
|
|
- if (!this.carhelp.getOpenId()) {
|
|
|
- uni.showToast({
|
|
|
- title: "请使用“微信”访问本系统登录"
|
|
|
- })
|
|
|
- return
|
|
|
- } else if (this.message) {
|
|
|
- uni.showToast({
|
|
|
- title: this.message.split(",")[0],
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- }
|
|
|
- var time = this.carhelp.get("getvcodetime");
|
|
|
- if (time) {
|
|
|
- //this.$refs.uCode.start();
|
|
|
- var nowtime = new Date().getTime()
|
|
|
- var differ = (nowtime - time) / 1000
|
|
|
- if (differ < 2 * 60) {
|
|
|
- this.sendMsgSecond = 2 * 60 - parseInt(differ)
|
|
|
- this.isSendMsgIng = true;
|
|
|
- this.$refs.uCode.start();
|
|
|
- }
|
|
|
- }
|
|
|
+ onReady() {
|
|
|
+ this.query()
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|