|
@@ -217,28 +217,24 @@ var _default = {
|
|
|
searchConfig: function searchConfig() {
|
|
|
var _this = this;
|
|
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
|
- var that, res;
|
|
|
+ var that;
|
|
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
|
while (1) {
|
|
|
switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
- that = _this;
|
|
|
- _context2.next = 3;
|
|
|
- return that.$api("/config", 'GET', {});
|
|
|
- case 3:
|
|
|
- res = _context2.sent;
|
|
|
- if (res.errcode == '0') {
|
|
|
- that.$set(that, "logoUrl", res.data.logo_url[0].url);
|
|
|
- uni.setStorage({
|
|
|
- key: 'config',
|
|
|
- data: res.data,
|
|
|
- success: function success(res) {},
|
|
|
- fail: function fail(err) {
|
|
|
- console.log(err);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- case 5:
|
|
|
+ that = _this; // let res = await that.$api(`/config`, 'GET', {});
|
|
|
+ // if (res.errcode == '0') {
|
|
|
+ // that.$set(that, `logoUrl`, res.data.logo_url[0].url);
|
|
|
+ // uni.setStorage({
|
|
|
+ // key: 'config',
|
|
|
+ // data: res.data,
|
|
|
+ // success: function(res) {},
|
|
|
+ // fail: function(err) {
|
|
|
+ // console.log(err);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ case 1:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
@@ -249,44 +245,40 @@ var _default = {
|
|
|
searchOpenid: function searchOpenid() {
|
|
|
var _this2 = this;
|
|
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
|
- var that, res, aee;
|
|
|
+ var that;
|
|
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
|
while (1) {
|
|
|
switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
- that = _this2;
|
|
|
- _context3.prev = 1;
|
|
|
- res = uni.getStorageSync('openid');
|
|
|
- _context3.next = 5;
|
|
|
- return that.$api("/login/wxapp/".concat(res), 'POST', {});
|
|
|
- case 5:
|
|
|
- aee = _context3.sent;
|
|
|
- if (aee.errcode == '0') {
|
|
|
- uni.reLaunch({
|
|
|
- url: "/pages/home/index"
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: aee.errmsg,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- }
|
|
|
- _context3.next = 12;
|
|
|
- break;
|
|
|
- case 9:
|
|
|
- _context3.prev = 9;
|
|
|
- _context3.t0 = _context3["catch"](1);
|
|
|
- uni.showToast({
|
|
|
- title: err.errmsg,
|
|
|
- icon: 'error',
|
|
|
- duration: 2000
|
|
|
+ that = _this2; // try {
|
|
|
+ // const res = uni.getStorageSync('openid');
|
|
|
+ // const aee = await that.$api(`/login/wxapp/${res}`, 'POST', {})
|
|
|
+ // if (aee.errcode == '0') {
|
|
|
+ // uni.reLaunch({
|
|
|
+ // url: `/pages/home/index`
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: aee.errmsg,
|
|
|
+ // icon: 'none'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // } catch (e) {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: err.errmsg,
|
|
|
+ // icon: 'error',
|
|
|
+ // duration: 2000
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ uni.reLaunch({
|
|
|
+ url: "/pages/home/index"
|
|
|
});
|
|
|
- case 12:
|
|
|
+ case 2:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}
|
|
|
- }, _callee3, null, [[1, 9]]);
|
|
|
+ }, _callee3);
|
|
|
}))();
|
|
|
}
|
|
|
}
|