component-shipinlv 0.0.2 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,7 @@ interface Props {
3
3
  defaultLoginType: Global.AuthClientLoginType;
4
4
  wechatDisabled?: boolean;
5
5
  accountDisabled?: boolean;
6
+ accountHidden?: boolean;
6
7
  accountRegDisabled?: boolean;
7
8
  onSuccess: () => void;
8
9
  }
@@ -6,6 +6,7 @@ var Auth = function Auth(_ref) {
6
6
  var defaultLoginType = _ref.defaultLoginType,
7
7
  wechatDisabled = _ref.wechatDisabled,
8
8
  accountDisabled = _ref.accountDisabled,
9
+ accountHidden = _ref.accountHidden,
9
10
  accountRegDisabled = _ref.accountRegDisabled,
10
11
  _ref$onSuccess = _ref.onSuccess,
11
12
  onSuccess = _ref$onSuccess === void 0 ? function () {} : _ref$onSuccess;
@@ -17,6 +18,7 @@ var Auth = function Auth(_ref) {
17
18
  defaultLoginType: defaultLoginType,
18
19
  wechatDisabled: wechatDisabled,
19
20
  accountDisabled: accountDisabled,
21
+ accountHidden: accountHidden,
20
22
  accountRegDisabled: accountRegDisabled,
21
23
  onLoginSuccess: onLoginSuccess
22
24
  });
@@ -1,7 +1,12 @@
1
- var _window$WebBaseConfig, _window$WebBaseConfig2, _window$WebBaseConfig3;
2
1
  import ApiUrlsInfo, { currentEnv } from "../config/apiUrls";
3
- var ApiUrls = ((_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;
4
- var envData = ((_window$WebBaseConfig3 = window.WebBaseConfig) === null || _window$WebBaseConfig3 === void 0 ? void 0 : _window$WebBaseConfig3.currentEnv) || currentEnv;
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;
package/dist/typings.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  declare namespace Global {
2
2
  export type Env = 'local' | 'pre' | 'prod';
3
- export type AuthClientLoginType = 'wechat' | 'account' | 'alipay';
3
+ type AuthClientLoginType = 'wechat' | 'account' | 'alipay';
4
4
  export type ProductKind = 'vip' | 'card-vip' | string;
5
5
  interface RequestResult{
6
6
  code: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "0.0.2",
3
+ "version": "0.0.5",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",