redirect.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/redirect/redirect" ], {
  2. 325: function(e, t, n) {
  3. (function(e) {
  4. function t(e) {
  5. return e && e.__esModule ? e : {
  6. default: e
  7. };
  8. }
  9. n(4), t(n(2)), e(t(n(326)).default);
  10. }).call(this, n(1).createPage);
  11. },
  12. 326: function(e, t, n) {
  13. n.r(t);
  14. var r = n(327), o = n(329);
  15. for (var c in o) "default" !== c && function(e) {
  16. n.d(t, e, function() {
  17. return o[e];
  18. });
  19. }(c);
  20. var a = n(13), i = Object(a.default)(o.default, r.render, r.staticRenderFns, !1, null, null, null, !1, r.components, void 0);
  21. i.options.__file = "pages/redirect/redirect.vue", t.default = i.exports;
  22. },
  23. 327: function(e, t, n) {
  24. n.r(t);
  25. var r = n(328);
  26. n.d(t, "render", function() {
  27. return r.render;
  28. }), n.d(t, "staticRenderFns", function() {
  29. return r.staticRenderFns;
  30. }), n.d(t, "recyclableRender", function() {
  31. return r.recyclableRender;
  32. }), n.d(t, "components", function() {
  33. return r.components;
  34. });
  35. },
  36. 328: function(e, t, n) {
  37. n.r(t), n.d(t, "render", function() {
  38. return r;
  39. }), n.d(t, "staticRenderFns", function() {
  40. return c;
  41. }), n.d(t, "recyclableRender", function() {
  42. return o;
  43. }), n.d(t, "components", function() {});
  44. var r = function() {
  45. var e = this;
  46. e.$createElement;
  47. e._self._c;
  48. }, o = !1, c = [];
  49. r._withStripped = !0;
  50. },
  51. 329: function(e, t, n) {
  52. n.r(t);
  53. var r = n(330), o = n.n(r);
  54. for (var c in r) "default" !== c && function(e) {
  55. n.d(t, e, function() {
  56. return r[e];
  57. });
  58. }(c);
  59. t.default = o.a;
  60. },
  61. 330: function(e, t, n) {
  62. (function(e) {
  63. function r(e, t) {
  64. var n = Object.keys(e);
  65. if (Object.getOwnPropertySymbols) {
  66. var r = Object.getOwnPropertySymbols(e);
  67. t && (r = r.filter(function(t) {
  68. return Object.getOwnPropertyDescriptor(e, t).enumerable;
  69. })), n.push.apply(n, r);
  70. }
  71. return n;
  72. }
  73. function o(e) {
  74. for (var t = 1; t < arguments.length; t++) {
  75. var n = null != arguments[t] ? arguments[t] : {};
  76. t % 2 ? r(Object(n), !0).forEach(function(t) {
  77. c(e, t, n[t]);
  78. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : r(Object(n)).forEach(function(t) {
  79. Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
  80. });
  81. }
  82. return e;
  83. }
  84. function c(e, t, n) {
  85. return t in e ? Object.defineProperty(e, t, {
  86. value: n,
  87. enumerable: !0,
  88. configurable: !0,
  89. writable: !0
  90. }) : e[t] = n, e;
  91. }
  92. Object.defineProperty(t, "__esModule", {
  93. value: !0
  94. }), t.default = void 0;
  95. var a = n(37), i = n(6), u = n(56), l = {
  96. computed: o({}, (0, i.mapState)([ "urlFile" ])),
  97. onLoad: function(e) {
  98. this.loadMp(e);
  99. },
  100. methods: o(o({}, (0, i.mapMutations)("user", [ "login", "setUserInfo", "userInfo" ])), {}, {
  101. loadMp: function(t) {
  102. var n = this, r = n.$api.prePage().userInfo, o = e.getStorageSync("spread") || "";
  103. (0, u.wechatMpAuth)({
  104. code: t.code,
  105. iv: r.target.iv,
  106. encryptedData: r.target.encryptedData,
  107. spread_spid: o
  108. }).then(function(e) {
  109. var t = e.data;
  110. n.wchatAuth(t);
  111. }).catch(function(n) {
  112. e.showModal({
  113. title: "错误",
  114. content: JSON.stringify(n) + t.code,
  115. showCancel: !1
  116. });
  117. });
  118. },
  119. wchatAuth: function(t) {
  120. var n = this;
  121. e.setStorageSync("token", t.token), (0, a.getUserInfo)({}).then(function(t) {
  122. console.log("获取用户信息"), console.log(t), n.login(), n.setUserInfo(t.data);
  123. var r = e.getStorageSync("present") || "/pages/index/index";
  124. "pages/product/product" == r && (r = "/pages/index/index"), t.data.phone ? e.switchTab({
  125. url: r,
  126. fail: function(t) {
  127. console.log(t), e.navigateTo({
  128. url: r,
  129. fail: function(t) {
  130. console.log(t), e.switchTab({
  131. url: "/pages/index/index"
  132. });
  133. }
  134. });
  135. }
  136. }) : e.showModal({
  137. title: "提示",
  138. content: "请先绑定手机号",
  139. showCancel: !1,
  140. success: function(t) {
  141. e.navigateTo({
  142. url: "/pages/set/phone"
  143. });
  144. },
  145. fail: function(e) {
  146. console.log(e);
  147. }
  148. });
  149. }).catch(function(e) {
  150. console.log(e);
  151. });
  152. }
  153. })
  154. };
  155. t.default = l;
  156. }).call(this, n(1).default);
  157. }
  158. }, [ [ 325, "common/runtime", "common/vendor" ] ] ]);