findpass.js 1.3 KB

1
  1. "use strict";const e=require("../../common/vendor.js");require("../../api/login.js");const a={data(){return{userName:"",password:"",password1:"",registrationID:"",yzcode:""}},onLoad(s){let o=this;e.index.$on("getRegistrationID",function(n){o.registrationID=n}),this.$getRegistrationID()},onShow(){},onUnload(){e.index.$off("getRegistrationID")},mounted(){},methods:{login(){if(this.$isEmpty(this.userName)){e.index.showToast({title:"请输入帐号",icon:"none"});return}if(this.$isEmpty(this.password)){e.index.showToast({title:"请输入密码",icon:"none"});return}var s={userName:this.userName,password:this.password,jpushId:this.registrationID||e.index.getStorageSync("registrationID")};e.index.showLoading({title:"处理中..."}),login(s).then(o=>{e.index.hideLoading(),o.code==200?(e.index.setStorageSync("AppToken",o.data.token),this.$Router.pushTab({name:"home"})):e.index.showToast({title:o.msg,icon:"none"})},o=>{})},goToRegister(){this.$navTo("./register")},goToFindPass(){this.$navTo("./findPass")},getRegistrationID(){}}};function d(s,o,n,h,i,r){return{a:i.userName,b:e.o(t=>i.userName=t.detail.value),c:i.password,d:e.o(t=>i.password=t.detail.value),e:i.yzcode,f:e.o(t=>i.yzcode=t.detail.value),g:e.o((...t)=>r.login&&r.login(...t))}}const g=e._export_sfc(a,[["render",d]]);wx.createPage(g);