WXL
11 小时以前 05c363fdd7ab04e3bd9a753e2c5d5bfff04d681c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
  __name: "Register",
  setup(__props) {
    const form = common_vendor.ref({
      username: "",
      password: "",
      confirm: ""
    });
    const register = async () => {
      if (form.value.password !== form.value.confirm) {
        return common_vendor.index.showToast({
          title: "两次密码不一致",
          icon: "none"
        });
      }
      const res = await common_vendor.index.request({
        url: "https://api.xxx.com/register",
        method: "POST",
        data: form.value
      });
      if (res.data.code === 200) {
        common_vendor.index.showToast({
          title: "注册成功",
          icon: "success"
        });
        setTimeout(() => common_vendor.index.redirectTo({
          url: "/pages/login"
        }), 1e3);
      } else {
        common_vendor.index.showToast({
          title: res.data.message,
          icon: "none"
        });
      }
    };
    return (_ctx, _cache) => {
      return {
        a: form.value.username,
        b: common_vendor.o(($event) => form.value.username = $event.detail.value),
        c: form.value.password,
        d: common_vendor.o(($event) => form.value.password = $event.detail.value),
        e: form.value.confirm,
        f: common_vendor.o(($event) => form.value.confirm = $event.detail.value),
        g: common_vendor.o(register),
        h: common_vendor.gei(_ctx, "")
      };
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-8c973bde"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/Register.js.map