12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- require("../../api/login.js");
- const _sfc_main = {
- data() {
- return {
- userName: "",
- password: "",
- password1: "",
- registrationID: "",
- yzcode: ""
- };
- },
- onLoad(option) {
- let that = this;
- common_vendor.index.$on("getRegistrationID", function(data) {
- that.registrationID = data;
- });
- this.$getRegistrationID();
- },
- onShow() {
- },
- onUnload() {
- common_vendor.index.$off("getRegistrationID");
- },
- mounted() {
- },
- methods: {
- login() {
- if (this.$isEmpty(this.userName)) {
- common_vendor.index.showToast({
- title: "请输入帐号",
- icon: "none"
- });
- return;
- }
- if (this.$isEmpty(this.password)) {
- common_vendor.index.showToast({
- title: "请输入密码",
- icon: "none"
- });
- return;
- }
- var data = {
- userName: this.userName,
- password: this.password,
- jpushId: this.registrationID || common_vendor.index.getStorageSync("registrationID")
- };
- common_vendor.index.showLoading({
- title: "处理中..."
- });
- login(data).then(
- (res) => {
- common_vendor.index.hideLoading();
- if (res.code == 200) {
- common_vendor.index.setStorageSync("AppToken", res.data.token);
- this.$Router.pushTab({ name: "home" });
- } else {
- common_vendor.index.showToast({ title: res.msg, icon: "none" });
- }
- },
- (rej) => {
- }
- );
- },
- goToRegister() {
- this.$navTo("./register");
- },
- goToFindPass() {
- this.$navTo("./findPass");
- },
- getRegistrationID() {
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return {
- a: $data.userName,
- b: common_vendor.o(($event) => $data.userName = $event.detail.value),
- c: $data.password,
- d: common_vendor.o(($event) => $data.password = $event.detail.value),
- e: $data.yzcode,
- f: common_vendor.o(($event) => $data.yzcode = $event.detail.value),
- g: common_vendor.o((...args) => $options.login && $options.login(...args))
- };
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
- wx.createPage(MiniProgramPage);
|