unbindWechat.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. data() {
  5. return {
  6. wechatName: ""
  7. };
  8. },
  9. onLoad() {
  10. this.wechatName = common_vendor.index.getStorageSync("wechatName") || "未绑定";
  11. },
  12. methods: {
  13. submit() {
  14. common_vendor.index.showModal({
  15. title: "确认解绑",
  16. content: "解绑后将无法使用微信快捷登录,是否继续?",
  17. success: (res) => {
  18. if (res.confirm) {
  19. common_vendor.index.request({
  20. url: "http://localhost:9527/api/unbindWechat",
  21. method: "POST",
  22. data: { uid: common_vendor.index.getStorageSync("uid") },
  23. success: (res2) => {
  24. if (res2.statusCode === 200 && res2.data.code === 200) {
  25. common_vendor.index.showToast({ title: "解绑成功", icon: "success" });
  26. setTimeout(() => common_vendor.index.navigateBack(), 1e3);
  27. } else {
  28. common_vendor.index.showToast({ title: res2.data.message || "解绑失败", icon: "none" });
  29. }
  30. }
  31. });
  32. }
  33. }
  34. });
  35. }
  36. }
  37. };
  38. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  39. return {
  40. a: common_vendor.t($data.wechatName),
  41. b: common_vendor.o((...args) => $options.submit && $options.submit(...args))
  42. };
  43. }
  44. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-8015864b"]]);
  45. wx.createPage(MiniProgramPage);
  46. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/mine/unbindWechat.js.map