component-shipinlv 0.0.3 → 0.0.6

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.
@@ -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({}, data), {}, {
55
+ return AuthController.login(_objectSpread(_objectSpread({
56
+ from: "web"
57
+ }, data), {}, {
56
58
  inviteUserId: Tool.getInviteUserId()
57
59
  }));
58
60
  }, {
@@ -136,6 +136,7 @@ var LoginQr = function LoginQr(_ref) {
136
136
  loginId: loginId,
137
137
  //string 32
138
138
  loginType: 'client',
139
+ from: "web",
139
140
  // 没有推荐者,会根据域名判断 经销商
140
141
  inviteUserId: Tool.getInviteUserId(),
141
142
  env: getApiEnv()
@@ -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;
@@ -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
- 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.3",
3
+ "version": "0.0.6",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",