合同小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.3 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const api = require("../../api.js");
  4. const common_assets = require("../../common/assets.js");
  5. const _sfc_main = common_vendor.defineComponent({
  6. data() {
  7. return {
  8. avatar: "",
  9. nickName: ""
  10. };
  11. },
  12. mounted() {
  13. api.isToken();
  14. this.avatar = getApp().usrInfo.avatar;
  15. this.nickName = getApp().usrInfo.nickName;
  16. common_vendor.index.__f__("log", "at pages/index/wode.uvue:55", common_vendor.index.getStorageSync("token"));
  17. },
  18. methods: {
  19. logout() {
  20. common_vendor.index.showModal({
  21. title: "提示",
  22. content: "确定要退出登录吗?",
  23. success: (res) => {
  24. if (res.confirm) {
  25. api.logout().then((res2 = null) => {
  26. if (res2.success) {
  27. common_vendor.index.showToast({
  28. title: "退出登录成功",
  29. icon: "success",
  30. success: () => {
  31. common_vendor.index.clearStorageSync();
  32. setTimeout(() => {
  33. common_vendor.index.navigateTo({ url: "/pages/index/login" });
  34. }, 1500);
  35. }
  36. });
  37. }
  38. });
  39. }
  40. }
  41. });
  42. }
  43. }
  44. });
  45. if (!Array) {
  46. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  47. _easycom_uni_icons2();
  48. }
  49. const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
  50. if (!Math) {
  51. _easycom_uni_icons();
  52. }
  53. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  54. return {
  55. a: $data.avatar,
  56. b: common_vendor.t($data.nickName),
  57. c: common_assets._imports_0$2,
  58. d: common_vendor.p({
  59. type: "right"
  60. }),
  61. e: common_assets._imports_1$1,
  62. f: common_vendor.p({
  63. type: "right"
  64. }),
  65. g: common_assets._imports_2$1,
  66. h: common_vendor.p({
  67. type: "right"
  68. }),
  69. i: common_vendor.o((...args) => $options.logout && $options.logout(...args)),
  70. j: common_vendor.sei(_ctx.virtualHostId, "view")
  71. };
  72. }
  73. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  74. wx.createPage(MiniProgramPage);
  75. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/wode.js.map