component-sanzhizhou 1.2.1 → 1.2.3
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/auth-main/account.d.ts +1 -0
- package/dist/auth-main/account.js +4 -1
- package/dist/auth-main/forgot-password.d.ts +1 -0
- package/dist/auth-main/forgot-password.js +24 -3
- package/dist/auth-main/index.d.ts +3 -2
- package/dist/auth-main/index.js +5 -3
- package/dist/auth-main/login.d.ts +1 -0
- package/dist/auth-main/login.js +35 -13
- package/dist/auth-main/types.d.ts +2 -0
- package/dist/lib/Tool.d.ts +1 -1
- package/dist/service/api/AuthController.d.ts +3 -0
- package/dist/types/AuthMain.d.ts +3 -0
- package/dist/types/AuthMain.js +0 -0
- package/package.json +1 -1
|
@@ -14,7 +14,8 @@ var Account = function Account(_ref) {
|
|
|
14
14
|
roleType = _ref.roleType,
|
|
15
15
|
disabledFormItemLabel = _ref.disabledFormItemLabel,
|
|
16
16
|
accountRegDisabled = _ref.accountRegDisabled,
|
|
17
|
-
onSuccess = _ref.onSuccess
|
|
17
|
+
onSuccess = _ref.onSuccess,
|
|
18
|
+
showSubAccount = _ref.showSubAccount;
|
|
18
19
|
var _useState = useState('login'),
|
|
19
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20
21
|
activeKey = _useState2[0],
|
|
@@ -42,6 +43,7 @@ var Account = function Account(_ref) {
|
|
|
42
43
|
apiUrl: apiUrl,
|
|
43
44
|
roleType: roleType,
|
|
44
45
|
disabledFormItemLabel: disabledFormItemLabel,
|
|
46
|
+
showSubAccount: showSubAccount,
|
|
45
47
|
onSuccess: onSuccess,
|
|
46
48
|
onForgotPassword: function onForgotPassword() {
|
|
47
49
|
return setForgotOpen(true);
|
|
@@ -63,6 +65,7 @@ var Account = function Account(_ref) {
|
|
|
63
65
|
env: env,
|
|
64
66
|
apiUrl: apiUrl,
|
|
65
67
|
disabledFormItemLabel: disabledFormItemLabel,
|
|
68
|
+
showSubAccount: showSubAccount,
|
|
66
69
|
onDone: function onDone() {
|
|
67
70
|
return setForgotOpen(false);
|
|
68
71
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
3
|
import { LockOutlined, UserOutlined, EyeTwoTone, EyeInvisibleOutlined } from '@ant-design/icons';
|
|
4
|
-
import { Input, Button, Form } from 'antd';
|
|
4
|
+
import { Input, Button, Form, Segmented } from 'antd';
|
|
5
5
|
import { useRequest } from '@umijs/hooks';
|
|
6
6
|
import Tool from "../lib/Tool";
|
|
7
7
|
import * as AuthController from "../service/api/AuthController";
|
|
@@ -14,10 +14,15 @@ var ForgotPassword = function ForgotPassword(_ref) {
|
|
|
14
14
|
var env = _ref.env,
|
|
15
15
|
apiUrl = _ref.apiUrl,
|
|
16
16
|
disabledFormItemLabel = _ref.disabledFormItemLabel,
|
|
17
|
+
showSubAccount = _ref.showSubAccount,
|
|
17
18
|
onDone = _ref.onDone;
|
|
18
19
|
var _Form$useForm = Form.useForm(),
|
|
19
20
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
20
21
|
form = _Form$useForm2[0];
|
|
22
|
+
var _useState = useState('main'),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
accountType = _useState2[0],
|
|
25
|
+
setAccountType = _useState2[1];
|
|
21
26
|
var _useRequest = useRequest(function (data) {
|
|
22
27
|
return AuthController.forgotPassword({
|
|
23
28
|
accountName: data.accountName,
|
|
@@ -48,7 +53,23 @@ var ForgotPassword = function ForgotPassword(_ref) {
|
|
|
48
53
|
labelCol: {
|
|
49
54
|
span: FormSpan
|
|
50
55
|
}
|
|
51
|
-
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
56
|
+
}, showSubAccount && /*#__PURE__*/React.createElement(Form.Item, {
|
|
57
|
+
wrapperCol: {
|
|
58
|
+
offset: FormSpan
|
|
59
|
+
}
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Segmented, {
|
|
61
|
+
value: accountType,
|
|
62
|
+
options: [{
|
|
63
|
+
label: formatMessage('主账户'),
|
|
64
|
+
value: 'main'
|
|
65
|
+
}, {
|
|
66
|
+
label: formatMessage('子账户'),
|
|
67
|
+
value: 'sub'
|
|
68
|
+
}],
|
|
69
|
+
onChange: function onChange(e) {
|
|
70
|
+
return setAccountType(e);
|
|
71
|
+
}
|
|
72
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
52
73
|
label: disabledFormItemLabel ? undefined : formatMessage('手机号码'),
|
|
53
74
|
name: "accountName",
|
|
54
75
|
rules: [{
|
|
@@ -12,11 +12,12 @@ interface Props {
|
|
|
12
12
|
[name: string]: any;
|
|
13
13
|
};
|
|
14
14
|
onLoginSuccess: () => void;
|
|
15
|
+
showSubAccount?: boolean;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* 登录 / 注册(重构版)。
|
|
18
19
|
* - 微信扫码:逻辑与旧 Auth 保持一致(WechatQr)。
|
|
19
20
|
* - 账户:登录 / 短信注册 / 找回密码(Account)。
|
|
20
21
|
*/
|
|
21
|
-
declare const
|
|
22
|
-
export default
|
|
22
|
+
declare const AuthMain: React.FC<Props>;
|
|
23
|
+
export default AuthMain;
|
package/dist/auth-main/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import styles from "./index.module.less";
|
|
|
14
14
|
* - 微信扫码:逻辑与旧 Auth 保持一致(WechatQr)。
|
|
15
15
|
* - 账户:登录 / 短信注册 / 找回密码(Account)。
|
|
16
16
|
*/
|
|
17
|
-
var
|
|
17
|
+
var AuthMain = function AuthMain(_ref) {
|
|
18
18
|
var productType = _ref.productType,
|
|
19
19
|
apiUrl = _ref.apiUrl,
|
|
20
20
|
clientUniqueKeyList = _ref.clientUniqueKeyList,
|
|
@@ -27,7 +27,8 @@ var Auth = function Auth(_ref) {
|
|
|
27
27
|
_ref$domain = _ref.domain,
|
|
28
28
|
domain = _ref$domain === void 0 ? document.location.hostname : _ref$domain,
|
|
29
29
|
_ref$onLoginSuccess = _ref.onLoginSuccess,
|
|
30
|
-
onLoginSuccess = _ref$onLoginSuccess === void 0 ? function () {} : _ref$onLoginSuccess
|
|
30
|
+
onLoginSuccess = _ref$onLoginSuccess === void 0 ? function () {} : _ref$onLoginSuccess,
|
|
31
|
+
showSubAccount = _ref.showSubAccount;
|
|
31
32
|
var _useState = useState(_toConsumableArray(loginTypeList)),
|
|
32
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
33
34
|
currentLoginTypeList = _useState2[0],
|
|
@@ -81,6 +82,7 @@ var Auth = function Auth(_ref) {
|
|
|
81
82
|
roleType: roleType,
|
|
82
83
|
disabledFormItemLabel: disabledFormItemLabel,
|
|
83
84
|
accountRegDisabled: accountRegDisabled,
|
|
85
|
+
showSubAccount: showSubAccount,
|
|
84
86
|
onSuccess: function onSuccess() {
|
|
85
87
|
return onLoginSuccess();
|
|
86
88
|
}
|
|
@@ -92,4 +94,4 @@ var Auth = function Auth(_ref) {
|
|
|
92
94
|
onClick: onCallAccount
|
|
93
95
|
}));
|
|
94
96
|
};
|
|
95
|
-
export default
|
|
97
|
+
export default AuthMain;
|
package/dist/auth-main/login.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React from 'react';
|
|
3
|
+
import React, { useState } from 'react';
|
|
3
4
|
import { LockOutlined, UserOutlined, EyeTwoTone, EyeInvisibleOutlined } from '@ant-design/icons';
|
|
4
|
-
import { Input, Button, Form } from 'antd';
|
|
5
|
+
import { Input, Button, Form, Segmented } from 'antd';
|
|
5
6
|
import { useRequest } from '@umijs/hooks';
|
|
6
7
|
import * as AuthController from "../service/api/AuthController";
|
|
7
8
|
import formatMessage from "../lib/formatMessage";
|
|
@@ -13,11 +14,16 @@ var Login = function Login(_ref) {
|
|
|
13
14
|
apiUrl = _ref.apiUrl,
|
|
14
15
|
roleType = _ref.roleType,
|
|
15
16
|
disabledFormItemLabel = _ref.disabledFormItemLabel,
|
|
17
|
+
showSubAccount = _ref.showSubAccount,
|
|
16
18
|
_onSuccess = _ref.onSuccess,
|
|
17
19
|
onForgotPassword = _ref.onForgotPassword;
|
|
18
20
|
var _Form$useForm = Form.useForm(),
|
|
19
21
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
20
22
|
form = _Form$useForm2[0];
|
|
23
|
+
var _useState = useState('main'),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
accountType = _useState2[0],
|
|
26
|
+
setAccountType = _useState2[1];
|
|
21
27
|
var _useRequest = useRequest(function (data) {
|
|
22
28
|
return AuthController.accountLogin(data, {
|
|
23
29
|
env: env,
|
|
@@ -34,18 +40,37 @@ var Login = function Login(_ref) {
|
|
|
34
40
|
run = _useRequest.run;
|
|
35
41
|
var onFinish = function onFinish(values) {
|
|
36
42
|
values.accountName = (values.accountName || '').replace(/\s+/g, '');
|
|
37
|
-
run(values)
|
|
43
|
+
run(_objectSpread(_objectSpread({}, values), {}, {
|
|
44
|
+
accountType: accountType
|
|
45
|
+
}));
|
|
38
46
|
};
|
|
47
|
+
var formSpan = 8;
|
|
39
48
|
return /*#__PURE__*/React.createElement("section", null, /*#__PURE__*/React.createElement(Form, {
|
|
49
|
+
labelCol: {
|
|
50
|
+
span: formSpan
|
|
51
|
+
},
|
|
40
52
|
form: form,
|
|
41
53
|
onFinish: onFinish,
|
|
42
|
-
disabled: loading
|
|
43
|
-
autoComplete
|
|
44
|
-
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
54
|
+
disabled: loading
|
|
55
|
+
// autoComplete="off"
|
|
56
|
+
}, showSubAccount && /*#__PURE__*/React.createElement(Form.Item, {
|
|
57
|
+
wrapperCol: {
|
|
58
|
+
offset: formSpan
|
|
59
|
+
}
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Segmented, {
|
|
61
|
+
value: accountType,
|
|
62
|
+
options: [{
|
|
63
|
+
label: formatMessage('主账户'),
|
|
64
|
+
value: 'main'
|
|
65
|
+
}, {
|
|
66
|
+
label: formatMessage('子账户'),
|
|
67
|
+
value: 'sub'
|
|
68
|
+
}],
|
|
69
|
+
onChange: function onChange(e) {
|
|
70
|
+
return setAccountType(e);
|
|
71
|
+
}
|
|
72
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
45
73
|
label: disabledFormItemLabel ? undefined : formatMessage('手机号码'),
|
|
46
|
-
labelCol: {
|
|
47
|
-
span: 8
|
|
48
|
-
},
|
|
49
74
|
name: "accountName",
|
|
50
75
|
rules: [{
|
|
51
76
|
required: true,
|
|
@@ -61,9 +86,6 @@ var Login = function Login(_ref) {
|
|
|
61
86
|
})
|
|
62
87
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
63
88
|
label: disabledFormItemLabel ? undefined : formatMessage('密码'),
|
|
64
|
-
labelCol: {
|
|
65
|
-
span: 8
|
|
66
|
-
},
|
|
67
89
|
name: "password",
|
|
68
90
|
rules: [{
|
|
69
91
|
required: true,
|
|
@@ -96,7 +118,7 @@ var Login = function Login(_ref) {
|
|
|
96
118
|
}
|
|
97
119
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
98
120
|
wrapperCol: {
|
|
99
|
-
offset:
|
|
121
|
+
offset: formSpan
|
|
100
122
|
}
|
|
101
123
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
102
124
|
type: "primary",
|
package/dist/lib/Tool.d.ts
CHANGED
|
@@ -162,7 +162,7 @@ declare const Tool: {
|
|
|
162
162
|
getTitleByPath(path: string): string;
|
|
163
163
|
getDirByPath(path: string): string;
|
|
164
164
|
h5Pay(query: Pay.H5PayQuery): void;
|
|
165
|
-
notification(type: "
|
|
165
|
+
notification(type: "success" | "info" | "warning" | "error", message: string, description?: import("react").ReactNode, options?: import("./notification").NotificationOption): void;
|
|
166
166
|
notificationSuccess(message: string, description?: import("react").ReactNode, options?: import("./notification").NotificationOption): void;
|
|
167
167
|
notificationError(message: string, description?: import("react").ReactNode, options?: import("./notification").NotificationOption): void;
|
|
168
168
|
notificationWarning(message: string, description?: import("react").ReactNode, options?: import("./notification").NotificationOption): void;
|
|
@@ -29,6 +29,8 @@ export interface AccountAuthResult {
|
|
|
29
29
|
nickname: string;
|
|
30
30
|
avatarUrl: string;
|
|
31
31
|
gender: number;
|
|
32
|
+
isSubAccount: boolean;
|
|
33
|
+
powerKindList: string[];
|
|
32
34
|
}
|
|
33
35
|
export interface PowChallengeResult {
|
|
34
36
|
challenge: string;
|
|
@@ -48,6 +50,7 @@ export declare function sendSmsCode(body: {
|
|
|
48
50
|
export declare function accountLogin(body: {
|
|
49
51
|
accountName: string;
|
|
50
52
|
password: string;
|
|
53
|
+
accountType?: string;
|
|
51
54
|
}, options?: ServicesApi.RequestOptions): Promise<AccountAuthResult>;
|
|
52
55
|
export declare function accountReg(body: {
|
|
53
56
|
accountName: string;
|
|
File without changes
|