@gjzq/sdk 1.3.1-beta.1 → 1.4.0-beta.1
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/dist/{index-Bi9wa93N.js → index-Clzjdhbd.js} +246 -257
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1 -1
- package/dist/pure.js +1 -1
- package/es/beginLogin/index.mjs +24 -27
- package/es/checkFundAccountLogin/funcs.mjs +61 -0
- package/es/checkFundAccountLogin/index.mjs +6 -6
- package/es/checkLogin/index.mjs +12 -16
- package/es/checkLoginForWeb/index.mjs +41 -53
- package/es/checkMarginAccountLogin/index.mjs +1 -1
- package/es/checkUserLogin/index.mjs +1 -1
- package/es/fundAccountLogin/index.mjs +1 -1
- package/es/linkActionDecode/index.mjs +5 -2
- package/es/linkDecode/index.mjs +5 -3
- package/es/loginWithToken/index.mjs +4 -4
- package/es/loginWithTokenForWeb/index.mjs +11 -11
- package/es/logoutForWeb/index.mjs +2 -3
- package/es/marginAccountLogin/index.mjs +1 -1
- package/es/openAppForWeb/index.mjs +29 -31
- package/es/syncLoginStatusBetweenNativeAndServer/index.mjs +4 -1
- package/es/userLoginForWeb/index.mjs +1 -1
- package/es/utils/funcs.mjs +2 -66
- package/es/utils/loginFuncs.mjs +15 -8
- package/package.json +5 -2
package/dist/index.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ declare const beginLogin: (loginType: string, channelId: string, json?: any) =>
|
|
|
87
87
|
* @param {Object} loginParam.key 用户登录营销参数,格式参考4015功能号
|
|
88
88
|
* @returns {Promise<boolean> | void}
|
|
89
89
|
*/
|
|
90
|
-
declare function beginLoginForWeb(loginType: string, backUrl: string, loginParam?:
|
|
90
|
+
declare function beginLoginForWeb(loginType: string, backUrl: string, loginParam?: object): Promise<boolean | void>;
|
|
91
91
|
|
|
92
92
|
interface BindInfoData {
|
|
93
93
|
userId?: string;
|
|
@@ -228,7 +228,7 @@ type HttpResponse<T = unknown> = {
|
|
|
228
228
|
* @function checkFundAccountLogin
|
|
229
229
|
* @returns {Promise<HttpResponse>}
|
|
230
230
|
*/
|
|
231
|
-
declare function checkFundAccountLogin(): Promise<HttpResponse
|
|
231
|
+
declare function checkFundAccountLogin(): Promise<HttpResponse>;
|
|
232
232
|
|
|
233
233
|
/**
|
|
234
234
|
* 检查登录状态
|
|
@@ -252,14 +252,14 @@ declare function checkLoginForWeb(loginType: string): Promise<boolean>;
|
|
|
252
252
|
* @function checkMarginAccountLogin
|
|
253
253
|
* @returns {Promise<HttpResponse>}
|
|
254
254
|
*/
|
|
255
|
-
declare function checkMarginAccountLogin(): Promise<HttpResponse
|
|
255
|
+
declare function checkMarginAccountLogin(): Promise<HttpResponse>;
|
|
256
256
|
|
|
257
257
|
/**
|
|
258
258
|
* user登录状态检查
|
|
259
259
|
* @function checkUserLogin
|
|
260
260
|
* @returns {Promise<HttpResponse>}
|
|
261
261
|
*/
|
|
262
|
-
declare function checkUserLogin(): Promise<HttpResponse
|
|
262
|
+
declare function checkUserLogin(): Promise<HttpResponse>;
|
|
263
263
|
|
|
264
264
|
type ChooseImgParams = {
|
|
265
265
|
source?: number;
|
|
@@ -395,7 +395,7 @@ type FundAccountLoginParams = {
|
|
|
395
395
|
* @param {FundAccountLoginParams} param
|
|
396
396
|
* @returns {Promise<HttpResponse>}
|
|
397
397
|
*/
|
|
398
|
-
declare function fundAccountLogin(param: FundAccountLoginParams): Promise<HttpResponse
|
|
398
|
+
declare function fundAccountLogin(param: FundAccountLoginParams): Promise<HttpResponse>;
|
|
399
399
|
|
|
400
400
|
declare function getAppId(): Promise<string | undefined>;
|
|
401
401
|
|
|
@@ -748,7 +748,7 @@ type MarginAccountLoginParams = {
|
|
|
748
748
|
* @param {MarginAccountLoginParams} param
|
|
749
749
|
* @returns {Promise<HttpResponse> }
|
|
750
750
|
*/
|
|
751
|
-
declare function marginAccountLogin(param: MarginAccountLoginParams): Promise<HttpResponse
|
|
751
|
+
declare function marginAccountLogin(param: MarginAccountLoginParams): Promise<HttpResponse>;
|
|
752
752
|
|
|
753
753
|
type multiLoginParams = {
|
|
754
754
|
[key: string]: unknown;
|
|
@@ -1185,7 +1185,7 @@ type UserLoginParams = {
|
|
|
1185
1185
|
* @param {UserLoginParams} param
|
|
1186
1186
|
* @returns {Promise<HttpResponse>}
|
|
1187
1187
|
*/
|
|
1188
|
-
declare function userLoginForWeb(param: UserLoginParams): Promise<HttpResponse
|
|
1188
|
+
declare function userLoginForWeb(param: UserLoginParams): Promise<HttpResponse>;
|
|
1189
1189
|
|
|
1190
1190
|
type userLoginMobileParams = {
|
|
1191
1191
|
key?: string;
|
|
@@ -1250,4 +1250,4 @@ declare const wechatAuth: (options: WechatAuthOptions) => Promise<{
|
|
|
1250
1250
|
msg: string;
|
|
1251
1251
|
} | undefined>;
|
|
1252
1252
|
|
|
1253
|
-
export { type AddCalendarParams, type ApplyPermissionParams, type ChooseImgParams, type ChooseVideoParams, type ClientJumpParams, type CloseParams, type DeleteCalendarParams, type FundAccountLoginParams, type LinkActionConfigParam, type LinkDecodeParam, type LoginParams, type LogoutParams, type MarginAccountLoginParams, type OpenAppParam, type OpenAppParams, type OpenAppUrlParam, type OpenPageActionParam, type PageConfig$2 as PageConfig, type PidLoginParams, type PortfolioParams$1 as PortfolioParams, type QQStockLoginParams, type ReadFileInDiskParams, type ReadFileParams, type ReadSystemParams, type SaveFileInDiskParams, type SelectCalendarParams, type StartAnyChatParams, type StatusBarParams, type UploadFileparams, type UserLoginParams, type VivoDetectionParams, type WechatAuthOptions, type WechatPayParams, type WechatUserInfoOptions, addCalendar, addToPortfolio, appInit, appleChinaPay, appleUnionPay, applyPermission, beginLogin, beginLoginForWeb, bindInfo, bindInfoFunc, call, callphone, changeSkinType, type changeSkinTypeParams, checkFundAccountLogin, checkLogin, checkLoginForWeb, checkMarginAccountLogin, checkUserLogin, chooseImg, chooseVideo, clientJump, closeLoading, closePage, deleteCalendar, doneSuitability, exec, type execType, fundAccountLogin, getAppId, getAppVersion, getCapital, getInterfaceVersion, getLoginStatus, getPagePath, getSystemVersion, getUDID, getUID, getUkeyByChannelId, getUserUKeysByChannelId, getWechatUserInfo, goAlipay, type goAlipayResult, goBackPage, goWeChatShare, goWechatCustomService, type goWechatCustomServiceParams, goWechatPayment, type goWechatPaymentResult, h5Pay, http, hybridGetPassport, hybridGetUserId, initFinder, linkActionDecode, linkDecode, login, type loginResult, loginWithAccount, type loginWithAccountParams, loginWithToken, loginWithTokenForWeb, logout, logoutForWeb, marginAccountLogin, multiLogin, type multiLoginParams, native2011IOOperation, nativeIOOperation, type nativeIOOperationType, onAppear, onBackKeyPressed, onClose, onDisappear, onSkinChanged, openApp, openAppForWeb, openPage, pageInit, pageInitWithSession, pageInitWithToken, pidLogin, qqStockLogin, readFile, readFileInDisk, readNoSystemParameter, readSystemParameter, type readSystemParameterParams, ready, type readyResult, removePortfolio, saveFileInDisk, savePictureToPhone, scanCode, selectCalendar, setStatusBar, setTitle, setTitles, showAlert, type showAlertParams, showConfirm, type showResult, startAnyChat, syncLoginStatusBetweenNativeAndServer, trackEvent, trackInitAuto, trackPublicValue, trackUserProfile, trackUuid, uploadFile, userLogOut, userLogin, userLoginForWeb, userLoginMobile, type userLoginMobileParams, userLoginModal, vivoDetection, wechatAuth };
|
|
1253
|
+
export { type AddCalendarParams, type ApplyPermissionParams, type BindInfoData, type ChooseImgParams, type ChooseVideoParams, type ClientJumpParams, type CloseParams, type DeleteCalendarParams, type FundAccountLoginParams, type LinkActionConfigParam, type LinkDecodeParam, type LoginParams, type LogoutParams, type MarginAccountLoginParams, type OpenAppParam, type OpenAppParams, type OpenAppUrlParam, type OpenPageActionParam, type PageConfig$2 as PageConfig, type PidLoginParams, type PortfolioParams$1 as PortfolioParams, type QQStockLoginParams, type ReadFileInDiskParams, type ReadFileParams, type ReadSystemParams, type SaveFileInDiskParams, type SelectCalendarParams, type StartAnyChatParams, type StatusBarParams, type UploadFileparams, type UserLoginParams, type VivoDetectionParams, type WechatAuthOptions, type WechatPayParams, type WechatUserInfoOptions, addCalendar, addToPortfolio, appInit, appleChinaPay, appleUnionPay, applyPermission, beginLogin, beginLoginForWeb, bindInfo, bindInfoFunc, call, callphone, changeSkinType, type changeSkinTypeParams, checkFundAccountLogin, checkLogin, checkLoginForWeb, checkMarginAccountLogin, checkUserLogin, chooseImg, chooseVideo, clientJump, closeLoading, closePage, deleteCalendar, doneSuitability, exec, type execType, fundAccountLogin, getAppId, getAppVersion, getCapital, getInterfaceVersion, getLoginStatus, getPagePath, getSystemVersion, getUDID, getUID, getUkeyByChannelId, getUserUKeysByChannelId, getWechatUserInfo, goAlipay, type goAlipayResult, goBackPage, goWeChatShare, goWechatCustomService, type goWechatCustomServiceParams, goWechatPayment, type goWechatPaymentResult, h5Pay, http, hybridGetPassport, hybridGetUserId, initFinder, linkActionDecode, linkDecode, login, type loginResult, loginWithAccount, type loginWithAccountParams, loginWithToken, loginWithTokenForWeb, logout, logoutForWeb, marginAccountLogin, multiLogin, type multiLoginParams, native2011IOOperation, nativeIOOperation, type nativeIOOperationType, onAppear, onBackKeyPressed, onClose, onDisappear, onSkinChanged, openApp, openAppForWeb, openPage, pageInit, pageInitWithSession, pageInitWithToken, pidLogin, qqStockLogin, readFile, readFileInDisk, readNoSystemParameter, readSystemParameter, type readSystemParameterParams, ready, type readyResult, removePortfolio, saveFileInDisk, savePictureToPhone, scanCode, selectCalendar, setStatusBar, setTitle, setTitles, showAlert, type showAlertParams, showConfirm, type showResult, startAnyChat, syncLoginStatusBetweenNativeAndServer, trackEvent, trackInitAuto, trackPublicValue, trackUserProfile, trackUuid, uploadFile, userLogOut, userLogin, userLoginForWeb, userLoginMobile, type userLoginMobileParams, userLoginModal, vivoDetection, wechatAuth };
|
package/dist/index.js
CHANGED
package/dist/pure.js
CHANGED
package/es/beginLogin/index.mjs
CHANGED
|
@@ -21,41 +21,38 @@ var beginLogin = function beginLogin(loginType, channelId, json) {
|
|
|
21
21
|
case 0:
|
|
22
22
|
return [4 /*yield*/, getAppId()];
|
|
23
23
|
case 1:
|
|
24
|
-
if (!(_a.sent() === 'yjb3.0')) return [3 /*break*/,
|
|
24
|
+
if (!(_a.sent() === 'yjb3.0')) return [3 /*break*/, 11];
|
|
25
25
|
return [4 /*yield*/, checkLogin(loginType, channelId)];
|
|
26
26
|
case 2:
|
|
27
27
|
checkResult = _a.sent();
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (!(loginType === 'u')) return [3 /*break*/, 9];
|
|
28
|
+
if (checkResult.code == 0) {
|
|
29
|
+
return [2 /*return*/, checkResult];
|
|
30
|
+
} else if (checkResult.code == -2) {
|
|
31
|
+
return [2 /*return*/, {
|
|
32
|
+
code: -2,
|
|
33
|
+
result: 'version not supported'
|
|
34
|
+
}];
|
|
35
|
+
}
|
|
36
|
+
if (!(loginType === 'u')) return [3 /*break*/, 6];
|
|
38
37
|
return [4 /*yield*/, userLogin(json)];
|
|
39
|
-
case
|
|
38
|
+
case 3:
|
|
40
39
|
userLoginResult = _a.sent();
|
|
41
|
-
if (!(userLoginResult.code === 0)) return [3 /*break*/,
|
|
40
|
+
if (!(userLoginResult.code === 0)) return [3 /*break*/, 5];
|
|
42
41
|
if (isIos) {
|
|
43
42
|
//适配ios移动端
|
|
44
43
|
closePage({});
|
|
45
44
|
}
|
|
46
45
|
return [4 /*yield*/, checkLogin(loginType, channelId)];
|
|
47
|
-
case
|
|
46
|
+
case 4:
|
|
48
47
|
return [2 /*return*/, _a.sent()];
|
|
49
|
-
case
|
|
48
|
+
case 5:
|
|
50
49
|
//取消登录,需要关闭登录页
|
|
51
50
|
closePage({});
|
|
52
51
|
return [2 /*return*/, {
|
|
53
52
|
code: -3
|
|
54
53
|
}];
|
|
55
|
-
case
|
|
56
|
-
return [3 /*break*/,
|
|
57
|
-
case 9:
|
|
58
|
-
if (!(loginType === 'p' || +loginType === 1 || +loginType === 2)) return [3 /*break*/, 13];
|
|
54
|
+
case 6:
|
|
55
|
+
if (!(loginType === 'p' || +loginType === 1 || +loginType === 2)) return [3 /*break*/, 10];
|
|
59
56
|
args = {
|
|
60
57
|
type: +loginType === 2 ? 2 : 1,
|
|
61
58
|
needPassportId: 1,
|
|
@@ -66,29 +63,29 @@ var beginLogin = function beginLogin(loginType, channelId, json) {
|
|
|
66
63
|
args.fundAccount = json.fundAccount;
|
|
67
64
|
}
|
|
68
65
|
return [4 /*yield*/, login(args)];
|
|
69
|
-
case
|
|
66
|
+
case 7:
|
|
70
67
|
loginResult = _a.sent();
|
|
71
|
-
if (!(loginResult.code === 0)) return [3 /*break*/,
|
|
68
|
+
if (!(loginResult.code === 0)) return [3 /*break*/, 9];
|
|
72
69
|
//普通登录ios 安卓都需要执行关闭页面操作
|
|
73
70
|
closePage({});
|
|
74
71
|
return [4 /*yield*/, checkLogin(loginType, channelId)];
|
|
75
|
-
case
|
|
72
|
+
case 8:
|
|
76
73
|
return [2 /*return*/, _a.sent()];
|
|
77
|
-
case
|
|
74
|
+
case 9:
|
|
78
75
|
//取消登录,关闭登录页
|
|
79
76
|
closePage({});
|
|
80
77
|
return [2 /*return*/, {
|
|
81
78
|
code: -3
|
|
82
79
|
}];
|
|
83
|
-
case
|
|
84
|
-
return [3 /*break*/,
|
|
85
|
-
case
|
|
80
|
+
case 10:
|
|
81
|
+
return [3 /*break*/, 12];
|
|
82
|
+
case 11:
|
|
86
83
|
//todo 其他终端还不支持此功能
|
|
87
84
|
return [2 /*return*/, {
|
|
88
85
|
code: -2,
|
|
89
86
|
result: 'app not supported'
|
|
90
87
|
}];
|
|
91
|
-
case
|
|
88
|
+
case 12:
|
|
92
89
|
return [2 /*return*/];
|
|
93
90
|
}
|
|
94
91
|
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { __awaiter, __generator } from '../node_modules/tslib/tslib.es6.mjs';
|
|
2
|
+
import { MESSAGE, ALL_NO_SYSTEM_PARAM_KEYS } from '../utils/const.mjs';
|
|
3
|
+
import { nativeIOOperation } from '../nativeIOOperation/index.mjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* hybrid 读取非系统参数
|
|
7
|
+
* @param keys
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
function readHybridNoSystemParam() {
|
|
11
|
+
return __awaiter(this, arguments, void 0, function (keys) {
|
|
12
|
+
if (keys === void 0) {
|
|
13
|
+
keys = ALL_NO_SYSTEM_PARAM_KEYS;
|
|
14
|
+
}
|
|
15
|
+
return __generator(this, function (_a) {
|
|
16
|
+
return [2 /*return*/, nativeIOOperation(4004, {
|
|
17
|
+
keys: keys
|
|
18
|
+
})];
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* hybrid 读取系统参数,native异常时,返回空对象
|
|
24
|
+
* @param keys
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
function readHybridSystemParamIgnoreError(keys) {
|
|
28
|
+
var _this = this;
|
|
29
|
+
if (keys === void 0) {
|
|
30
|
+
keys = ALL_NO_SYSTEM_PARAM_KEYS;
|
|
31
|
+
}
|
|
32
|
+
return new Promise(function (resolve, reject) {
|
|
33
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
34
|
+
var nonSystemParamRes;
|
|
35
|
+
return __generator(this, function (_a) {
|
|
36
|
+
switch (_a.label) {
|
|
37
|
+
case 0:
|
|
38
|
+
return [4 /*yield*/, readHybridNoSystemParam(keys)];
|
|
39
|
+
case 1:
|
|
40
|
+
nonSystemParamRes = _a.sent();
|
|
41
|
+
if (nonSystemParamRes.code != 0) {
|
|
42
|
+
resolve && resolve({
|
|
43
|
+
code: 0,
|
|
44
|
+
result: {},
|
|
45
|
+
message: nonSystemParamRes.message || MESSAGE.NATIVE_ERROR
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
resolve && resolve({
|
|
49
|
+
code: 0,
|
|
50
|
+
result: nonSystemParamRes.result,
|
|
51
|
+
message: MESSAGE.SUCCESS
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return [2 /*return*/];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { readHybridNoSystemParam, readHybridSystemParamIgnoreError };
|
|
@@ -4,7 +4,8 @@ import { API_URL } from '../utils/urls.mjs';
|
|
|
4
4
|
import { http } from '../http/index.mjs';
|
|
5
5
|
import { syncLoginStatusBetweenNativeAndServer } from '../syncLoginStatusBetweenNativeAndServer/index.mjs';
|
|
6
6
|
import { checkFundAccountLoginFromServer } from '../utils/loginFuncs.mjs';
|
|
7
|
-
import { decrypt
|
|
7
|
+
import { decrypt } from '../utils/funcs.mjs';
|
|
8
|
+
import { readHybridSystemParamIgnoreError } from './funcs.mjs';
|
|
8
9
|
import { logoutForWeb } from '../logoutForWeb/index.mjs';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -28,9 +29,9 @@ function checkFundAccountLogin() {
|
|
|
28
29
|
if (!!nativeFundAccount) return [3 /*break*/, 2];
|
|
29
30
|
logoutForWeb(LOGOUT_TYPE.FUNDACCOUNT);
|
|
30
31
|
resolve && resolve({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
'code': -1,
|
|
33
|
+
'message': 'login fail!',
|
|
34
|
+
'data': ''
|
|
34
35
|
}); //todo
|
|
35
36
|
return [3 /*break*/, 7];
|
|
36
37
|
case 2:
|
|
@@ -55,9 +56,8 @@ function checkFundAccountLogin() {
|
|
|
55
56
|
});
|
|
56
57
|
});
|
|
57
58
|
});
|
|
58
|
-
} else {
|
|
59
|
-
return http.get(API_URL + '/login/fundAccount');
|
|
60
59
|
}
|
|
60
|
+
return http.get("".concat(API_URL, "/login/fundAccount"));
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export { checkFundAccountLogin };
|
package/es/checkLogin/index.mjs
CHANGED
|
@@ -29,11 +29,10 @@ var checkLogin = function checkLogin(loginType, channelId) {
|
|
|
29
29
|
code: 0,
|
|
30
30
|
result: userKey
|
|
31
31
|
}];
|
|
32
|
-
} else {
|
|
33
|
-
return [2 /*return*/, {
|
|
34
|
-
code: -1
|
|
35
|
-
}];
|
|
36
32
|
}
|
|
33
|
+
return [2 /*return*/, {
|
|
34
|
+
code: -1
|
|
35
|
+
}];
|
|
37
36
|
case 3:
|
|
38
37
|
if (!(loginType === 'p')) return [3 /*break*/, 5];
|
|
39
38
|
return [4 /*yield*/, getUkeyByChannelId(channelId)];
|
|
@@ -44,11 +43,10 @@ var checkLogin = function checkLogin(loginType, channelId) {
|
|
|
44
43
|
code: 0,
|
|
45
44
|
result: uKey
|
|
46
45
|
}];
|
|
47
|
-
} else {
|
|
48
|
-
return [2 /*return*/, {
|
|
49
|
-
code: -1
|
|
50
|
-
}];
|
|
51
46
|
}
|
|
47
|
+
return [2 /*return*/, {
|
|
48
|
+
code: -1
|
|
49
|
+
}];
|
|
52
50
|
case 5:
|
|
53
51
|
if (!(+loginType === 1)) return [3 /*break*/, 7];
|
|
54
52
|
return [4 /*yield*/, getLoginStatus()];
|
|
@@ -58,11 +56,10 @@ var checkLogin = function checkLogin(loginType, channelId) {
|
|
|
58
56
|
return [2 /*return*/, {
|
|
59
57
|
code: 0
|
|
60
58
|
}];
|
|
61
|
-
} else {
|
|
62
|
-
return [2 /*return*/, {
|
|
63
|
-
code: -1
|
|
64
|
-
}];
|
|
65
59
|
}
|
|
60
|
+
return [2 /*return*/, {
|
|
61
|
+
code: -1
|
|
62
|
+
}];
|
|
66
63
|
case 7:
|
|
67
64
|
if (!(+loginType === 2)) return [3 /*break*/, 9];
|
|
68
65
|
return [4 /*yield*/, getLoginStatus()];
|
|
@@ -72,11 +69,10 @@ var checkLogin = function checkLogin(loginType, channelId) {
|
|
|
72
69
|
return [2 /*return*/, {
|
|
73
70
|
code: 0
|
|
74
71
|
}];
|
|
75
|
-
} else {
|
|
76
|
-
return [2 /*return*/, {
|
|
77
|
-
code: -1
|
|
78
|
-
}];
|
|
79
72
|
}
|
|
73
|
+
return [2 /*return*/, {
|
|
74
|
+
code: -1
|
|
75
|
+
}];
|
|
80
76
|
case 9:
|
|
81
77
|
return [3 /*break*/, 11];
|
|
82
78
|
case 10:
|
|
@@ -21,17 +21,17 @@ import { getQueryString } from '../utils/urlFuncs.mjs';
|
|
|
21
21
|
*/
|
|
22
22
|
function checkLoginForWeb(loginType) {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function () {
|
|
24
|
-
var checkResult, key, param, loginResult, param, loginResult,
|
|
24
|
+
var checkResult, key, param, loginResult, param, loginResult, param_1, loginResult_1, fundAccountLoginResult_1, param, loginResult, instantToken, fundAccountLoginResult, param, loginResult, instantToken, marginAccountLoginResult, userLoginResult;
|
|
25
25
|
return __generator(this, function (_a) {
|
|
26
26
|
switch (_a.label) {
|
|
27
27
|
case 0:
|
|
28
28
|
return [4 /*yield*/, getAppId()];
|
|
29
29
|
case 1:
|
|
30
|
-
if (!(_a.sent() === 'yjb3.0')) return [3 /*break*/,
|
|
30
|
+
if (!(_a.sent() === 'yjb3.0')) return [3 /*break*/, 25];
|
|
31
31
|
return [4 /*yield*/, checkLogin(loginType, CHANNELID)];
|
|
32
32
|
case 2:
|
|
33
33
|
checkResult = _a.sent();
|
|
34
|
-
if (!(checkResult.code === 0)) return [3 /*break*/,
|
|
34
|
+
if (!(checkResult.code === 0)) return [3 /*break*/, 23];
|
|
35
35
|
key = checkResult.result;
|
|
36
36
|
if (!(loginType === LoginType.USER)) return [3 /*break*/, 4];
|
|
37
37
|
param = {
|
|
@@ -47,11 +47,10 @@ function checkLoginForWeb(loginType) {
|
|
|
47
47
|
// 解绑userId
|
|
48
48
|
// bindInfo({ userId: null, YJB_userId: 'DEFAULT' });
|
|
49
49
|
return [2 /*return*/, false];
|
|
50
|
-
} else {
|
|
51
|
-
// 绑userId
|
|
52
|
-
bindInfo(loginResult.data);
|
|
53
|
-
return [2 /*return*/, true];
|
|
54
50
|
}
|
|
51
|
+
// 绑userId
|
|
52
|
+
bindInfo(loginResult.data);
|
|
53
|
+
return [2 /*return*/, true];
|
|
55
54
|
case 4:
|
|
56
55
|
if (!(loginType === LoginType.PASSPORT)) return [3 /*break*/, 6];
|
|
57
56
|
param = {
|
|
@@ -66,33 +65,32 @@ function checkLoginForWeb(loginType) {
|
|
|
66
65
|
// 解绑pid
|
|
67
66
|
// bindInfo({ pid: null })
|
|
68
67
|
return [2 /*return*/, false];
|
|
69
|
-
} else {
|
|
70
|
-
bindInfo(loginResult.data);
|
|
71
|
-
return [2 /*return*/, true];
|
|
72
68
|
}
|
|
69
|
+
bindInfo(loginResult.data);
|
|
70
|
+
return [2 /*return*/, true];
|
|
73
71
|
case 6:
|
|
74
|
-
if (!(loginType === LoginType.FUNDACCOUNT)) return [3 /*break*/,
|
|
72
|
+
if (!(loginType === LoginType.FUNDACCOUNT)) return [3 /*break*/, 16];
|
|
75
73
|
if (!useHybridLogin()) return [3 /*break*/, 10];
|
|
76
74
|
return [4 /*yield*/, getUkeyByChannelId(CHANNELID)];
|
|
77
75
|
case 7:
|
|
78
76
|
key = _a.sent();
|
|
79
|
-
|
|
77
|
+
param_1 = {
|
|
80
78
|
channelId: CHANNELID,
|
|
81
79
|
uKey: key
|
|
82
80
|
};
|
|
83
|
-
return [4 /*yield*/, pidLogin(
|
|
81
|
+
return [4 /*yield*/, pidLogin(param_1)];
|
|
84
82
|
case 8:
|
|
85
|
-
|
|
86
|
-
if (
|
|
83
|
+
loginResult_1 = _a.sent();
|
|
84
|
+
if (loginResult_1.code !== 0) {
|
|
87
85
|
// 2025.01.02 经讨论 退登不解绑!!
|
|
88
86
|
// bindInfo({ pid: null, clientId: null })
|
|
89
87
|
return [2 /*return*/, false];
|
|
90
88
|
}
|
|
91
89
|
return [4 /*yield*/, checkFundAccountLogin()];
|
|
92
90
|
case 9:
|
|
93
|
-
|
|
94
|
-
bindInfo(
|
|
95
|
-
return [2 /*return*/,
|
|
91
|
+
fundAccountLoginResult_1 = _a.sent();
|
|
92
|
+
bindInfo(fundAccountLoginResult_1.data);
|
|
93
|
+
return [2 /*return*/, fundAccountLoginResult_1.code == 0];
|
|
96
94
|
case 10:
|
|
97
95
|
return [4 /*yield*/, getUkeyByChannelId(CHANNELID)];
|
|
98
96
|
case 11:
|
|
@@ -122,18 +120,16 @@ function checkLoginForWeb(loginType) {
|
|
|
122
120
|
bindInfo(fundAccountLoginResult.data);
|
|
123
121
|
return [2 /*return*/, fundAccountLoginResult.code == 0];
|
|
124
122
|
case 16:
|
|
125
|
-
return [3 /*break*/,
|
|
126
|
-
case 17:
|
|
127
|
-
if (!(loginType === LoginType.MARGINACCOUNT)) return [3 /*break*/, 24];
|
|
123
|
+
if (!(loginType === LoginType.MARGINACCOUNT)) return [3 /*break*/, 22];
|
|
128
124
|
return [4 /*yield*/, getUkeyByChannelId(CHANNELID)];
|
|
129
|
-
case
|
|
125
|
+
case 17:
|
|
130
126
|
key = _a.sent();
|
|
131
127
|
param = {
|
|
132
128
|
channelId: CHANNELID,
|
|
133
129
|
uKey: key
|
|
134
130
|
};
|
|
135
131
|
return [4 /*yield*/, pidLogin(param)];
|
|
136
|
-
case
|
|
132
|
+
case 18:
|
|
137
133
|
loginResult = _a.sent();
|
|
138
134
|
if (loginResult.code !== 0) {
|
|
139
135
|
// 2025.01.02 经讨论 退登不解绑!!
|
|
@@ -141,46 +137,41 @@ function checkLoginForWeb(loginType) {
|
|
|
141
137
|
return [2 /*return*/, false];
|
|
142
138
|
}
|
|
143
139
|
instantToken = getQueryString('instant_token');
|
|
144
|
-
if (!instantToken) return [3 /*break*/,
|
|
140
|
+
if (!instantToken) return [3 /*break*/, 20];
|
|
145
141
|
return [4 /*yield*/, loginWithToken()];
|
|
146
|
-
case
|
|
142
|
+
case 19:
|
|
147
143
|
return [2 /*return*/, _a.sent()];
|
|
148
|
-
case
|
|
144
|
+
case 20:
|
|
149
145
|
return [4 /*yield*/, checkMarginAccountLogin()];
|
|
150
|
-
case
|
|
146
|
+
case 21:
|
|
151
147
|
marginAccountLoginResult = _a.sent();
|
|
152
148
|
bindInfo(marginAccountLoginResult.data);
|
|
153
149
|
return [2 /*return*/, marginAccountLoginResult.code == 0];
|
|
154
|
-
case
|
|
155
|
-
return [3 /*break*/, 25];
|
|
156
|
-
case 24:
|
|
150
|
+
case 22:
|
|
157
151
|
return [2 /*return*/, false];
|
|
158
|
-
case
|
|
159
|
-
return [3 /*break*/, 27];
|
|
160
|
-
case 26:
|
|
152
|
+
case 23:
|
|
161
153
|
if (checkResult.code === -2) {
|
|
162
154
|
//客户端系统版本不支持,或app端不支持(微信)
|
|
163
155
|
return [2 /*return*/, false];
|
|
164
|
-
} else {
|
|
165
|
-
//未登录,登录界面返回
|
|
166
|
-
return [2 /*return*/, false];
|
|
167
156
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
157
|
+
_a.label = 24;
|
|
158
|
+
case 24:
|
|
159
|
+
//未登录,登录界面返回
|
|
160
|
+
return [2 /*return*/, false];
|
|
161
|
+
case 25:
|
|
162
|
+
if (!(loginType === LoginType.PASSPORT || loginType === LoginType.FUNDACCOUNT)) return [3 /*break*/, 27];
|
|
172
163
|
return [4 /*yield*/, loginWithTokenForWeb(loginType)];
|
|
173
|
-
case
|
|
164
|
+
case 26:
|
|
174
165
|
return [2 /*return*/, _a.sent()];
|
|
175
|
-
case
|
|
176
|
-
if (!(loginType === LoginType.MARGINACCOUNT)) return [3 /*break*/,
|
|
166
|
+
case 27:
|
|
167
|
+
if (!(loginType === LoginType.MARGINACCOUNT)) return [3 /*break*/, 29];
|
|
177
168
|
return [4 /*yield*/, loginWithTokenForWeb(loginType)];
|
|
178
|
-
case
|
|
169
|
+
case 28:
|
|
179
170
|
return [2 /*return*/, _a.sent()];
|
|
180
|
-
case
|
|
181
|
-
if (!(loginType === LoginType.USER)) return [3 /*break*/,
|
|
171
|
+
case 29:
|
|
172
|
+
if (!(loginType === LoginType.USER)) return [3 /*break*/, 31];
|
|
182
173
|
return [4 /*yield*/, checkUserLogin()];
|
|
183
|
-
case
|
|
174
|
+
case 30:
|
|
184
175
|
userLoginResult = _a.sent();
|
|
185
176
|
console.log('userLoginResult:', userLoginResult);
|
|
186
177
|
// 绑userId
|
|
@@ -188,14 +179,11 @@ function checkLoginForWeb(loginType) {
|
|
|
188
179
|
// 2025.01.02 经讨论 退登不解绑!!
|
|
189
180
|
// bindInfo({ userId: null })
|
|
190
181
|
return [2 /*return*/, false];
|
|
191
|
-
} else {
|
|
192
|
-
bindInfo(userLoginResult.data);
|
|
193
|
-
return [2 /*return*/, true];
|
|
194
182
|
}
|
|
195
|
-
|
|
183
|
+
bindInfo(userLoginResult.data);
|
|
184
|
+
return [2 /*return*/, true];
|
|
185
|
+
case 31:
|
|
196
186
|
return [2 /*return*/, false];
|
|
197
|
-
case 35:
|
|
198
|
-
return [2 /*return*/];
|
|
199
187
|
}
|
|
200
188
|
});
|
|
201
189
|
});
|
|
@@ -7,7 +7,7 @@ import { http } from '../http/index.mjs';
|
|
|
7
7
|
* @returns {Promise<HttpResponse>}
|
|
8
8
|
*/
|
|
9
9
|
function checkMarginAccountLogin() {
|
|
10
|
-
return http.get(API_URL
|
|
10
|
+
return http.get("".concat(API_URL, "/login/marginAccount"));
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export { checkMarginAccountLogin };
|
|
@@ -8,7 +8,7 @@ import { http } from '../http/index.mjs';
|
|
|
8
8
|
* @returns {Promise<HttpResponse>}
|
|
9
9
|
*/
|
|
10
10
|
function fundAccountLogin(param) {
|
|
11
|
-
return http.post(API_URL
|
|
11
|
+
return http.post("".concat(API_URL, "/login/fundAccount"), param);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export { fundAccountLogin };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import CustomURI from '../utils/urijs.mjs';
|
|
2
2
|
import { getUrlJson, getActionRedirectOptions } from '../utils/urlFuncs.mjs';
|
|
3
3
|
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
4
5
|
/**
|
|
5
6
|
* v2工具:回流配置转换成v1广告配置,并根据使用场景返回跳转参数对象
|
|
6
7
|
* @function linkDecode
|
|
@@ -36,7 +37,7 @@ var linkActionDecode = function linkActionDecode(action, config) {
|
|
|
36
37
|
var str = '';
|
|
37
38
|
if (theRequest) {
|
|
38
39
|
for (var n in theRequest) {
|
|
39
|
-
str = str
|
|
40
|
+
str = "".concat(str, "&").concat(n, "=").concat(theRequest[n]);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
// 针对哈西路由链接,location参数的处理 1-保持,0-移到hash路由(默认)
|
|
@@ -46,7 +47,9 @@ var linkActionDecode = function linkActionDecode(action, config) {
|
|
|
46
47
|
str = str.replace('&', '?');
|
|
47
48
|
}
|
|
48
49
|
hashIgnore = param.hashIgnore || 0;
|
|
49
|
-
!+hashIgnore
|
|
50
|
+
if (!+hashIgnore) {
|
|
51
|
+
uri.search('');
|
|
52
|
+
}
|
|
50
53
|
uri.hash("".concat(commonUrl).concat(str));
|
|
51
54
|
}
|
|
52
55
|
url = decodeURIComponent(uri.href());
|
package/es/linkDecode/index.mjs
CHANGED
|
@@ -31,7 +31,7 @@ var linkDecode = function linkDecode(link, config) {
|
|
|
31
31
|
var str = '';
|
|
32
32
|
if (other) {
|
|
33
33
|
for (var n in other) {
|
|
34
|
-
str = str
|
|
34
|
+
str = "".concat(str, "&").concat(n, "=").concat(other[n]);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
// 针对哈西路由链接,location参数的处理 1-保持,0-移到hash路由(默认)
|
|
@@ -40,13 +40,15 @@ var linkDecode = function linkDecode(link, config) {
|
|
|
40
40
|
if (hashQuery.length == 1) {
|
|
41
41
|
str = str.replace('&', '?');
|
|
42
42
|
}
|
|
43
|
-
!+hashIgnore
|
|
43
|
+
if (!+hashIgnore) {
|
|
44
|
+
uri.search('');
|
|
45
|
+
}
|
|
44
46
|
uri.hash("".concat(commonUrl).concat(str));
|
|
45
47
|
}
|
|
46
48
|
var url = decodeURIComponent(uri.href());
|
|
47
49
|
var jump = getDataJson(jumpInfo);
|
|
48
50
|
var add = getDataJson(addInfo, true);
|
|
49
|
-
console.log(
|
|
51
|
+
console.log('add:', add);
|
|
50
52
|
var options = {
|
|
51
53
|
url: url,
|
|
52
54
|
hashIgnore: Number(hashIgnore) || 0,
|
|
@@ -11,7 +11,7 @@ import { getQueryString } from '../utils/urlFuncs.mjs';
|
|
|
11
11
|
*/
|
|
12
12
|
function loginWithToken() {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function () {
|
|
14
|
-
var accountType, instantToken, oldInstantToken, opStation, _a,
|
|
14
|
+
var accountType, instantToken, oldInstantToken, opStation, _a, code_1, data_1, _b, code, data;
|
|
15
15
|
return __generator(this, function (_c) {
|
|
16
16
|
switch (_c.label) {
|
|
17
17
|
case 0:
|
|
@@ -40,9 +40,9 @@ function loginWithToken() {
|
|
|
40
40
|
instant_token: instantToken
|
|
41
41
|
})];
|
|
42
42
|
case 1:
|
|
43
|
-
_a = _c.sent(),
|
|
44
|
-
bindInfo(
|
|
45
|
-
return [2 /*return*/,
|
|
43
|
+
_a = _c.sent(), code_1 = _a.code, data_1 = _a.data;
|
|
44
|
+
bindInfo(data_1);
|
|
45
|
+
return [2 /*return*/, code_1 === 0];
|
|
46
46
|
case 2:
|
|
47
47
|
return [4 /*yield*/, fundAccountLogin({
|
|
48
48
|
op_station: opStation,
|