findpass.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. "use strict";
  2. var common_vendor = require("../../common/vendor.js");
  3. require("../../api/login.js");
  4. require("../../common/request.js");
  5. const _sfc_main = {
  6. data() {
  7. return {
  8. userName: "",
  9. password: "",
  10. password1: "",
  11. registrationID: "",
  12. yzcode: ""
  13. };
  14. },
  15. onLoad(option) {
  16. let that = this;
  17. common_vendor.index.$on("getRegistrationID", function(data) {
  18. that.registrationID = data;
  19. });
  20. this.$getRegistrationID();
  21. },
  22. onShow() {
  23. },
  24. onUnload() {
  25. common_vendor.index.$off("getRegistrationID");
  26. },
  27. mounted() {
  28. },
  29. methods: {
  30. login() {
  31. if (this.$isEmpty(this.userName)) {
  32. common_vendor.index.showToast({
  33. title: "\u8BF7\u8F93\u5165\u5E10\u53F7",
  34. icon: "none"
  35. });
  36. return;
  37. }
  38. if (this.$isEmpty(this.password)) {
  39. common_vendor.index.showToast({
  40. title: "\u8BF7\u8F93\u5165\u5BC6\u7801",
  41. icon: "none"
  42. });
  43. return;
  44. }
  45. var data = {
  46. userName: this.userName,
  47. password: this.password,
  48. jpushId: this.registrationID || common_vendor.index.getStorageSync("registrationID")
  49. };
  50. common_vendor.index.showLoading({
  51. title: "\u5904\u7406\u4E2D..."
  52. });
  53. login(data).then((res) => {
  54. common_vendor.index.hideLoading();
  55. if (res.code == 200) {
  56. common_vendor.index.setStorageSync("AppToken", res.data.token);
  57. this.$Router.pushTab({ name: "home" });
  58. } else {
  59. common_vendor.index.showToast({ title: res.msg, icon: "none" });
  60. }
  61. }, (rej) => {
  62. });
  63. },
  64. goToRegister() {
  65. this.$navTo("./register");
  66. },
  67. goToFindPass() {
  68. this.$navTo("./findPass");
  69. },
  70. getRegistrationID() {
  71. }
  72. }
  73. };
  74. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  75. return {
  76. a: $data.userName,
  77. b: common_vendor.o(($event) => $data.userName = $event.detail.value),
  78. c: $data.password,
  79. d: common_vendor.o(($event) => $data.password = $event.detail.value),
  80. e: $data.yzcode,
  81. f: common_vendor.o(($event) => $data.yzcode = $event.detail.value),
  82. g: common_vendor.o((...args) => $options.login && $options.login(...args))
  83. };
  84. }
  85. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "C:/Users/Administrator/Desktop/\u9879\u76EE/\u76F4\u64AD/liveH5-v3/pages/auth/findpass.vue"]]);
  86. wx.createPage(MiniProgramPage);