完成登录的基本流程
This commit is contained in:
@ -109,8 +109,11 @@ try {
|
||||
uCheckbox: function () {
|
||||
return __webpack_require__.e(/*! import() | components/uview-ui/components/u-checkbox/u-checkbox */ "components/uview-ui/components/u-checkbox/u-checkbox").then(__webpack_require__.bind(null, /*! @/components/uview-ui/components/u-checkbox/u-checkbox.vue */ 134))
|
||||
},
|
||||
mploginPopup: function () {
|
||||
return __webpack_require__.e(/*! import() | components/mplogin-popup/mplogin-popup */ "components/mplogin-popup/mplogin-popup").then(__webpack_require__.bind(null, /*! @/components/mplogin-popup/mplogin-popup.vue */ 215))
|
||||
mplogin: function () {
|
||||
return __webpack_require__.e(/*! import() | components/mplogin/mplogin */ "components/mplogin/mplogin").then(__webpack_require__.bind(null, /*! @/components/mplogin/mplogin.vue */ 141))
|
||||
},
|
||||
mobileLogin: function () {
|
||||
return __webpack_require__.e(/*! import() | components/mobile-login/mobile-login */ "components/mobile-login/mobile-login").then(__webpack_require__.bind(null, /*! @/components/mobile-login/mobile-login.vue */ 148))
|
||||
},
|
||||
}
|
||||
} catch (e) {
|
||||
@ -141,7 +144,10 @@ var render = function () {
|
||||
}
|
||||
if (!_vm._isMounted) {
|
||||
_vm.e0 = function ($event) {
|
||||
_vm.loginPopup = false
|
||||
_vm.mpLoginPopup = false
|
||||
}
|
||||
_vm.e1 = function ($event) {
|
||||
_vm.mobilePopup = false
|
||||
}
|
||||
}
|
||||
_vm.$mp.data = Object.assign(
|
||||
@ -210,13 +216,14 @@ var _default = {
|
||||
allow: false
|
||||
},
|
||||
loginData: {},
|
||||
loginPopup: false
|
||||
mpLoginPopup: false,
|
||||
mobilePopup: false
|
||||
};
|
||||
},
|
||||
onLoad: function onLoad() {},
|
||||
methods: _objectSpread(_objectSpread(_objectSpread({}, (0, _vuex.mapMutations)(['LOGIN', 'LOGOUT'])), (0, _vuex.mapActions)(['getUser'])), {}, {
|
||||
// 小程序快捷登录
|
||||
fastLogin: function fastLogin() {
|
||||
mpLogin: function mpLogin() {
|
||||
var _this = this;
|
||||
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
||||
var _yield$getUserInfo, _yield$getUserInfo$us, avatarUrl, nickName, gender, wxCode, _yield$authLogin, code, data, msg;
|
||||
@ -265,7 +272,7 @@ var _default = {
|
||||
if (code == 1) {
|
||||
if (data.is_new_user) {
|
||||
uni.hideLoading();
|
||||
_this.loginPopup = true;
|
||||
_this.mpLoginPopup = true;
|
||||
_this.loginData = data;
|
||||
} else {
|
||||
_this.loginHandle(data);
|
||||
@ -308,16 +315,48 @@ var _default = {
|
||||
}, _callee2);
|
||||
}))();
|
||||
},
|
||||
// 登录结果处理
|
||||
loginHandle: function loginHandle(data) {
|
||||
// 手机登录
|
||||
mobileLogin: function mobileLogin() {
|
||||
if (!this.form.allow) {
|
||||
return this.$toast({
|
||||
title: "请您先阅读并同意服务协议和隐私政策"
|
||||
});
|
||||
}
|
||||
this.mobilePopup = true;
|
||||
},
|
||||
// 更新新注册的用户信息
|
||||
handleSubmitMobile: function handleSubmitMobile(e) {
|
||||
var _this3 = this;
|
||||
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
||||
var inviteCode;
|
||||
return _regenerator.default.wrap(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
switch (_context3.prev = _context3.next) {
|
||||
case 0:
|
||||
_this3.LOGIN(data);
|
||||
(0, _app.mobileLogin)({
|
||||
mobile: e.mobile
|
||||
}).then(function (res) {
|
||||
if (res.code == 1) {
|
||||
_this3.loginHandle(res.data);
|
||||
}
|
||||
});
|
||||
case 1:
|
||||
case "end":
|
||||
return _context3.stop();
|
||||
}
|
||||
}
|
||||
}, _callee3);
|
||||
}))();
|
||||
},
|
||||
// 登录结果处理
|
||||
loginHandle: function loginHandle(data) {
|
||||
var _this4 = this;
|
||||
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
||||
var inviteCode;
|
||||
return _regenerator.default.wrap(function _callee4$(_context4) {
|
||||
while (1) {
|
||||
switch (_context4.prev = _context4.next) {
|
||||
case 0:
|
||||
_this4.LOGIN(data);
|
||||
uni.hideLoading();
|
||||
inviteCode = _cache.default.get('INVITE_CODE');
|
||||
if (inviteCode) {
|
||||
@ -336,16 +375,11 @@ var _default = {
|
||||
});
|
||||
case 5:
|
||||
case "end":
|
||||
return _context3.stop();
|
||||
return _context4.stop();
|
||||
}
|
||||
}
|
||||
}, _callee3);
|
||||
}, _callee4);
|
||||
}))();
|
||||
},
|
||||
mobileLogin: function mobileLogin() {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/login/mobileLogin'
|
||||
// })
|
||||
}
|
||||
}),
|
||||
computed: _objectSpread({}, (0, _vuex.mapGetters)(['appConfig']))
|
||||
|
||||
Reference in New Issue
Block a user