1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const _sfc_main = {
- data() {
- return {
- password: "",
- confirmPassword: ""
- };
- },
- methods: {
- submit() {
- if (!this.password || this.password.length < 6) {
- common_vendor.index.showToast({ title: "密码至少6位", icon: "none" });
- return;
- }
- if (this.password !== this.confirmPassword) {
- common_vendor.index.showToast({ title: "两次密码不一致", icon: "none" });
- return;
- }
- common_vendor.index.request({
- url: "http://localhost:9527/api/setPassword",
- method: "POST",
- data: {
- uid: common_vendor.index.getStorageSync("uid"),
- password: this.password
- },
- success: (res) => {
- if (res.statusCode === 200 && res.data.code === 200) {
- common_vendor.index.showToast({ title: "设置成功", icon: "success" });
- setTimeout(() => common_vendor.index.navigateBack(), 1e3);
- } else {
- common_vendor.index.showToast({ title: res.data.message || "设置失败", icon: "none" });
- }
- }
- });
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return {
- a: $data.password,
- b: common_vendor.o(($event) => $data.password = $event.detail.value),
- c: $data.confirmPassword,
- d: common_vendor.o(($event) => $data.confirmPassword = $event.detail.value),
- e: common_vendor.o((...args) => $options.submit && $options.submit(...args))
- };
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cf17a44e"]]);
- wx.createPage(MiniProgramPage);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/mine/setPassword.js.map
|