"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
|