component-shipinlv 0.0.3 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
package/dist/AuthClient/login.js
CHANGED
@@ -52,7 +52,9 @@ var AuthReg = function AuthReg(_ref) {
|
|
52
52
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
53
53
|
form = _Form$useForm2[0];
|
54
54
|
var _useRequest = useRequest(function (data) {
|
55
|
-
return AuthController.login(_objectSpread(_objectSpread({
|
55
|
+
return AuthController.login(_objectSpread(_objectSpread({
|
56
|
+
from: "web"
|
57
|
+
}, data), {}, {
|
56
58
|
inviteUserId: Tool.getInviteUserId()
|
57
59
|
}));
|
58
60
|
}, {
|
package/dist/lib/getApiUrl.js
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
-
var _window$WebBaseConfig, _window$WebBaseConfig2, _window$WebBaseConfig3;
|
2
1
|
import ApiUrlsInfo, { currentEnv } from "../config/apiUrls";
|
3
|
-
var ApiUrls =
|
4
|
-
var
|
2
|
+
var ApiUrls = function ApiUrls() {
|
3
|
+
var _window$WebBaseConfig, _window$WebBaseConfig2;
|
4
|
+
return ((_window$WebBaseConfig = window.WebBaseConfig) === null || _window$WebBaseConfig === void 0 || (_window$WebBaseConfig = _window$WebBaseConfig[(_window$WebBaseConfig2 = window.WebBaseConfig) === null || _window$WebBaseConfig2 === void 0 ? void 0 : _window$WebBaseConfig2.webKind]) === null || _window$WebBaseConfig === void 0 ? void 0 : _window$WebBaseConfig.apiUrls) || ApiUrlsInfo;
|
5
|
+
};
|
6
|
+
var envData = function envData() {
|
7
|
+
var _window$WebBaseConfig3;
|
8
|
+
return ((_window$WebBaseConfig3 = window.WebBaseConfig) === null || _window$WebBaseConfig3 === void 0 ? void 0 : _window$WebBaseConfig3.currentEnv) || currentEnv;
|
9
|
+
};
|
5
10
|
var getApiUrl = function getApiUrl() {
|
6
11
|
var _ref, _domain;
|
7
12
|
var apiName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
@@ -13,8 +18,8 @@ var getApiUrl = function getApiUrl() {
|
|
13
18
|
|
14
19
|
// 替换第一个 /
|
15
20
|
apiName = apiName.replace(/^\//, '');
|
16
|
-
var env = getApiEnv(apiEnv || envData);
|
17
|
-
var ApiUrlsItem = ApiUrls;
|
21
|
+
var env = getApiEnv(apiEnv || envData());
|
22
|
+
var ApiUrlsItem = ApiUrls();
|
18
23
|
var domain = (_ref = ApiUrlsItem[env] || ApiUrlsItem.prod) === null || _ref === void 0 ? void 0 : _ref.api;
|
19
24
|
|
20
25
|
// 删除最后一个 /
|
@@ -31,7 +36,7 @@ var getApiUrl = function getApiUrl() {
|
|
31
36
|
};
|
32
37
|
//
|
33
38
|
export var getApiEnv = function getApiEnv(apiEnv) {
|
34
|
-
var env = apiEnv || envData;
|
39
|
+
var env = apiEnv || envData();
|
35
40
|
// 开发者只允许使用 .local 后缀域名;
|
36
41
|
if (!/\.local$/i.test(document.location.hostname) && !/\.?localhost$/i.test(document.location.hostname)) {
|
37
42
|
env = 'prod';
|
@@ -51,6 +56,6 @@ export var getWsUrl = function getWsUrl() {
|
|
51
56
|
var _ref2;
|
52
57
|
var env = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
53
58
|
env = getEnv(env);
|
54
|
-
return (_ref2 = ApiUrls[env] || ApiUrls.prod) === null || _ref2 === void 0 ? void 0 : _ref2.ws;
|
59
|
+
return (_ref2 = ApiUrls()[env] || ApiUrls().prod) === null || _ref2 === void 0 ? void 0 : _ref2.ws;
|
55
60
|
};
|
56
61
|
export default getApiUrl;
|
@@ -1,11 +1,13 @@
|
|
1
1
|
export declare function login(body: {
|
2
2
|
accountName: string;
|
3
3
|
password: string;
|
4
|
+
from: "web";
|
4
5
|
inviteUserId: number;
|
5
6
|
}): Promise<UserAuth.LoginSuccessData>;
|
6
7
|
export declare function weMiniLoginQr(body: {
|
7
8
|
loginId: string;
|
8
9
|
loginType: 'client';
|
10
|
+
from: string;
|
9
11
|
inviteUserId: number;
|
10
12
|
env: Global.Env;
|
11
13
|
}): Promise<UserAuth.WeQrResult>;
|
package/dist/typings.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
declare namespace Global {
|
2
2
|
export type Env = 'local' | 'pre' | 'prod';
|
3
|
-
|
3
|
+
type AuthClientLoginType = 'wechat' | 'account' | 'alipay';
|
4
4
|
export type ProductKind = 'vip' | 'card-vip' | string;
|
5
5
|
interface RequestResult{
|
6
6
|
code: string;
|