component-sanzhizhou 1.0.10 → 1.0.12
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/index.js +6 -8
- package/dist/AuthClient/index.js +23 -10
- package/dist/AuthClient/login-reg.js +5 -4
- package/dist/AuthClient/login.js +18 -33
- package/dist/AuthClient/qr/index.css.js +3 -3
- package/dist/AuthClient/qr/index.js +5 -5
- package/dist/AuthClient/reg.js +29 -37
- package/dist/Buy/qr.js +1 -2
- package/dist/lib/Tool.d.ts +1 -1
- package/dist/lib/Tool.js +2 -2
- package/dist/lib/formatMessage.d.ts +5 -0
- package/dist/lib/formatMessage.js +59 -0
- package/dist/lib/get-language.d.ts +11 -0
- package/dist/lib/get-language.js +69 -0
- package/dist/lib/is-language-zh.d.ts +2 -0
- package/dist/lib/is-language-zh.js +7 -0
- package/dist/lib/request.js +4 -3
- package/dist/locales/ar-EG.json +531 -0
- package/dist/locales/de-DE.json +521 -0
- package/dist/locales/en-US.json +18 -0
- package/dist/locales/es-ES.json +520 -0
- package/dist/locales/fr-FR.json +531 -0
- package/dist/locales/it-IT.json +531 -0
- package/dist/locales/ja-JP.json +561 -0
- package/dist/locales/ko-KR.json +531 -0
- package/dist/locales/pt-PT.json +531 -0
- package/dist/locales/ru-RU.json +531 -0
- package/dist/locales/th-TH.json +561 -0
- package/dist/locales/vi-VN.json +521 -0
- package/dist/locales/zh-CN.json +18 -0
- package/dist/locales/zh-HK.json +520 -0
- package/dist/locales/zh-TW.json +520 -0
- package/package.json +2 -3
package/dist/Auth/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
6
|
import React, { useState, useEffect, useRef } from 'react';
|
|
7
7
|
import { WechatOutlined, RedoOutlined, UserOutlined } from '@ant-design/icons';
|
|
8
|
-
import { Tabs } from 'antd';
|
|
8
|
+
import { QRCode, Tabs } from 'antd';
|
|
9
9
|
import { useRequest } from '@umijs/hooks';
|
|
10
10
|
import * as AuthController from "../service/api/AuthController";
|
|
11
11
|
import PageContentWarp from "../UI/PageContentWarp";
|
|
@@ -14,9 +14,9 @@ import Platform from "../lib/platform";
|
|
|
14
14
|
import QrWs from "../AuthClient/qr/ws";
|
|
15
15
|
import { getApiEnv } from "../lib/getApiUrl";
|
|
16
16
|
import styles from "../AuthClient/qr/index.css";
|
|
17
|
-
import QRCode from 'qrcode.react';
|
|
18
17
|
import h5WePublicLogin from "../AuthClient/qr/h5-we-public-login";
|
|
19
18
|
import Tool from "../lib/Tool";
|
|
19
|
+
import formatMessage from "../lib/formatMessage";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
21
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -143,7 +143,7 @@ var Auth = function Auth(_ref) {
|
|
|
143
143
|
Tool.event.run("".concat(roleType || 'user', "-login-success"), _objectSpread(_objectSpread({}, userInfo), {}, {
|
|
144
144
|
isLogin: true
|
|
145
145
|
}));
|
|
146
|
-
Tool.toast('
|
|
146
|
+
Tool.toast(formatMessage('成功'));
|
|
147
147
|
};
|
|
148
148
|
var _useRequest = useRequest(function () {
|
|
149
149
|
return AuthController.weMiniLoginQr({
|
|
@@ -276,9 +276,7 @@ var Auth = function Auth(_ref) {
|
|
|
276
276
|
return /*#__PURE__*/_jsxs(styles.AuthQrLogin, {
|
|
277
277
|
children: [/*#__PURE__*/_jsxs(styles.LoginForm, {
|
|
278
278
|
children: [/*#__PURE__*/_jsx(styles.WebTitle, {
|
|
279
|
-
children:
|
|
280
|
-
children: "\u767B\u5F55/\u6CE8\u518C"
|
|
281
|
-
})
|
|
279
|
+
children: formatMessage('登录/注册')
|
|
282
280
|
}), /*#__PURE__*/_jsxs(Tabs, {
|
|
283
281
|
activeKey: activeKey,
|
|
284
282
|
onChange: function onChange(keyName) {
|
|
@@ -286,7 +284,7 @@ var Auth = function Auth(_ref) {
|
|
|
286
284
|
},
|
|
287
285
|
children: [!((currentLoginTypeList === null || currentLoginTypeList === void 0 ? void 0 : currentLoginTypeList.length) > 0 && !currentLoginTypeList.includes('wechat')) && /*#__PURE__*/_jsx(Tabs.TabPane, {
|
|
288
286
|
tab: /*#__PURE__*/_jsxs(_Fragment, {
|
|
289
|
-
children: [/*#__PURE__*/_jsx(WechatOutlined, {}), "
|
|
287
|
+
children: [/*#__PURE__*/_jsx(WechatOutlined, {}), " ", formatMessage('微信')]
|
|
290
288
|
}),
|
|
291
289
|
disabled: (currentLoginTypeList === null || currentLoginTypeList === void 0 ? void 0 : currentLoginTypeList.length) > 0 && !currentLoginTypeList.includes('wechat'),
|
|
292
290
|
children: /*#__PURE__*/_jsx(PageContentWarp, {
|
|
@@ -337,7 +335,7 @@ var Auth = function Auth(_ref) {
|
|
|
337
335
|
}, "wechat"), /*#__PURE__*/_jsx(Tabs.TabPane, {
|
|
338
336
|
tab: /*#__PURE__*/_jsxs("span", {
|
|
339
337
|
className: "tab-icon",
|
|
340
|
-
children: [/*#__PURE__*/_jsx(UserOutlined, {}), "
|
|
338
|
+
children: [/*#__PURE__*/_jsx(UserOutlined, {}), " ", formatMessage('账户')]
|
|
341
339
|
}),
|
|
342
340
|
disabled: !currentLoginTypeList.includes('account-login') && !currentLoginTypeList.includes('account'),
|
|
343
341
|
children: /*#__PURE__*/_jsx(AuthLoginReg, {
|
package/dist/AuthClient/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState } from 'react';
|
|
2
3
|
import LoginQr from "./qr";
|
|
3
4
|
import Tool from "../lib/Tool";
|
|
5
|
+
import { ConfigProvider } from "antd";
|
|
6
|
+
import getLanguage from "../lib/get-language";
|
|
4
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
8
|
var Auth = function Auth(_ref) {
|
|
6
9
|
var productType = _ref.productType,
|
|
@@ -12,19 +15,29 @@ var Auth = function Auth(_ref) {
|
|
|
12
15
|
accountRegDisabled = _ref.accountRegDisabled,
|
|
13
16
|
_ref$onSuccess = _ref.onSuccess,
|
|
14
17
|
onSuccess = _ref$onSuccess === void 0 ? function () {} : _ref$onSuccess;
|
|
18
|
+
var _useState = useState(getLanguage()),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
antdLocaleLanguage = _useState2[0],
|
|
21
|
+
setAntdLocaleLanguage = _useState2[1];
|
|
15
22
|
var onLoginSuccess = function onLoginSuccess() {
|
|
16
23
|
onSuccess();
|
|
17
24
|
Tool.pageDialogCloseAll();
|
|
18
25
|
};
|
|
19
|
-
return /*#__PURE__*/_jsx(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
27
|
+
locale: antdLocaleLanguage.locale,
|
|
28
|
+
direction: antdLocaleLanguage.direction
|
|
29
|
+
// theme={ theme }
|
|
30
|
+
,
|
|
31
|
+
children: /*#__PURE__*/_jsx(LoginQr, {
|
|
32
|
+
productType: productType,
|
|
33
|
+
clientUniqueKeyList: clientUniqueKeyList,
|
|
34
|
+
defaultLoginType: defaultLoginType,
|
|
35
|
+
wechatDisabled: wechatDisabled,
|
|
36
|
+
accountDisabled: accountDisabled,
|
|
37
|
+
accountHidden: accountHidden,
|
|
38
|
+
accountRegDisabled: accountRegDisabled,
|
|
39
|
+
onLoginSuccess: onLoginSuccess
|
|
40
|
+
})
|
|
28
41
|
});
|
|
29
42
|
};
|
|
30
43
|
export default Auth;
|
|
@@ -5,6 +5,7 @@ import { UserAddOutlined, UserOutlined } from "@ant-design/icons";
|
|
|
5
5
|
import Reg from "./reg";
|
|
6
6
|
import styles from "./login-reg.css";
|
|
7
7
|
import AuthLogin from "./login";
|
|
8
|
+
import formatMessage from "../lib/formatMessage";
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
var AuthLoginReg = function AuthLoginReg(_ref) {
|
|
@@ -33,11 +34,11 @@ var AuthLoginReg = function AuthLoginReg(_ref) {
|
|
|
33
34
|
value: activeKey,
|
|
34
35
|
children: [/*#__PURE__*/_jsxs(Radio.Button, {
|
|
35
36
|
value: "login",
|
|
36
|
-
children: [/*#__PURE__*/_jsx(UserOutlined, {}), "
|
|
37
|
+
children: [/*#__PURE__*/_jsx(UserOutlined, {}), " ", formatMessage('登录')]
|
|
37
38
|
}), /*#__PURE__*/_jsxs(Radio.Button, {
|
|
38
39
|
value: "reg",
|
|
39
40
|
disabled: accountRegDisabled,
|
|
40
|
-
children: [/*#__PURE__*/_jsx(UserAddOutlined, {}), "
|
|
41
|
+
children: [/*#__PURE__*/_jsx(UserAddOutlined, {}), " ", formatMessage('注册')]
|
|
41
42
|
})]
|
|
42
43
|
})
|
|
43
44
|
}), /*#__PURE__*/_jsxs(Tabs, {
|
|
@@ -47,7 +48,7 @@ var AuthLoginReg = function AuthLoginReg(_ref) {
|
|
|
47
48
|
setActiveKey(keyName);
|
|
48
49
|
},
|
|
49
50
|
children: [/*#__PURE__*/_jsx(Tabs.TabPane, {
|
|
50
|
-
tab:
|
|
51
|
+
tab: formatMessage('登录'),
|
|
51
52
|
children: /*#__PURE__*/_jsx(AuthLogin, {
|
|
52
53
|
roleType: roleType,
|
|
53
54
|
env: env,
|
|
@@ -60,7 +61,7 @@ var AuthLoginReg = function AuthLoginReg(_ref) {
|
|
|
60
61
|
}
|
|
61
62
|
})
|
|
62
63
|
}, "login"), /*#__PURE__*/_jsx(Tabs.TabPane, {
|
|
63
|
-
tab:
|
|
64
|
+
tab: formatMessage('注册'),
|
|
64
65
|
children: /*#__PURE__*/_jsx(Reg, {
|
|
65
66
|
env: env,
|
|
66
67
|
roleType: roleType,
|
package/dist/AuthClient/login.js
CHANGED
|
@@ -11,36 +11,17 @@ import { useRequest } from '@umijs/hooks';
|
|
|
11
11
|
// import styles from "./reg.scss" ;
|
|
12
12
|
import * as AuthController from "../service/api/AuthController";
|
|
13
13
|
import AuthUserOffline from "./user-offline";
|
|
14
|
+
import formatMessage from "../lib/formatMessage";
|
|
14
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
17
|
var formItemLayout = {
|
|
17
18
|
labelCol: {
|
|
18
|
-
|
|
19
|
-
span: 24
|
|
20
|
-
},
|
|
21
|
-
sm: {
|
|
22
|
-
span: 5
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
wrapperCol: {
|
|
26
|
-
xs: {
|
|
27
|
-
span: 24
|
|
28
|
-
},
|
|
29
|
-
sm: {
|
|
30
|
-
span: 19
|
|
31
|
-
}
|
|
19
|
+
span: 7
|
|
32
20
|
}
|
|
33
21
|
};
|
|
34
22
|
var tailFormItemLayout = {
|
|
35
23
|
wrapperCol: {
|
|
36
|
-
|
|
37
|
-
span: 24,
|
|
38
|
-
offset: 5
|
|
39
|
-
},
|
|
40
|
-
sm: {
|
|
41
|
-
span: 16,
|
|
42
|
-
offset: 5
|
|
43
|
-
}
|
|
24
|
+
offset: formItemLayout.labelCol.span
|
|
44
25
|
}
|
|
45
26
|
};
|
|
46
27
|
var AuthReg = function AuthReg(_ref) {
|
|
@@ -104,7 +85,7 @@ var AuthReg = function AuthReg(_ref) {
|
|
|
104
85
|
Tool.setLocalUserInfo(_objectSpread(_objectSpread({}, data), {}, {
|
|
105
86
|
isLogin: true
|
|
106
87
|
}));
|
|
107
|
-
Tool.toast('
|
|
88
|
+
Tool.toast(formatMessage('成功'));
|
|
108
89
|
Tool.event.run('user-info');
|
|
109
90
|
Tool.event.run("".concat(roleType || 'user', "-login-success"), _objectSpread(_objectSpread({}, data), {}, {
|
|
110
91
|
isLogin: true
|
|
@@ -136,12 +117,12 @@ var AuthReg = function AuthReg(_ref) {
|
|
|
136
117
|
disabled: loading,
|
|
137
118
|
autoComplete: "off",
|
|
138
119
|
children: [/*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({
|
|
139
|
-
label:
|
|
120
|
+
label: formatMessage('手机号码')
|
|
140
121
|
}, formItemLayout), {}, {
|
|
141
122
|
name: "accountName",
|
|
142
123
|
rules: [{
|
|
143
124
|
required: true,
|
|
144
|
-
message: '
|
|
125
|
+
message: formatMessage('请输入')
|
|
145
126
|
},
|
|
146
127
|
// {
|
|
147
128
|
// pattern: /^([a-z0-9]+[_\-.]?)*[a-z0-9]+@([a-z0-9]+[_\-.]?)*[a-z0-9]+\.[a-z]{2,10}$/i,
|
|
@@ -149,33 +130,37 @@ var AuthReg = function AuthReg(_ref) {
|
|
|
149
130
|
// },
|
|
150
131
|
{
|
|
151
132
|
pattern: /^\s*1\d{2}\s*\d{4}\s*\d{4}\s*$/,
|
|
152
|
-
message: '
|
|
133
|
+
message: "".concat(formatMessage('这似乎不是中国大陆手机号码'), "\uFF1F")
|
|
153
134
|
}],
|
|
154
135
|
children: /*#__PURE__*/_jsx(Input, {
|
|
155
|
-
placeholder:
|
|
136
|
+
placeholder: formatMessage('手机号码'),
|
|
156
137
|
prefix: /*#__PURE__*/_jsx(UserOutlined, {
|
|
157
138
|
className: "input-prefix-icon"
|
|
158
139
|
})
|
|
159
140
|
})
|
|
160
141
|
})), /*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({}, formItemLayout), {}, {
|
|
161
|
-
label:
|
|
142
|
+
label: formatMessage('密码'),
|
|
162
143
|
name: "password",
|
|
163
144
|
rules: [{
|
|
164
145
|
required: true,
|
|
165
|
-
message: '
|
|
146
|
+
message: formatMessage('请输入')
|
|
166
147
|
}, {
|
|
167
148
|
min: 6,
|
|
168
|
-
message: '
|
|
149
|
+
message: formatMessage('最少#{maxCount}个字符', {
|
|
150
|
+
maxCount: 6
|
|
151
|
+
})
|
|
169
152
|
}, {
|
|
170
153
|
max: 60,
|
|
171
|
-
message: '
|
|
154
|
+
message: formatMessage('最多#{maxCount}个字符', {
|
|
155
|
+
maxCount: 60
|
|
156
|
+
})
|
|
172
157
|
}],
|
|
173
158
|
children: /*#__PURE__*/_jsx(Input.Password, {
|
|
174
159
|
prefix: /*#__PURE__*/_jsx(LockOutlined, {
|
|
175
160
|
className: "input-prefix-icon"
|
|
176
161
|
}),
|
|
177
162
|
type: "password",
|
|
178
|
-
placeholder:
|
|
163
|
+
placeholder: formatMessage('请输入'),
|
|
179
164
|
iconRender: function iconRender(visible) {
|
|
180
165
|
return visible ? /*#__PURE__*/_jsx(EyeTwoTone, {}) : /*#__PURE__*/_jsx(EyeInvisibleOutlined, {});
|
|
181
166
|
}
|
|
@@ -186,7 +171,7 @@ var AuthReg = function AuthReg(_ref) {
|
|
|
186
171
|
loading: loading,
|
|
187
172
|
htmlType: "submit",
|
|
188
173
|
icon: /*#__PURE__*/_jsx(UserOutlined, {}),
|
|
189
|
-
children:
|
|
174
|
+
children: formatMessage('登录')
|
|
190
175
|
})
|
|
191
176
|
}))]
|
|
192
177
|
})
|
|
@@ -3,15 +3,15 @@ export default {
|
|
|
3
3
|
AuthQrLogin: styled.div.withConfig({
|
|
4
4
|
displayName: "AuthQrLogin",
|
|
5
5
|
componentId: "component-sanzhizhou__sc-55ened-0"
|
|
6
|
-
})(["position:relative;.ant-tabs-tab-btn{.anticon{margin-right:6px;}}.weQrUrl{position:absolute;left:50%;transform:translateX(-50%);}.qr{position:relative;display:block;margin:12px auto 0;width:230px;height:230px;background-repeat:no-repeat;background-size:cover;background-position:center;&.qrAlipay{border:3px solid #1677ff;}.reTry{position:absolute;z-index:100;left:0;top:0;width:100%;font-size:80px;background-color:rgba( 255,255,255,0.95 );text-align:center;line-height:210px;height:100%;a{display:block;}}}.alt{padding:10px 0 0;color:#999;text-align:center;}.altWeb{padding:16px 0 0;max-width:300px;margin:0 auto;.titles{text-align:center;font-weight:bold;}ul{margin:0 10px;}}.percent{width:100%;position:absolute;overflow:hidden;left:0;bottom:0;.warp{height:4px;background-color:#1677ff;transition:all 1.6s ease-in-out;-webkit-transition:all 1.6s ease-in-out;}}.callWechat{position:absolute;left:
|
|
6
|
+
})(["position:relative;.ant-tabs-tab-btn{.anticon{margin-right:6px;}}.weQrUrl{position:absolute;left:50%;transform:translateX(-50%);}.qr{position:relative;display:block;margin:12px auto 0;width:230px;height:230px;background-repeat:no-repeat;background-size:cover;background-position:center;&.qrAlipay{border:3px solid #1677ff;}.reTry{position:absolute;z-index:100;left:0;top:0;width:100%;font-size:80px;background-color:rgba( 255,255,255,0.95 );text-align:center;line-height:210px;height:100%;a{display:block;}}}.alt{padding:10px 0 0;color:#999;text-align:center;}.altWeb{padding:16px 0 0;max-width:300px;margin:0 auto;.titles{text-align:center;font-weight:bold;}ul{margin:0 10px;}}.percent{width:100%;position:absolute;overflow:hidden;left:0;bottom:0;.warp{height:4px;background-color:#1677ff;transition:all 1.6s ease-in-out;-webkit-transition:all 1.6s ease-in-out;}}.callWechat{position:absolute;left:6px;bottom:6px;background:#F6F6F6;width:4px;height:4px;}.callAccount{position:absolute;right:6px;bottom:6px;background:#F6F6F6;width:4px;height:4px;}"]),
|
|
7
7
|
LoginForm: styled.div.withConfig({
|
|
8
8
|
displayName: "LoginForm",
|
|
9
9
|
componentId: "component-sanzhizhou__sc-55ened-1"
|
|
10
|
-
})(["margin:0 auto;padding:
|
|
10
|
+
})(["margin:0 auto;padding:12px 16px 6px 16px;background-color:rgba(255,255,255,0.9 );border-radius:6px;"]),
|
|
11
11
|
WebTitle: styled.div.withConfig({
|
|
12
12
|
displayName: "WebTitle",
|
|
13
13
|
componentId: "component-sanzhizhou__sc-55ened-2"
|
|
14
|
-
})(["font-weight:normal;font-size:
|
|
14
|
+
})(["font-weight:normal;font-size:26px;text-align:center;padding:6px 0 0 0;line-height:1em;span{display:inline-block;padding-left:5px;font-weight:lighter;font-size:16px;}"]),
|
|
15
15
|
WeQrUrlBox: styled.div.withConfig({
|
|
16
16
|
displayName: "WeQrUrlBox",
|
|
17
17
|
componentId: "component-sanzhizhou__sc-55ened-3"
|
|
@@ -4,7 +4,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
5
|
import React, { useState, useEffect, useRef } from 'react';
|
|
6
6
|
import { WechatOutlined, RedoOutlined, UserOutlined } from '@ant-design/icons';
|
|
7
|
-
import { Tabs } from 'antd';
|
|
7
|
+
import { Tabs, QRCode } from 'antd';
|
|
8
8
|
import Tool from "../../lib/Tool";
|
|
9
9
|
import { useRequest } from '@umijs/hooks';
|
|
10
10
|
import * as AuthController from "../../service/api/AuthController";
|
|
@@ -17,8 +17,8 @@ import styles from "./index.css";
|
|
|
17
17
|
var reTryMaxCount = 120;
|
|
18
18
|
var reTryTimeLoop = 1000; // ms
|
|
19
19
|
var FromWhere = 'web';
|
|
20
|
-
import QRCode from 'qrcode.react';
|
|
21
20
|
import h5WePublicLogin from "./h5-we-public-login";
|
|
21
|
+
import formatMessage from "../../lib/formatMessage";
|
|
22
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
23
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
24
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -135,7 +135,7 @@ var LoginQr = function LoginQr(_ref) {
|
|
|
135
135
|
}));
|
|
136
136
|
onLoginSuccess();
|
|
137
137
|
Tool.event.run('login-success');
|
|
138
|
-
Tool.toast('
|
|
138
|
+
Tool.toast(formatMessage('成功'));
|
|
139
139
|
};
|
|
140
140
|
var _useRequest = useRequest(function () {
|
|
141
141
|
return AuthController.weMiniLoginQr({
|
|
@@ -261,7 +261,7 @@ var LoginQr = function LoginQr(_ref) {
|
|
|
261
261
|
children: /*#__PURE__*/_jsxs(styles.LoginForm, {
|
|
262
262
|
children: [/*#__PURE__*/_jsx(styles.WebTitle, {
|
|
263
263
|
children: /*#__PURE__*/_jsx("span", {
|
|
264
|
-
children:
|
|
264
|
+
children: formatMessage('登录/注册')
|
|
265
265
|
})
|
|
266
266
|
}), /*#__PURE__*/_jsxs(Tabs, {
|
|
267
267
|
activeKey: activeKey,
|
|
@@ -319,7 +319,7 @@ var LoginQr = function LoginQr(_ref) {
|
|
|
319
319
|
}, "wechat"), !accountHidden && /*#__PURE__*/_jsx(Tabs.TabPane, {
|
|
320
320
|
tab: /*#__PURE__*/_jsxs("span", {
|
|
321
321
|
className: "tab-icon",
|
|
322
|
-
children: [/*#__PURE__*/_jsx(UserOutlined, {}),
|
|
322
|
+
children: [/*#__PURE__*/_jsx(UserOutlined, {}), formatMessage('账户')]
|
|
323
323
|
}),
|
|
324
324
|
disabled: accountDisabled,
|
|
325
325
|
children: /*#__PURE__*/_jsx(AuthLoginReg
|
package/dist/AuthClient/reg.js
CHANGED
|
@@ -8,36 +8,17 @@ import { Input, Button, Form } from 'antd';
|
|
|
8
8
|
import Tool from "../lib/Tool";
|
|
9
9
|
import { useRequest } from "@umijs/hooks";
|
|
10
10
|
import * as AuthController from "../service/api/AuthController";
|
|
11
|
+
import formatMessage from "../lib/formatMessage";
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
14
|
var formItemLayout = {
|
|
14
15
|
labelCol: {
|
|
15
|
-
|
|
16
|
-
span: 24
|
|
17
|
-
},
|
|
18
|
-
sm: {
|
|
19
|
-
span: 5
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
wrapperCol: {
|
|
23
|
-
xs: {
|
|
24
|
-
span: 24
|
|
25
|
-
},
|
|
26
|
-
sm: {
|
|
27
|
-
span: 19
|
|
28
|
-
}
|
|
16
|
+
span: 7
|
|
29
17
|
}
|
|
30
18
|
};
|
|
31
19
|
var tailFormItemLayout = {
|
|
32
20
|
wrapperCol: {
|
|
33
|
-
|
|
34
|
-
span: 24,
|
|
35
|
-
offset: 5
|
|
36
|
-
},
|
|
37
|
-
sm: {
|
|
38
|
-
span: 16,
|
|
39
|
-
offset: 5
|
|
40
|
-
}
|
|
21
|
+
offset: formItemLayout.labelCol.span
|
|
41
22
|
}
|
|
42
23
|
};
|
|
43
24
|
var Reg = function Reg(_ref) {
|
|
@@ -74,7 +55,7 @@ var Reg = function Reg(_ref) {
|
|
|
74
55
|
Tool.setLocalUserInfo(_objectSpread(_objectSpread({}, data), {}, {
|
|
75
56
|
isLogin: true
|
|
76
57
|
}));
|
|
77
|
-
Tool.toast('
|
|
58
|
+
Tool.toast(formatMessage('成功'));
|
|
78
59
|
Tool.event.run('user-info');
|
|
79
60
|
Tool.event.run("".concat(roleType || 'user', "-login-success"), _objectSpread(_objectSpread({}, data), {}, {
|
|
80
61
|
isLogin: true
|
|
@@ -106,63 +87,74 @@ var Reg = function Reg(_ref) {
|
|
|
106
87
|
onFinish: onFinish,
|
|
107
88
|
autoComplete: "off",
|
|
108
89
|
children: [/*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({
|
|
109
|
-
label:
|
|
90
|
+
label: formatMessage('手机号码')
|
|
110
91
|
}, formItemLayout), {}, {
|
|
111
92
|
name: "accountName",
|
|
112
93
|
rules: [{
|
|
113
94
|
required: true,
|
|
114
|
-
message: '
|
|
95
|
+
message: formatMessage('请输入')
|
|
115
96
|
},
|
|
116
97
|
// { min: 11, message: '最短4个字符', }
|
|
117
98
|
{
|
|
118
99
|
pattern: /^1\d{2}\s*\d{4}\s*\d{4}\s*$/,
|
|
119
|
-
message: '
|
|
100
|
+
message: formatMessage('这似乎不是中国大陆手机号码') + '?'
|
|
120
101
|
}],
|
|
121
102
|
children: /*#__PURE__*/_jsx(Input, {
|
|
122
|
-
placeholder:
|
|
103
|
+
placeholder: formatMessage('手机号码'),
|
|
123
104
|
prefix: /*#__PURE__*/_jsx(UserOutlined, {
|
|
124
105
|
className: "input-prefix-icon"
|
|
125
106
|
})
|
|
126
107
|
})
|
|
127
108
|
})), /*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({}, formItemLayout), {}, {
|
|
128
|
-
label:
|
|
109
|
+
label: formatMessage('密码'),
|
|
129
110
|
name: "password",
|
|
130
111
|
rules: [{
|
|
131
112
|
required: true,
|
|
132
|
-
message: '
|
|
113
|
+
message: formatMessage('请输入')
|
|
133
114
|
}, {
|
|
134
115
|
min: 6,
|
|
135
|
-
message: '
|
|
116
|
+
message: formatMessage('最少#{maxCount}个字符', {
|
|
117
|
+
maxCount: 6
|
|
118
|
+
})
|
|
136
119
|
}, {
|
|
137
120
|
max: 60,
|
|
138
|
-
message: '
|
|
121
|
+
message: formatMessage('最多#{maxCount}个字符', {
|
|
122
|
+
maxCount: 60
|
|
123
|
+
})
|
|
139
124
|
}],
|
|
140
125
|
children: /*#__PURE__*/_jsx(Input.Password, {
|
|
141
126
|
prefix: /*#__PURE__*/_jsx(LockOutlined, {
|
|
142
127
|
className: "input-prefix-icon"
|
|
143
128
|
}),
|
|
144
129
|
type: "password",
|
|
145
|
-
placeholder:
|
|
130
|
+
placeholder: formatMessage('请输入'),
|
|
146
131
|
iconRender: function iconRender(visible) {
|
|
147
132
|
return visible ? /*#__PURE__*/_jsx(EyeTwoTone, {}) : /*#__PURE__*/_jsx(EyeInvisibleOutlined, {});
|
|
148
133
|
}
|
|
149
134
|
})
|
|
150
135
|
})), /*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({}, formItemLayout), {}, {
|
|
151
|
-
label:
|
|
136
|
+
label: formatMessage('确认密码'),
|
|
152
137
|
name: "inviteId",
|
|
153
138
|
rules: [{
|
|
154
139
|
required: true,
|
|
155
|
-
message: '
|
|
140
|
+
message: formatMessage('请输入')
|
|
141
|
+
}, {
|
|
142
|
+
min: 6,
|
|
143
|
+
message: formatMessage('最少#{maxCount}个字符', {
|
|
144
|
+
maxCount: 6
|
|
145
|
+
})
|
|
156
146
|
}, {
|
|
157
147
|
max: 60,
|
|
158
|
-
message: '
|
|
148
|
+
message: formatMessage('最多#{maxCount}个字符', {
|
|
149
|
+
maxCount: 60
|
|
150
|
+
})
|
|
159
151
|
}],
|
|
160
152
|
children: /*#__PURE__*/_jsx(Input.Password, {
|
|
161
153
|
type: "password",
|
|
162
154
|
prefix: /*#__PURE__*/_jsx(LockOutlined, {
|
|
163
155
|
className: "input-prefix-icon"
|
|
164
156
|
}),
|
|
165
|
-
placeholder:
|
|
157
|
+
placeholder: formatMessage('再次密码')
|
|
166
158
|
})
|
|
167
159
|
})), /*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({}, tailFormItemLayout), {}, {
|
|
168
160
|
children: /*#__PURE__*/_jsx("div", {
|
|
@@ -171,7 +163,7 @@ var Reg = function Reg(_ref) {
|
|
|
171
163
|
loading: loading,
|
|
172
164
|
htmlType: "submit",
|
|
173
165
|
icon: /*#__PURE__*/_jsx(UserOutlined, {}),
|
|
174
|
-
children:
|
|
166
|
+
children: formatMessage('注册')
|
|
175
167
|
})
|
|
176
168
|
})
|
|
177
169
|
}))]
|
package/dist/Buy/qr.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import React, { useEffect, useState } from 'react';
|
|
4
|
-
import { Result, Button, Space, Divider, Tabs } from 'antd';
|
|
4
|
+
import { Result, Button, Space, Divider, Tabs, QRCode } from 'antd';
|
|
5
5
|
import { AlipayCircleOutlined, CloseOutlined, LoadingOutlined, PauseOutlined, WechatOutlined } from '@ant-design/icons';
|
|
6
6
|
import { useRequest } from '@umijs/hooks';
|
|
7
7
|
import * as TradeController from "../service/api/TradeController";
|
|
8
8
|
import * as VipController from "../service/api/VipController";
|
|
9
|
-
import QRCode from 'qrcode.react';
|
|
10
9
|
import Tool from "../lib/Tool";
|
|
11
10
|
import PageContentWarp from "../UI/PageContentWarp";
|
|
12
11
|
import styles from "./qr.css";
|
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;
|
package/dist/lib/Tool.js
CHANGED
|
@@ -4,9 +4,9 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
5
|
// @ts-nocheck
|
|
6
6
|
|
|
7
|
-
import { Modal, message, Tooltip } from 'antd';
|
|
7
|
+
import { Modal, message, Tooltip, QRCode } from 'antd';
|
|
8
8
|
// const JrQrcode = require('jr-qrcode');
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
if (!window.__events) {
|
|
11
11
|
window.__events = [];
|
|
12
12
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import zhCN from "../locales/zh-CN.json";
|
|
2
|
+
import zhHK from "../locales/zh-HK.json";
|
|
3
|
+
import zhTW from "../locales/zh-TW.json";
|
|
4
|
+
import enUS from "../locales/en-US.json";
|
|
5
|
+
import esES from "../locales/es-ES.json";
|
|
6
|
+
import jaJP from "../locales/ja-JP.json";
|
|
7
|
+
import thTH from "../locales/th-TH.json";
|
|
8
|
+
import viVN from "../locales/vi-VN.json";
|
|
9
|
+
import deDE from "../locales/de-DE.json";
|
|
10
|
+
import frFR from "../locales/fr-FR.json";
|
|
11
|
+
import ruRU from "../locales/ru-RU.json";
|
|
12
|
+
import ptPT from "../locales/pt-PT.json";
|
|
13
|
+
import koKR from "../locales/ko-KR.json";
|
|
14
|
+
import itIT from "../locales/it-IT.json";
|
|
15
|
+
import arEG from "../locales/ar-EG.json";
|
|
16
|
+
import getLanguage from "./get-language";
|
|
17
|
+
var resources = {
|
|
18
|
+
'zh-CN': zhCN,
|
|
19
|
+
'zh-HK': zhHK,
|
|
20
|
+
'zh-TW': zhTW,
|
|
21
|
+
'en-US': enUS,
|
|
22
|
+
'es-ES': esES,
|
|
23
|
+
'ja-JP': jaJP,
|
|
24
|
+
'th-TH': thTH,
|
|
25
|
+
'vi-VN': viVN,
|
|
26
|
+
'de-DE': deDE,
|
|
27
|
+
'fr-FR': frFR,
|
|
28
|
+
'ru-RU': ruRU,
|
|
29
|
+
'pt-PT': ptPT,
|
|
30
|
+
'ko-KR': koKR,
|
|
31
|
+
'it-IT': itIT,
|
|
32
|
+
'ar-EG': arEG
|
|
33
|
+
};
|
|
34
|
+
var formatMessage = function formatMessage(id) {
|
|
35
|
+
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36
|
+
var defaultMessage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
37
|
+
if (!id) {
|
|
38
|
+
return '';
|
|
39
|
+
}
|
|
40
|
+
var language = getLanguage();
|
|
41
|
+
var messages = resources[language.language] || resources['zh-CN'];
|
|
42
|
+
// const msg = intl.formatMessage({
|
|
43
|
+
// id,
|
|
44
|
+
// defaultMessage,
|
|
45
|
+
// }, {
|
|
46
|
+
// ...data,
|
|
47
|
+
// });
|
|
48
|
+
|
|
49
|
+
var text = messages[id] || id || '';
|
|
50
|
+
for (var dataKey in data) {
|
|
51
|
+
var value = data[dataKey];
|
|
52
|
+
text = text.replaceAll("#{".concat(dataKey, "}"), value);
|
|
53
|
+
}
|
|
54
|
+
if (!text) {
|
|
55
|
+
console.warn('翻译缺失:', id);
|
|
56
|
+
}
|
|
57
|
+
return text;
|
|
58
|
+
};
|
|
59
|
+
export default formatMessage;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import 'dayjs/locale/zh-cn';
|
|
2
|
+
import type { Locale } from "antd/lib/locale";
|
|
3
|
+
import { DirectionType } from "antd/es/config-provider";
|
|
4
|
+
interface Language {
|
|
5
|
+
language: string;
|
|
6
|
+
locale: Locale;
|
|
7
|
+
direction: DirectionType;
|
|
8
|
+
fontFamily: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
declare const getLanguage: (language?: string) => Language;
|
|
11
|
+
export default getLanguage;
|