Browse Source

修改token查询条件

zs 1 year ago
parent
commit
86a24de7df
27 changed files with 267 additions and 366 deletions
  1. 57 0
      App.vue
  2. 7 16
      pages/home/index.vue
  3. 4 62
      pages/index/index.vue
  4. 7 15
      pages/my/index.vue
  5. 7 15
      pages/science/index.vue
  6. 1 7
      pagesHome/group/index.vue
  7. 7 15
      pagesMy/answer/index.vue
  8. 6 8
      pagesMy/basic/index.vue
  9. 7 15
      pagesMy/group/index.vue
  10. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map
  11. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/index.js.map
  12. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map
  13. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/my/index.js.map
  14. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/science/index.js.map
  15. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/group/index.js.map
  16. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesMy/answer/index.js.map
  17. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesMy/basic/index.js.map
  18. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesMy/group/index.js.map
  19. 101 0
      unpackage/dist/dev/mp-weixin/common/main.js
  20. 7 16
      unpackage/dist/dev/mp-weixin/pages/home/index.js
  21. 12 113
      unpackage/dist/dev/mp-weixin/pages/index/index.js
  22. 7 15
      unpackage/dist/dev/mp-weixin/pages/my/index.js
  23. 7 15
      unpackage/dist/dev/mp-weixin/pages/science/index.js
  24. 1 7
      unpackage/dist/dev/mp-weixin/pagesHome/group/index.js
  25. 7 15
      unpackage/dist/dev/mp-weixin/pagesMy/answer/index.js
  26. 6 8
      unpackage/dist/dev/mp-weixin/pagesMy/basic/index.js
  27. 7 15
      unpackage/dist/dev/mp-weixin/pagesMy/group/index.js

+ 57 - 0
App.vue

@@ -6,11 +6,68 @@
 		},
 		onShow: function() {
 			const that = this;
+			that.search();
 		},
 		onHide: function() {
 			console.log('App Hide')
 		},
 		methods: {
+			search() {
+				const that = this;
+				uni.getStorage({
+					key: 'openid',
+					success: function(res) {
+						that.searchOpenid(res.data)
+					},
+					fail: function(err) {
+						uni.login({
+							success: async function(res) {
+								if (res.code) {
+									const aee = await that.$app('/wechat/api/login/app', 'GET', {
+										js_code: res.code,
+										config: that.$config.wx_projectkey
+									})
+									if (aee.errcode == '0') {
+										uni.setStorage({
+											key: "openid",
+											data: aee.data.openid
+										})
+										that.searchOpenid(aee.data.openid)
+									} else {
+										uni.showToast({
+											title: aee.errmsg,
+											icon: 'none'
+										})
+									}
+								} else {
+									uni.showToast({
+										title: res.errMsg,
+										icon: 'none'
+									})
+								}
+							}
+						});
+					}
+				})
+			},
+			async searchOpenid(openid) {
+				const that = this;
+				const aee = await that.$api(`/login/wxapp/${openid}`, 'POST', {})
+				if (aee.errcode == '0') {
+					uni.setStorage({
+						key: "token",
+						data: aee.data
+					})
+					uni.reLaunch({
+						url: `/pages/home/index`
+					})
+				} else {
+					uni.showToast({
+						title: aee.errmsg,
+						icon: 'none'
+					})
+				}
+			},
 			// 强制更新
 			forceUpdate() {
 				const that = this;

+ 7 - 16
pages/home/index.vue

@@ -77,27 +77,18 @@
 				const that = this;
 				try {
 					const res = uni.getStorageSync('token');
-					if (res) that.$set(that, `user`, res);
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
+					if (res) {
+						const user = that.$jwt(res);
+						that.$set(that, `user`, user);
+					}
+				} catch (e) {}
 			},
 			searchConfig() {
 				const that = this;
 				try {
 					const res = uni.getStorageSync('config');
 					if (res) that.$set(that, `config`, res);
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
+				} catch (e) {}
 			},
 			// 查询
 			async search() {
@@ -116,7 +107,7 @@
 					});
 				}
 				let info = {
-					// doctor: that.user._id,
+					doctor: that.user._id
 				}
 				// 群组
 				res = await that.$api(`/group`, 'GET', {

+ 4 - 62
pages/index/index.vue

@@ -15,78 +15,20 @@
 		},
 		onShow: async function() {
 			const that = this;
-			await that.search();
 			await that.searchConfig();
 		},
 		methods: {
-			search() {
-				const that = this;
-				uni.getStorage({
-					key: 'openid',
-					success: function(res) {
-						that.searchOpenid(res.data)
-					},
-					fail: function(err) {
-						uni.login({
-							success: async function(res) {
-								if (res.code) {
-									const aee = await that.$app('/wechat/api/login/app', 'GET', {
-										js_code: res.code,
-										config: that.$config.wx_projectkey
-									})
-									if (aee.errcode == '0') {
-										uni.setStorage({
-											key: "openid",
-											data: aee.data.openid
-										})
-										that.searchOpenid(aee.data.openid)
-									} else {
-										uni.showToast({
-											title: aee.errmsg,
-											icon: 'none'
-										})
-									}
-								} else {
-									uni.showToast({
-										title: res.errMsg,
-										icon: 'none'
-									})
-								}
-							}
-						});
-					}
-				})
-			},
 			// 查询基本设置
 			async searchConfig() {
 				const that = this;
-				const res = await that.$api(`/config`, 'GET', {});
-				if (res.errcode == '0') {
-					that.$set(that, `logoUrl`, res.data.logo_url[0].url);
+				const arr = await that.$api(`/config`, 'GET', {});
+				if (arr.errcode == '0') {
+					that.$set(that, `logoUrl`, arr.data.logo_url[0].url);
 					uni.setStorage({
 						key: 'config',
-						data: res.data,
-						success: function(res) {},
-						fail: function(err) {}
-					})
-				}
-			},
-			async searchOpenid(openid) {
-				const that = this;
-				const aee = await that.$api(`/login/wxapp/${openid}`, 'POST', {})
-				if (aee.errcode == '0') {
-					uni.reLaunch({
-						url: `/pages/home/index`
-					})
-				} else {
-					uni.showToast({
-						title: aee.errmsg,
-						icon: 'none'
+						data: arr.data,
 					})
 				}
-				uni.reLaunch({
-					url: `/pages/home/index`
-				})
 			}
 		},
 	}

+ 7 - 15
pages/my/index.vue

@@ -47,31 +47,23 @@
 			await that.search();
 		},
 		methods: {
+			// 用户信息
 			searchToken() {
 				const that = this;
 				try {
 					const res = uni.getStorageSync('token');
-					if (res) that.$set(that, `user`, res);
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
+					if (res) {
+						const user = that.$jwt(res);
+						that.$set(that, `user`, user);
+					}
+				} catch (e) {}
 			},
 			searchConfig() {
 				const that = this;
 				try {
 					const res = uni.getStorageSync('config');
 					if (res) that.$set(that, `config`, res);
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
+				} catch (e) {}
 			},
 			// 查询
 			async search() {

+ 7 - 15
pages/science/index.vue

@@ -69,31 +69,23 @@
 			uni.stopPullDownRefresh();
 		},
 		methods: {
+			// 用户信息
 			searchToken() {
 				const that = this;
 				try {
 					const res = uni.getStorageSync('token');
-					if (res) that.$set(that, `user`, res);
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
+					if (res) {
+						const user = that.$jwt(res);
+						that.$set(that, `user`, user);
+					}
+				} catch (e) {}
 			},
 			searchConfig() {
 				const that = this;
 				try {
 					const res = uni.getStorageSync('config');
 					if (res) that.$set(that, `config`, res);
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
+				} catch (e) {}
 			},
 			async search() {
 				const that = this;

+ 1 - 7
pagesHome/group/index.vue

@@ -83,13 +83,7 @@
 				try {
 					const res = uni.getStorageSync('config');
 					if (res) that.$set(that, `config`, res);
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
+				} catch (e) {}
 			},
 			async search() {
 				const that = this;

+ 7 - 15
pagesMy/answer/index.vue

@@ -51,31 +51,23 @@
 			uni.stopPullDownRefresh();
 		},
 		methods: {
+			// 用户信息
 			searchToken() {
 				const that = this;
 				try {
 					const res = uni.getStorageSync('token');
-					if (res) that.$set(that, `user`, res);
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
+					if (res) {
+						const user = that.$jwt(res);
+						that.$set(that, `user`, user);
+					}
+				} catch (e) {}
 			},
 			searchConfig() {
 				const that = this;
 				try {
 					const res = uni.getStorageSync('config');
 					if (res) that.$set(that, `config`, res);
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
+				} catch (e) {}
 			},
 			async search() {
 				const that = this;

+ 6 - 8
pagesMy/basic/index.vue

@@ -94,18 +94,16 @@
 			that.searchToken();
 		},
 		methods: {
+			// 用户信息
 			searchToken() {
 				const that = this;
 				try {
 					const res = uni.getStorageSync('token');
-					if (res) that.$set(that, `user`, res);
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
+					if (res) {
+						const user = that.$jwt(res);
+						that.$set(that, `user`, user);
+					}
+				} catch (e) {}
 			},
 			// 查询
 			async search() {

+ 7 - 15
pagesMy/group/index.vue

@@ -51,31 +51,23 @@
 			uni.stopPullDownRefresh();
 		},
 		methods: {
+			// 用户信息
 			searchToken() {
 				const that = this;
 				try {
 					const res = uni.getStorageSync('token');
-					if (res) that.$set(that, `user`, res);
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
+					if (res) {
+						const user = that.$jwt(res);
+						that.$set(that, `user`, user);
+					}
+				} catch (e) {}
 			},
 			searchConfig() {
 				const that = this;
 				try {
 					const res = uni.getStorageSync('config');
 					if (res) that.$set(that, `config`, res);
-				} catch (e) {
-					uni.showToast({
-						title: err.errmsg,
-						icon: 'error',
-						duration: 2000
-					});
-				}
+				} catch (e) {}
 			},
 			async search() {
 				const that = this;

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/my/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/science/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/group/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesMy/answer/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesMy/basic/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesMy/group/index.js.map


+ 101 - 0
unpackage/dist/dev/mp-weixin/common/main.js

@@ -108,10 +108,13 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 /* WEBPACK VAR INJECTION */(function(uni) {
 
+var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
 exports.default = void 0;
+var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 35));
+var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 37));
 var _default = {
   onLaunch: function onLaunch() {
     var that = this;
@@ -119,11 +122,109 @@ var _default = {
   },
   onShow: function onShow() {
     var that = this;
+    that.search();
   },
   onHide: function onHide() {
     console.log('App Hide');
   },
   methods: {
+    search: function search() {
+      var that = this;
+      uni.getStorage({
+        key: 'openid',
+        success: function success(res) {
+          that.searchOpenid(res.data);
+        },
+        fail: function fail(err) {
+          uni.login({
+            success: function () {
+              var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(res) {
+                var aee;
+                return _regenerator.default.wrap(function _callee$(_context) {
+                  while (1) {
+                    switch (_context.prev = _context.next) {
+                      case 0:
+                        if (!res.code) {
+                          _context.next = 7;
+                          break;
+                        }
+                        _context.next = 3;
+                        return that.$app('/wechat/api/login/app', 'GET', {
+                          js_code: res.code,
+                          config: that.$config.wx_projectkey
+                        });
+                      case 3:
+                        aee = _context.sent;
+                        if (aee.errcode == '0') {
+                          uni.setStorage({
+                            key: "openid",
+                            data: aee.data.openid
+                          });
+                          that.searchOpenid(aee.data.openid);
+                        } else {
+                          uni.showToast({
+                            title: aee.errmsg,
+                            icon: 'none'
+                          });
+                        }
+                        _context.next = 8;
+                        break;
+                      case 7:
+                        uni.showToast({
+                          title: res.errMsg,
+                          icon: 'none'
+                        });
+                      case 8:
+                      case "end":
+                        return _context.stop();
+                    }
+                  }
+                }, _callee);
+              }));
+              function success(_x) {
+                return _success.apply(this, arguments);
+              }
+              return success;
+            }()
+          });
+        }
+      });
+    },
+    searchOpenid: function searchOpenid(openid) {
+      var _this = this;
+      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
+        var that, aee;
+        return _regenerator.default.wrap(function _callee2$(_context2) {
+          while (1) {
+            switch (_context2.prev = _context2.next) {
+              case 0:
+                that = _this;
+                _context2.next = 3;
+                return that.$api("/login/wxapp/".concat(openid), 'POST', {});
+              case 3:
+                aee = _context2.sent;
+                if (aee.errcode == '0') {
+                  uni.setStorage({
+                    key: "token",
+                    data: aee.data
+                  });
+                  uni.reLaunch({
+                    url: "/pages/home/index"
+                  });
+                } else {
+                  uni.showToast({
+                    title: aee.errmsg,
+                    icon: 'none'
+                  });
+                }
+              case 5:
+              case "end":
+                return _context2.stop();
+            }
+          }
+        }, _callee2);
+      }))();
+    },
     // 强制更新
     forceUpdate: function forceUpdate() {
       var that = this;

+ 7 - 16
unpackage/dist/dev/mp-weixin/pages/home/index.js

@@ -315,27 +315,18 @@ var _default = {
       var that = this;
       try {
         var res = uni.getStorageSync('token');
-        if (res) that.$set(that, "user", res);
-      } catch (e) {
-        uni.showToast({
-          title: err.errmsg,
-          icon: 'error',
-          duration: 2000
-        });
-      }
+        if (res) {
+          var user = that.$jwt(res);
+          that.$set(that, "user", user);
+        }
+      } catch (e) {}
     },
     searchConfig: function searchConfig() {
       var that = this;
       try {
         var res = uni.getStorageSync('config');
         if (res) that.$set(that, "config", res);
-      } catch (e) {
-        uni.showToast({
-          title: err.errmsg,
-          icon: 'error',
-          duration: 2000
-        });
-      }
+      } catch (e) {}
     },
     // 查询
     search: function search() {
@@ -362,7 +353,7 @@ var _default = {
                   });
                 }
                 info = {
-                  // doctor: that.user._id,
+                  doctor: that.user._id
                 }; // 群组
                 _context3.next = 8;
                 return that.$api("/group", 'GET', _objectSpread(_objectSpread({}, info), that.searchgroup));

+ 12 - 113
unpackage/dist/dev/mp-weixin/pages/index/index.js

@@ -167,11 +167,8 @@ var _default = {
             case 0:
               that = this;
               _context.next = 3;
-              return that.search();
-            case 3:
-              _context.next = 5;
               return that.searchConfig();
-            case 5:
+            case 3:
             case "end":
               return _context.stop();
           }
@@ -184,131 +181,33 @@ var _default = {
     return onShow;
   }(),
   methods: {
-    search: function search() {
-      var that = this;
-      uni.getStorage({
-        key: 'openid',
-        success: function success(res) {
-          that.searchOpenid(res.data);
-        },
-        fail: function fail(err) {
-          uni.login({
-            success: function () {
-              var _success = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(res) {
-                var aee;
-                return _regenerator.default.wrap(function _callee2$(_context2) {
-                  while (1) {
-                    switch (_context2.prev = _context2.next) {
-                      case 0:
-                        if (!res.code) {
-                          _context2.next = 7;
-                          break;
-                        }
-                        _context2.next = 3;
-                        return that.$app('/wechat/api/login/app', 'GET', {
-                          js_code: res.code,
-                          config: that.$config.wx_projectkey
-                        });
-                      case 3:
-                        aee = _context2.sent;
-                        if (aee.errcode == '0') {
-                          uni.setStorage({
-                            key: "openid",
-                            data: aee.data.openid
-                          });
-                          that.searchOpenid(aee.data.openid);
-                        } else {
-                          uni.showToast({
-                            title: aee.errmsg,
-                            icon: 'none'
-                          });
-                        }
-                        _context2.next = 8;
-                        break;
-                      case 7:
-                        uni.showToast({
-                          title: res.errMsg,
-                          icon: 'none'
-                        });
-                      case 8:
-                      case "end":
-                        return _context2.stop();
-                    }
-                  }
-                }, _callee2);
-              }));
-              function success(_x) {
-                return _success.apply(this, arguments);
-              }
-              return success;
-            }()
-          });
-        }
-      });
-    },
     // 查询基本设置
     searchConfig: function searchConfig() {
       var _this = this;
-      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
-        var that, res;
-        return _regenerator.default.wrap(function _callee3$(_context3) {
+      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
+        var that, arr;
+        return _regenerator.default.wrap(function _callee2$(_context2) {
           while (1) {
-            switch (_context3.prev = _context3.next) {
+            switch (_context2.prev = _context2.next) {
               case 0:
                 that = _this;
-                _context3.next = 3;
+                _context2.next = 3;
                 return that.$api("/config", 'GET', {});
               case 3:
-                res = _context3.sent;
-                if (res.errcode == '0') {
-                  that.$set(that, "logoUrl", res.data.logo_url[0].url);
+                arr = _context2.sent;
+                if (arr.errcode == '0') {
+                  that.$set(that, "logoUrl", arr.data.logo_url[0].url);
                   uni.setStorage({
                     key: 'config',
-                    data: res.data,
-                    success: function success(res) {},
-                    fail: function fail(err) {}
+                    data: arr.data
                   });
                 }
               case 5:
               case "end":
-                return _context3.stop();
-            }
-          }
-        }, _callee3);
-      }))();
-    },
-    searchOpenid: function searchOpenid(openid) {
-      var _this2 = this;
-      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
-        var that, aee;
-        return _regenerator.default.wrap(function _callee4$(_context4) {
-          while (1) {
-            switch (_context4.prev = _context4.next) {
-              case 0:
-                that = _this2;
-                _context4.next = 3;
-                return that.$api("/login/wxapp/".concat(openid), 'POST', {});
-              case 3:
-                aee = _context4.sent;
-                if (aee.errcode == '0') {
-                  uni.reLaunch({
-                    url: "/pages/home/index"
-                  });
-                } else {
-                  uni.showToast({
-                    title: aee.errmsg,
-                    icon: 'none'
-                  });
-                }
-                uni.reLaunch({
-                  url: "/pages/home/index"
-                });
-              case 6:
-              case "end":
-                return _context4.stop();
+                return _context2.stop();
             }
           }
-        }, _callee4);
+        }, _callee2);
       }))();
     }
   }

+ 7 - 15
unpackage/dist/dev/mp-weixin/pages/my/index.js

@@ -237,31 +237,23 @@ var _default = {
     return onShow;
   }(),
   methods: {
+    // 用户信息
     searchToken: function searchToken() {
       var that = this;
       try {
         var res = uni.getStorageSync('token');
-        if (res) that.$set(that, "user", res);
-      } catch (e) {
-        uni.showToast({
-          title: err.errmsg,
-          icon: 'error',
-          duration: 2000
-        });
-      }
+        if (res) {
+          var user = that.$jwt(res);
+          that.$set(that, "user", user);
+        }
+      } catch (e) {}
     },
     searchConfig: function searchConfig() {
       var that = this;
       try {
         var res = uni.getStorageSync('config');
         if (res) that.$set(that, "config", res);
-      } catch (e) {
-        uni.showToast({
-          title: err.errmsg,
-          icon: 'error',
-          duration: 2000
-        });
-      }
+      } catch (e) {}
     },
     // 查询
     search: function search() {

+ 7 - 15
unpackage/dist/dev/mp-weixin/pages/science/index.js

@@ -290,31 +290,23 @@ var _default = {
     return onPullDownRefresh;
   }(),
   methods: {
+    // 用户信息
     searchToken: function searchToken() {
       var that = this;
       try {
         var res = uni.getStorageSync('token');
-        if (res) that.$set(that, "user", res);
-      } catch (e) {
-        uni.showToast({
-          title: err.errmsg,
-          icon: 'error',
-          duration: 2000
-        });
-      }
+        if (res) {
+          var user = that.$jwt(res);
+          that.$set(that, "user", user);
+        }
+      } catch (e) {}
     },
     searchConfig: function searchConfig() {
       var that = this;
       try {
         var res = uni.getStorageSync('config');
         if (res) that.$set(that, "config", res);
-      } catch (e) {
-        uni.showToast({
-          title: err.errmsg,
-          icon: 'error',
-          duration: 2000
-        });
-      }
+      } catch (e) {}
     },
     search: function search() {
       var _this = this;

+ 1 - 7
unpackage/dist/dev/mp-weixin/pagesHome/group/index.js

@@ -269,13 +269,7 @@ var _default = {
       try {
         var res = uni.getStorageSync('config');
         if (res) that.$set(that, "config", res);
-      } catch (e) {
-        uni.showToast({
-          title: err.errmsg,
-          icon: 'error',
-          duration: 2000
-        });
-      }
+      } catch (e) {}
     },
     search: function search() {
       var _this = this;

+ 7 - 15
unpackage/dist/dev/mp-weixin/pagesMy/answer/index.js

@@ -249,31 +249,23 @@ var _default = {
     return onPullDownRefresh;
   }(),
   methods: {
+    // 用户信息
     searchToken: function searchToken() {
       var that = this;
       try {
         var res = uni.getStorageSync('token');
-        if (res) that.$set(that, "user", res);
-      } catch (e) {
-        uni.showToast({
-          title: err.errmsg,
-          icon: 'error',
-          duration: 2000
-        });
-      }
+        if (res) {
+          var user = that.$jwt(res);
+          that.$set(that, "user", user);
+        }
+      } catch (e) {}
     },
     searchConfig: function searchConfig() {
       var that = this;
       try {
         var res = uni.getStorageSync('config');
         if (res) that.$set(that, "config", res);
-      } catch (e) {
-        uni.showToast({
-          title: err.errmsg,
-          icon: 'error',
-          duration: 2000
-        });
-      }
+      } catch (e) {}
     },
     search: function search() {
       var _this = this;

+ 6 - 8
unpackage/dist/dev/mp-weixin/pagesMy/basic/index.js

@@ -211,18 +211,16 @@ var _default = {
     return onShow;
   }(),
   methods: {
+    // 用户信息
     searchToken: function searchToken() {
       var that = this;
       try {
         var res = uni.getStorageSync('token');
-        if (res) that.$set(that, "user", res);
-      } catch (e) {
-        uni.showToast({
-          title: err.errmsg,
-          icon: 'error',
-          duration: 2000
-        });
-      }
+        if (res) {
+          var user = that.$jwt(res);
+          that.$set(that, "user", user);
+        }
+      } catch (e) {}
     },
     // 查询
     search: function search() {

+ 7 - 15
unpackage/dist/dev/mp-weixin/pagesMy/group/index.js

@@ -254,31 +254,23 @@ var _default = {
     return onPullDownRefresh;
   }(),
   methods: {
+    // 用户信息
     searchToken: function searchToken() {
       var that = this;
       try {
         var res = uni.getStorageSync('token');
-        if (res) that.$set(that, "user", res);
-      } catch (e) {
-        uni.showToast({
-          title: err.errmsg,
-          icon: 'error',
-          duration: 2000
-        });
-      }
+        if (res) {
+          var user = that.$jwt(res);
+          that.$set(that, "user", user);
+        }
+      } catch (e) {}
     },
     searchConfig: function searchConfig() {
       var that = this;
       try {
         var res = uni.getStorageSync('config');
         if (res) that.$set(that, "config", res);
-      } catch (e) {
-        uni.showToast({
-          title: err.errmsg,
-          icon: 'error',
-          duration: 2000
-        });
-      }
+      } catch (e) {}
     },
     search: function search() {
       var _this = this;