component-shipinlv 2.2.9 → 2.2.11

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.
@@ -6,6 +6,7 @@ interface Props {
6
6
  loginTypeList: Global.AuthClientLoginType[];
7
7
  domain?: string;
8
8
  env?: Global.Env;
9
+ roleType?: UserAuth.RoleType;
9
10
  onLoginSuccess: () => void;
10
11
  }
11
12
  declare const Auth: React.FC<Props>;
@@ -30,6 +30,7 @@ var Auth = function Auth(_ref) {
30
30
  clientUniqueKeyList = _ref.clientUniqueKeyList,
31
31
  loginTypeList = _ref.loginTypeList,
32
32
  env = _ref.env,
33
+ roleType = _ref.roleType,
33
34
  _ref$domain = _ref.domain,
34
35
  domain = _ref$domain === void 0 ? document.location.hostname : _ref$domain,
35
36
  _ref$onLoginSuccess = _ref.onLoginSuccess,
@@ -133,6 +134,9 @@ var Auth = function Auth(_ref) {
133
134
  }));
134
135
  onLoginSuccess();
135
136
  Tool.event.run('login-success');
137
+ Tool.event.run("".concat(roleType || 'user', "-login-success"), _objectSpread(_objectSpread({}, userInfo), {}, {
138
+ isLogin: true
139
+ }));
136
140
  Tool.toast('登录成功');
137
141
  };
138
142
  var _useRequest = useRequest(function () {
@@ -325,6 +329,7 @@ var Auth = function Auth(_ref) {
325
329
  children: /*#__PURE__*/_jsx(AuthLoginReg, {
326
330
  env: env,
327
331
  apiUrl: apiUrl,
332
+ roleType: roleType,
328
333
  productType: productType,
329
334
  clientUniqueKeyList: clientUniqueKeyList,
330
335
  accountRegDisabled: !loginTypeList.includes('account-reg'),
@@ -3,6 +3,7 @@ interface Props {
3
3
  env?: Global.Env;
4
4
  productType: string;
5
5
  apiUrl?: string;
6
+ roleType?: UserAuth.RoleType;
6
7
  clientUniqueKeyList: string[];
7
8
  activeKeyDefault?: 'login' | 'reg' | string;
8
9
  accountRegDisabled?: boolean;
@@ -11,6 +11,7 @@ var AuthLoginReg = function AuthLoginReg(_ref) {
11
11
  var env = _ref.env,
12
12
  productType = _ref.productType,
13
13
  apiUrl = _ref.apiUrl,
14
+ roleType = _ref.roleType,
14
15
  clientUniqueKeyList = _ref.clientUniqueKeyList,
15
16
  _ref$activeKeyDefault = _ref.activeKeyDefault,
16
17
  activeKeyDefault = _ref$activeKeyDefault === void 0 ? 'reg' : _ref$activeKeyDefault,
@@ -47,6 +48,7 @@ var AuthLoginReg = function AuthLoginReg(_ref) {
47
48
  children: [/*#__PURE__*/_jsx(Tabs.TabPane, {
48
49
  tab: "\u767B\u5F55",
49
50
  children: /*#__PURE__*/_jsx(AuthLogin, {
51
+ roleType: roleType,
50
52
  env: env,
51
53
  apiUrl: apiUrl,
52
54
  productType: productType,
@@ -59,6 +61,7 @@ var AuthLoginReg = function AuthLoginReg(_ref) {
59
61
  tab: "\u6CE8\u518C",
60
62
  children: /*#__PURE__*/_jsx(Reg, {
61
63
  env: env,
64
+ roleType: roleType,
62
65
  productType: productType,
63
66
  clientUniqueKeyList: clientUniqueKeyList,
64
67
  onSuccess: function onSuccess() {
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  interface Props {
3
3
  env?: Global.Env;
4
4
  apiUrl?: string;
5
+ roleType?: UserAuth.RoleType;
5
6
  productType: string;
6
7
  clientUniqueKeyList: string[];
7
8
  onSuccess: () => void;
@@ -46,6 +46,7 @@ var tailFormItemLayout = {
46
46
  var AuthReg = function AuthReg(_ref) {
47
47
  var env = _ref.env,
48
48
  apiUrl = _ref.apiUrl,
49
+ roleType = _ref.roleType,
49
50
  productType = _ref.productType,
50
51
  clientUniqueKeyList = _ref.clientUniqueKeyList,
51
52
  _ref$onSuccess = _ref.onSuccess,
@@ -103,6 +104,9 @@ var AuthReg = function AuthReg(_ref) {
103
104
  }));
104
105
  Tool.toast('登录成功');
105
106
  Tool.event.run('user-info');
107
+ Tool.event.run("".concat(roleType || 'user', "-login-success"), _objectSpread(_objectSpread({}, data), {}, {
108
+ isLogin: true
109
+ }));
106
110
  onSuccess();
107
111
  };
108
112
  var onFinish = /*#__PURE__*/function () {
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  interface Props {
3
3
  env?: Global.Env;
4
+ roleType?: UserAuth.RoleType;
4
5
  productType: string;
5
6
  clientUniqueKeyList: string[];
6
7
  onSuccess: () => void;
@@ -42,6 +42,7 @@ var tailFormItemLayout = {
42
42
  };
43
43
  var Reg = function Reg(_ref) {
44
44
  var env = _ref.env,
45
+ roleType = _ref.roleType,
45
46
  productType = _ref.productType,
46
47
  clientUniqueKeyList = _ref.clientUniqueKeyList,
47
48
  _ref$onSuccess = _ref.onSuccess,
@@ -73,6 +74,9 @@ var Reg = function Reg(_ref) {
73
74
  }));
74
75
  Tool.toast('登录成功');
75
76
  Tool.event.run('user-info');
77
+ Tool.event.run("".concat(roleType || 'user', "-login-success"), _objectSpread(_objectSpread({}, data), {}, {
78
+ isLogin: true
79
+ }));
76
80
  onSuccess();
77
81
  };
78
82
  var onFinish = /*#__PURE__*/function () {
@@ -1,4 +1,5 @@
1
1
  declare namespace UserAuth {
2
+ type RoleType = "user" | string;
2
3
  interface LoginSuccessData {
3
4
  sid: string;
4
5
  avatarUrl: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "2.2.9",
3
+ "version": "2.2.11",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",