@pisell/pisellos 0.0.342 → 0.0.343
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1692,7 +1692,7 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1692
1692
|
key: "guestLogin",
|
|
1693
1693
|
value: (function () {
|
|
1694
1694
|
var _guestLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
1695
|
-
var guestCode, param, response;
|
|
1695
|
+
var guestCode, param, response, _response$data7;
|
|
1696
1696
|
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
1697
1697
|
while (1) switch (_context25.prev = _context25.next) {
|
|
1698
1698
|
case 0:
|
|
@@ -1727,6 +1727,11 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1727
1727
|
if (response.data.refreshToken) {
|
|
1728
1728
|
this.store.refreshToken = response.data.refreshToken;
|
|
1729
1729
|
}
|
|
1730
|
+
|
|
1731
|
+
// 设置匿名登录code
|
|
1732
|
+
if ((_response$data7 = response.data) !== null && _response$data7 !== void 0 && (_response$data7 = _response$data7.customer) !== null && _response$data7 !== void 0 && _response$data7.guest_code) {
|
|
1733
|
+
this.window.localStorage.setItem('guest_code', response.data.customer.guest_code);
|
|
1734
|
+
}
|
|
1730
1735
|
this.core.effects.emit(RegisterAndLoginHooks.onLoginSuccess, {
|
|
1731
1736
|
user: response.data.user,
|
|
1732
1737
|
token: response.data.token,
|
|
@@ -1026,6 +1026,7 @@ var RegisterAndLoginImpl = class extends import_BaseModule.BaseModule {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
/** Guest 登录 */
|
|
1028
1028
|
async guestLogin() {
|
|
1029
|
+
var _a, _b;
|
|
1029
1030
|
try {
|
|
1030
1031
|
this.store.isLoading = true;
|
|
1031
1032
|
this.store.error = null;
|
|
@@ -1048,6 +1049,9 @@ var RegisterAndLoginImpl = class extends import_BaseModule.BaseModule {
|
|
|
1048
1049
|
if (response.data.refreshToken) {
|
|
1049
1050
|
this.store.refreshToken = response.data.refreshToken;
|
|
1050
1051
|
}
|
|
1052
|
+
if ((_b = (_a = response.data) == null ? void 0 : _a.customer) == null ? void 0 : _b.guest_code) {
|
|
1053
|
+
this.window.localStorage.setItem("guest_code", response.data.customer.guest_code);
|
|
1054
|
+
}
|
|
1051
1055
|
this.core.effects.emit(import_types.RegisterAndLoginHooks.onLoginSuccess, {
|
|
1052
1056
|
user: response.data.user,
|
|
1053
1057
|
token: response.data.token,
|