@norcy/react-native-toolkit 0.3.16 → 0.3.18
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.
- package/lib/commonjs/ConfigDataModel.js +1 -1
- package/lib/commonjs/ConfigDataModel.js.map +1 -1
- package/lib/commonjs/LoginManager.js +7 -13
- package/lib/commonjs/LoginManager.js.map +1 -1
- package/lib/commonjs/MessageModel.js +2 -2
- package/lib/commonjs/MessageModel.js.map +1 -1
- package/lib/commonjs/ReportUtil.js +2 -2
- package/lib/commonjs/ReportUtil.js.map +1 -1
- package/lib/commonjs/SentryManager.js +1 -1
- package/lib/commonjs/SentryManager.js.map +1 -1
- package/lib/commonjs/VipAndroidManager.js +2 -2
- package/lib/commonjs/VipAndroidManager.js.map +1 -1
- package/lib/commonjs/VipManager.js +5 -5
- package/lib/commonjs/VipManager.js.map +1 -1
- package/lib/commonjs/constant.js.map +1 -1
- package/lib/module/ConfigDataModel.js +1 -1
- package/lib/module/ConfigDataModel.js.map +1 -1
- package/lib/module/LoginManager.js +7 -13
- package/lib/module/LoginManager.js.map +1 -1
- package/lib/module/MessageModel.js +2 -2
- package/lib/module/MessageModel.js.map +1 -1
- package/lib/module/ReportUtil.js +2 -2
- package/lib/module/ReportUtil.js.map +1 -1
- package/lib/module/SentryManager.js +1 -1
- package/lib/module/SentryManager.js.map +1 -1
- package/lib/module/VipAndroidManager.js +2 -2
- package/lib/module/VipAndroidManager.js.map +1 -1
- package/lib/module/VipManager.js +5 -5
- package/lib/module/VipManager.js.map +1 -1
- package/lib/module/constant.js.map +1 -1
- package/lib/typescript/ConfigDataModel.d.ts.map +1 -1
- package/lib/typescript/LoginManager.d.ts.map +1 -1
- package/lib/typescript/VipManager.d.ts +1 -1
- package/lib/typescript/constant.d.ts +6 -4
- package/lib/typescript/constant.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/ConfigDataModel.ts +1 -2
- package/src/LoginManager.ts +8 -13
- package/src/MessageModel.ts +2 -2
- package/src/ReportUtil.ts +2 -2
- package/src/SentryManager.ts +1 -1
- package/src/VipAndroidManager.ts +2 -2
- package/src/VipManager.ts +5 -5
- package/src/constant.ts +6 -5
package/src/VipManager.ts
CHANGED
|
@@ -18,7 +18,7 @@ let isReady = false;
|
|
|
18
18
|
|
|
19
19
|
const onLogin = async (user: UserType) => {
|
|
20
20
|
try {
|
|
21
|
-
await Purchases.logIn(user.
|
|
21
|
+
await Purchases.logIn(user.id);
|
|
22
22
|
await Purchases.setAttributes({ nickname: user.nickname });
|
|
23
23
|
await VipManager.refreshVip();
|
|
24
24
|
} catch (e) {
|
|
@@ -291,7 +291,7 @@ export const VipManager = {
|
|
|
291
291
|
if (!VipManager.isVip()) {
|
|
292
292
|
return false;
|
|
293
293
|
}
|
|
294
|
-
const vipType = LoginManager.currentUser()?.
|
|
294
|
+
const vipType = LoginManager.currentUser()?.vipType;
|
|
295
295
|
if (vipType?.includes('rc_promo_')) {
|
|
296
296
|
return true;
|
|
297
297
|
}
|
|
@@ -313,7 +313,7 @@ export const VipManager = {
|
|
|
313
313
|
|
|
314
314
|
isVipExpired: () => {
|
|
315
315
|
// 不是会员,但是 vipType 存在,说明曾经领过会员
|
|
316
|
-
const vipType = LoginManager.currentUser()?.
|
|
316
|
+
const vipType = LoginManager.currentUser()?.vipType;
|
|
317
317
|
return !VipManager.isVip() && vipType;
|
|
318
318
|
},
|
|
319
319
|
|
|
@@ -352,7 +352,7 @@ const updateVipInfo = async () => {
|
|
|
352
352
|
const values = [];
|
|
353
353
|
|
|
354
354
|
const vipType = _customerInfo?.entitlements?.active?.vip?.productIdentifier;
|
|
355
|
-
const oldVipType = LoginManager.currentUser()?.
|
|
355
|
+
const oldVipType = LoginManager.currentUser()?.vipType;
|
|
356
356
|
if (vipType && vipType !== oldVipType) {
|
|
357
357
|
keys.push('vipType');
|
|
358
358
|
values.push(vipType);
|
|
@@ -368,7 +368,7 @@ const updateVipInfo = async () => {
|
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
if (vipEndTime) {
|
|
371
|
-
const oldVipEndTime = LoginManager.currentUser()?.
|
|
371
|
+
const oldVipEndTime = LoginManager.currentUser()?.vipEndTime;
|
|
372
372
|
if (vipEndTime.getTime() !== oldVipEndTime?.getTime()) {
|
|
373
373
|
keys.push('vipEndTime');
|
|
374
374
|
values.push(vipEndTime);
|
package/src/constant.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { User } from 'leancloud-storage';
|
|
2
|
-
|
|
3
1
|
export interface UserType {
|
|
2
|
+
id: string;
|
|
4
3
|
nickname: string;
|
|
5
4
|
email: string;
|
|
6
5
|
headimgurl: string;
|
|
7
6
|
type: number;
|
|
7
|
+
vipType?: string;
|
|
8
|
+
vipEndTime?: Date;
|
|
9
|
+
createdAt?: Date;
|
|
10
|
+
attr?: any;
|
|
11
|
+
webdav?: any;
|
|
8
12
|
isNew?: boolean;
|
|
9
|
-
AVUser: User;
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
export interface LoginAuthDataType {
|
|
13
16
|
openid: string;
|
|
14
17
|
unionid?: string;
|
|
15
|
-
access_token: string | null;
|
|
16
|
-
expires_in: number;
|
|
17
18
|
loginType: string;
|
|
18
19
|
}
|
|
19
20
|
|