@antv/dumi-theme-antv 0.7.9 → 0.8.0-alpha.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/builtins/Playground/index.js +1 -1
- package/dist/builtins/Playground/index.module.less +0 -1
- package/dist/common/styles/Common.js +1 -1
- package/dist/common/styles/theme.js +1 -1
- package/dist/components/AI/HomeDialog/AntVBanner/index.js +4 -0
- package/dist/components/AI/HomeDialog/AntVBanner/index.module.less +35 -0
- package/dist/components/AI/HomeDialog/ModeSelector/ModeSelectorDropdown.js +42 -0
- package/dist/components/AI/HomeDialog/ModeSelector/index.js +32 -0
- package/dist/components/AI/HomeDialog/ModeSelector/index.module.less +289 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/ChooseLib/index.js +62 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/ChooseLib/index.module.less +4 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/DatasourceCard/index.js +25 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/DatasourceCard/index.module.less +42 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/SendButton.js +23 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/SendButton.module.less +9 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/Uploader/DataUploader.js +225 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/index.js +172 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/index.module.less +128 -0
- package/dist/components/AI/HomeDialog/RecommendCase/Card.js +80 -0
- package/dist/components/AI/HomeDialog/RecommendCase/card.module.less +131 -0
- package/dist/components/AI/HomeDialog/RecommendCase/index.js +130 -0
- package/dist/components/AI/HomeDialog/RecommendCase/index.module.less +45 -0
- package/dist/components/AI/HomeDialog/RecommendCase/recommend.json +66 -0
- package/dist/components/AI/HomeDialog/index.js +62 -0
- package/dist/components/AI/HomeDialog/index.module.less +3 -0
- package/dist/components/AI/constant.js +37 -0
- package/dist/components/AI/index.js +1 -0
- package/dist/components/AI/types.js +1 -0
- package/dist/components/AI/utils.js +38 -0
- package/dist/components/Login/Captcha/index.js +185 -0
- package/dist/components/Login/Captcha/index.less +91 -0
- package/dist/components/Login/CheckCode/index.js +244 -0
- package/dist/components/Login/CheckCode/index.less +137 -0
- package/dist/components/Login/CountDownButton/index.js +109 -0
- package/dist/components/Login/CountDownButton/index.less +8 -0
- package/dist/components/Login/LoginForm.js +239 -0
- package/dist/components/Login/LoginForm.less +408 -0
- package/dist/components/Login/index.js +24 -0
- package/dist/components/Login/openAuthWindow.js +54 -0
- package/dist/components/Login/types.js +5 -0
- package/dist/components/Login/utils.js +47 -0
- package/dist/hooks/useProducts.js +39 -0
- package/dist/hooks/useStreamingText.js +139 -0
- package/dist/hooks/useTypewriter.js +69 -0
- package/dist/hooks/useVisionsnapSdk.js +159 -0
- package/dist/layouts/DocLayout.js +2 -2
- package/dist/layouts/GlobalLayout/index.js +22 -0
- package/dist/locales/en.json +132 -1
- package/dist/locales/zh.json +132 -1
- package/dist/model/AIChat.js +313 -0
- package/dist/model/auth.js +147 -0
- package/dist/pages/AIPlayground/components/ConversationsMenu/index.js +176 -0
- package/dist/pages/AIPlayground/components/ConversationsMenu/index.module.less +46 -0
- package/dist/pages/AIPlayground/components/MarkdownComponent/MarkdownCodeBlock.js +97 -0
- package/dist/pages/AIPlayground/components/MarkdownComponent/MarkdownCodeBlock.module.less +13 -0
- package/dist/pages/AIPlayground/components/MarkdownComponent/index.js +50 -0
- package/dist/pages/AIPlayground/components/MsgBox/index.js +407 -0
- package/dist/pages/AIPlayground/components/MsgBox/index.module.less +43 -0
- package/dist/pages/AIPlayground/components/MsgBox/useAutoScroll.js +46 -0
- package/dist/pages/AIPlayground/components/SessionLayout/index.js +62 -0
- package/dist/pages/AIPlayground/components/SessionLayout/index.module.less +37 -0
- package/dist/pages/AIPlayground/components/TaskBox/generateCode.js +230 -0
- package/dist/pages/AIPlayground/components/TaskBox/index.js +101 -0
- package/dist/pages/AIPlayground/components/TaskBox/index.module.less +9 -0
- package/dist/pages/AIPlayground/demo.js +34 -0
- package/dist/pages/AIPlayground/index.js +12 -0
- package/dist/pages/AIPlayground/index.module.less +5 -0
- package/dist/pages/Examples/components/Accouncement/index.module.less +1 -1
- package/dist/pages/Examples/index.module.less +13 -13
- package/dist/pages/Index/components/Cases/index.module.less +9 -9
- package/dist/pages/Index/components/Companies/index.module.less +5 -4
- package/dist/pages/Index/components/Features/FeatureCard.module.less +4 -5
- package/dist/pages/Index/components/Features/index.module.less +6 -6
- package/dist/pages/Index/components/_.less +9 -9
- package/dist/pages/Index/index.js +1 -1
- package/dist/plugin/index.js +14 -6
- package/dist/slots/Banner/Notification.module.less +8 -8
- package/dist/slots/Banner/index.module.less +11 -10
- package/dist/slots/CodeEditor/Toolbar.js +23 -27
- package/dist/slots/CodeEditor/Toolbar.module.less +7 -0
- package/dist/slots/CodeEditor/index.js +67 -5
- package/dist/slots/CodeEditor/index.module.less +24 -0
- package/dist/slots/CodeEditor/utils.js +2 -1
- package/dist/slots/CodePreview/index.module.less +0 -3
- package/dist/slots/CodeRunner/index.js +24 -11
- package/dist/slots/ContentTable/index.module.less +2 -1
- package/dist/{pages/Index/components → slots}/Detail/News.js +1 -1
- package/dist/{pages/Index/components → slots}/Detail/News.module.less +9 -9
- package/dist/{pages/Index/components → slots}/Detail/index.js +13 -29
- package/dist/{pages/Index/components → slots}/Detail/index.module.less +24 -21
- package/dist/slots/ExampleSider/index.module.less +3 -4
- package/dist/slots/Footer/index.module.less +3 -3
- package/dist/slots/Header/Products/Product.module.less +3 -3
- package/dist/slots/Header/Products/getProducts.js +20 -26
- package/dist/slots/Header/Products/index.js +20 -16
- package/dist/slots/Header/Search/SearchResult.js +53 -14
- package/dist/slots/Header/Search/SearchResult.module.less +1 -0
- package/dist/slots/Header/Search/index.js +2 -1
- package/dist/slots/Header/index.js +72 -30
- package/dist/slots/Header/index.module.less +15 -7
- package/dist/slots/LiveExample/index.js +1 -1
- package/dist/slots/LiveExample/index.module.less +1 -1
- package/dist/slots/Loading/index.module.less +30 -28
- package/dist/slots/ManualContent/index.module.less +14 -17
- package/dist/slots/_.less +9 -9
- package/dist/static/user.svg +3 -0
- package/dist/typings.d.ts +11 -0
- package/dist/utils/analytics.js +16 -0
- package/dist/utils/code.js +35 -0
- package/dist/utils/env.js +63 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/request.js +42 -0
- package/package.json +33 -17
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { NC_SCENE } from "../utils";
|
|
2
|
+
import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react'; // 图形验证码资源文件
|
|
3
|
+
|
|
4
|
+
import { Form, Input } from 'antd';
|
|
5
|
+
import cls from 'classnames';
|
|
6
|
+
import { useIntl } from 'dumi';
|
|
7
|
+
import "./index.less";
|
|
8
|
+
|
|
9
|
+
// 添加 window.noCaptcha 的类型声明
|
|
10
|
+
|
|
11
|
+
// 图形验证码资源文件
|
|
12
|
+
var NC_CSS_SOURCE = 'https://g.alicdn.com/sd/ncpc/nc.css?t=1514534550478';
|
|
13
|
+
var NC_SCRIPT_SOURCE = 'https://g.alicdn.com/sd/ncpc/nc.js?t=1514534550478';
|
|
14
|
+
var NC_NAME = 'NoCaptcha';
|
|
15
|
+
var Captcha = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
16
|
+
var _ref$ncName = _ref.ncName,
|
|
17
|
+
ncName = _ref$ncName === void 0 ? NC_NAME : _ref$ncName,
|
|
18
|
+
_ref$scene = _ref.scene,
|
|
19
|
+
scene = _ref$scene === void 0 ? NC_SCENE.login : _ref$scene,
|
|
20
|
+
form = _ref.form,
|
|
21
|
+
_ref$onCallback = _ref.onCallback,
|
|
22
|
+
onCallback = _ref$onCallback === void 0 ? function () {} : _ref$onCallback,
|
|
23
|
+
className = _ref.className;
|
|
24
|
+
var _useIntl = useIntl(),
|
|
25
|
+
formatMessage = _useIntl.formatMessage,
|
|
26
|
+
locale = _useIntl.locale;
|
|
27
|
+
var ncInstance = useRef(null);
|
|
28
|
+
function reset() {
|
|
29
|
+
var _ncInstance$current;
|
|
30
|
+
form.setFieldsValue({
|
|
31
|
+
csessionid: '',
|
|
32
|
+
sig: '',
|
|
33
|
+
token: '',
|
|
34
|
+
scene: '',
|
|
35
|
+
captcha: null
|
|
36
|
+
});
|
|
37
|
+
(_ncInstance$current = ncInstance.current) === null || _ncInstance$current === void 0 || _ncInstance$current.reset(1);
|
|
38
|
+
}
|
|
39
|
+
function getValues() {
|
|
40
|
+
return form.getFieldsValue(['csessionid', 'sig', 'token', 'scene', 'captcha']);
|
|
41
|
+
}
|
|
42
|
+
useImperativeHandle(ref, function () {
|
|
43
|
+
return {
|
|
44
|
+
resetCaptcha: function resetCaptcha() {
|
|
45
|
+
reset();
|
|
46
|
+
},
|
|
47
|
+
getCaptchaValues: function getCaptchaValues() {
|
|
48
|
+
return getValues();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
function loadCaptcha() {
|
|
53
|
+
var _document$getElementB, _ncInstance$current2;
|
|
54
|
+
if (!ncInstance.current) {
|
|
55
|
+
/* eslint no-undef:0 */
|
|
56
|
+
/* eslint new-cap:0 */
|
|
57
|
+
ncInstance.current = new window.noCaptcha();
|
|
58
|
+
window[ncName] = ncInstance.current;
|
|
59
|
+
}
|
|
60
|
+
var nc_appkey = 'FFFF000000000179A3AD';
|
|
61
|
+
var nc_token = [nc_appkey, new Date().getTime(), Math.random()].join(':');
|
|
62
|
+
var nc_scene = scene;
|
|
63
|
+
var nc_customWidth = ((_document$getElementB = document.getElementById("captcha_render_id_".concat(ncName))) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.offsetWidth) || 300;
|
|
64
|
+
var nc_option = {
|
|
65
|
+
renderTo: "#captcha_render_id_".concat(ncName),
|
|
66
|
+
appkey: nc_appkey,
|
|
67
|
+
scene: nc_scene,
|
|
68
|
+
token: nc_token,
|
|
69
|
+
language: locale ? 'en' : 'cn',
|
|
70
|
+
customWidth: nc_customWidth,
|
|
71
|
+
callback: function callback(data) {
|
|
72
|
+
// 校验成功回调
|
|
73
|
+
var setFieldsValue = form.setFieldsValue;
|
|
74
|
+
setFieldsValue({
|
|
75
|
+
csessionid: data.csessionid,
|
|
76
|
+
sig: data.sig,
|
|
77
|
+
token: nc_token,
|
|
78
|
+
scene: nc_scene,
|
|
79
|
+
captcha: 'true'
|
|
80
|
+
});
|
|
81
|
+
onCallback === null || onCallback === void 0 || onCallback();
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
(_ncInstance$current2 = ncInstance.current) === null || _ncInstance$current2 === void 0 || _ncInstance$current2.init(nc_option);
|
|
85
|
+
var lang = {
|
|
86
|
+
_startTEXT: formatMessage({
|
|
87
|
+
id: 'login.captcha.drag'
|
|
88
|
+
}),
|
|
89
|
+
_yesTEXT: formatMessage({
|
|
90
|
+
id: 'login.captcha.success'
|
|
91
|
+
}),
|
|
92
|
+
_Loading: formatMessage({
|
|
93
|
+
id: 'login.captcha.loading'
|
|
94
|
+
}),
|
|
95
|
+
_error300: formatMessage({
|
|
96
|
+
id: 'login.captcha.error.wrong'
|
|
97
|
+
}) + ' <a href="javascript:__nc.reset()">' + formatMessage({
|
|
98
|
+
id: 'login.captcha.error.refresh'
|
|
99
|
+
}) + '</a>',
|
|
100
|
+
_errorNetwork: formatMessage({
|
|
101
|
+
id: 'login.captcha.error.network'
|
|
102
|
+
}) + ' <a href="javascript:__nc.reset()">' + formatMessage({
|
|
103
|
+
id: 'login.captcha.error.refresh'
|
|
104
|
+
}) + '</a>'
|
|
105
|
+
};
|
|
106
|
+
if (locale) {
|
|
107
|
+
var _ncInstance$current3;
|
|
108
|
+
(_ncInstance$current3 = ncInstance.current) === null || _ncInstance$current3 === void 0 || _ncInstance$current3.upLang('en', lang);
|
|
109
|
+
} else {
|
|
110
|
+
var _ncInstance$current4;
|
|
111
|
+
(_ncInstance$current4 = ncInstance.current) === null || _ncInstance$current4 === void 0 || _ncInstance$current4.upLang('cn', lang);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
useEffect(function () {
|
|
115
|
+
var script = document.createElement('script');
|
|
116
|
+
script.src = NC_SCRIPT_SOURCE;
|
|
117
|
+
var link = document.createElement('link');
|
|
118
|
+
script.async = true;
|
|
119
|
+
link.href = NC_CSS_SOURCE;
|
|
120
|
+
link.rel = 'stylesheet';
|
|
121
|
+
link.type = 'text/css';
|
|
122
|
+
|
|
123
|
+
// 如果资源没有加载过,则添加到head中
|
|
124
|
+
document.head.appendChild(link);
|
|
125
|
+
if (!window.noCaptcha) {
|
|
126
|
+
document.head.appendChild(script);
|
|
127
|
+
script.onload = function () {
|
|
128
|
+
loadCaptcha();
|
|
129
|
+
};
|
|
130
|
+
} else {
|
|
131
|
+
loadCaptcha();
|
|
132
|
+
}
|
|
133
|
+
return function () {
|
|
134
|
+
try {
|
|
135
|
+
script.remove();
|
|
136
|
+
link.remove();
|
|
137
|
+
if (script.parentNode === document.body) {
|
|
138
|
+
document.body.removeChild(script);
|
|
139
|
+
}
|
|
140
|
+
if (link.parentNode === document.body) {
|
|
141
|
+
document.body.removeChild(link);
|
|
142
|
+
}
|
|
143
|
+
} catch (e) {
|
|
144
|
+
// ignore error
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
}, []);
|
|
148
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
149
|
+
className: cls('captcha', className)
|
|
150
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
151
|
+
id: "captcha_render_id_".concat(ncName)
|
|
152
|
+
}), /*#__PURE__*/React.createElement(Form.Item, {
|
|
153
|
+
name: "csessionid",
|
|
154
|
+
noStyle: true
|
|
155
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
156
|
+
type: "hidden"
|
|
157
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
158
|
+
name: "sig",
|
|
159
|
+
noStyle: true
|
|
160
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
161
|
+
type: "hidden"
|
|
162
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
163
|
+
name: "token",
|
|
164
|
+
noStyle: true
|
|
165
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
166
|
+
type: "hidden"
|
|
167
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
168
|
+
name: "scene",
|
|
169
|
+
noStyle: true
|
|
170
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
171
|
+
type: "hidden"
|
|
172
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
173
|
+
name: "captcha",
|
|
174
|
+
rules: [{
|
|
175
|
+
required: true,
|
|
176
|
+
message: formatMessage({
|
|
177
|
+
id: 'login.captcha.required'
|
|
178
|
+
})
|
|
179
|
+
}],
|
|
180
|
+
className: "captcha-tip"
|
|
181
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
182
|
+
type: "hidden"
|
|
183
|
+
})));
|
|
184
|
+
});
|
|
185
|
+
export default Captcha;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
@primary-color: #873bf4;
|
|
2
|
+
@yuque-color-bg-primary-hover-light: #f5f5f5;
|
|
3
|
+
@yuque-color-bg-primary: #ffffff;
|
|
4
|
+
@yuque-grey-5: #bfbfbf;
|
|
5
|
+
@yuque-color-text-body: #595959;
|
|
6
|
+
@white: #ffffff;
|
|
7
|
+
@yuque-color-function-warning: #faad14;
|
|
8
|
+
@yuque-color-function-error: #ff4d4f;
|
|
9
|
+
|
|
10
|
+
.captcha {
|
|
11
|
+
margin-bottom: 16px;
|
|
12
|
+
|
|
13
|
+
.nc-lang-cnt {
|
|
14
|
+
color: #4c4c4c;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.nc-container {
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
|
|
21
|
+
.nc_wrapper,
|
|
22
|
+
#nc_1_wrapper {
|
|
23
|
+
width: 100%;
|
|
24
|
+
|
|
25
|
+
.nc_scale {
|
|
26
|
+
height: 40px;
|
|
27
|
+
background: @yuque-color-bg-primary-hover-light;
|
|
28
|
+
width: auto;
|
|
29
|
+
|
|
30
|
+
.nc_bg {
|
|
31
|
+
width: 0;
|
|
32
|
+
background-color: @yuque-color-bg-primary;
|
|
33
|
+
border: 1px solid @yuque-grey-5;
|
|
34
|
+
border-right-width: 0;
|
|
35
|
+
border-radius: 4px 0 0 4px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.scale_text {
|
|
39
|
+
color: @yuque-color-text-body;
|
|
40
|
+
font-size: 16px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.scale_text2 {
|
|
44
|
+
color: @white;
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
span {
|
|
49
|
+
border: none;
|
|
50
|
+
height: 40px;
|
|
51
|
+
line-height: 40px;
|
|
52
|
+
border-radius: 4px;
|
|
53
|
+
font-size: 14px;
|
|
54
|
+
|
|
55
|
+
&.btn_slide {
|
|
56
|
+
border: 1px solid @yuque-grey-5;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.btn_ok {
|
|
60
|
+
border: 1px solid @yuque-grey-5;
|
|
61
|
+
border-radius: 0 4px 4px 0;
|
|
62
|
+
color: #4c4c4c;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.errloading {
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 40px;
|
|
71
|
+
line-height: 22px;
|
|
72
|
+
border-radius: 4px;
|
|
73
|
+
border: 1px solid @yuque-color-function-warning;
|
|
74
|
+
|
|
75
|
+
.nc_iconfont {
|
|
76
|
+
color: @yuque-color-function-error;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
span {
|
|
80
|
+
color: @yuque-color-function-warning;
|
|
81
|
+
font-size: 14px;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.captcha-tip {
|
|
87
|
+
.ant-form-item-control-input {
|
|
88
|
+
min-height: auto;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import { useRef, useState } from 'react';
|
|
17
|
+
import { Form, Input, message } from 'antd';
|
|
18
|
+
import CountDownButton from "../CountDownButton";
|
|
19
|
+
import cls from 'classnames';
|
|
20
|
+
import Captcha from "../Captcha";
|
|
21
|
+
import { useIntl } from 'dumi';
|
|
22
|
+
import "./index.less";
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { sendValidationCode } from "../../../model/auth";
|
|
25
|
+
function CheckCode(_ref) {
|
|
26
|
+
var en = _ref.en,
|
|
27
|
+
form = _ref.form,
|
|
28
|
+
ncName = _ref.ncName,
|
|
29
|
+
scene = _ref.scene,
|
|
30
|
+
_ref$targetFieldName = _ref.targetFieldName,
|
|
31
|
+
targetFieldName = _ref$targetFieldName === void 0 ? 'login' : _ref$targetFieldName,
|
|
32
|
+
_ref$validateFailedMs = _ref.validateFailedMsg,
|
|
33
|
+
validateFailedMsg = _ref$validateFailedMs === void 0 ? 'Please enter your mobile number' : _ref$validateFailedMs,
|
|
34
|
+
handleSendCode = _ref.handleSendCode,
|
|
35
|
+
_ref$onSendCodeClick = _ref.onSendCodeClick,
|
|
36
|
+
onSendCodeClick = _ref$onSendCodeClick === void 0 ? function () {} : _ref$onSendCodeClick;
|
|
37
|
+
var _useIntl = useIntl(),
|
|
38
|
+
formatMessage = _useIntl.formatMessage,
|
|
39
|
+
locale = _useIntl.locale;
|
|
40
|
+
var _useState = useState(false),
|
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
+
sending = _useState2[0],
|
|
43
|
+
setSending = _useState2[1];
|
|
44
|
+
var captchaRef = useRef(null);
|
|
45
|
+
var inputRef = useRef(null);
|
|
46
|
+
var countDownRef = useRef(null);
|
|
47
|
+
var countDownSendText = formatMessage({
|
|
48
|
+
id: 'login.checkcode.get'
|
|
49
|
+
});
|
|
50
|
+
function handleResetCountDown() {
|
|
51
|
+
var _countDownRef$current;
|
|
52
|
+
(_countDownRef$current = countDownRef.current) === null || _countDownRef$current === void 0 || _countDownRef$current.resetCountDown();
|
|
53
|
+
}
|
|
54
|
+
function handleResetCaptcha() {
|
|
55
|
+
var _captchaRef$current;
|
|
56
|
+
(_captchaRef$current = captchaRef.current) === null || _captchaRef$current === void 0 || _captchaRef$current.resetCaptcha();
|
|
57
|
+
}
|
|
58
|
+
function onCountDownEnd() {
|
|
59
|
+
setSending(false);
|
|
60
|
+
handleResetCaptcha();
|
|
61
|
+
}
|
|
62
|
+
function sendCode(_x, _x2) {
|
|
63
|
+
return _sendCode.apply(this, arguments);
|
|
64
|
+
}
|
|
65
|
+
function _sendCode() {
|
|
66
|
+
_sendCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(target, captchaValues) {
|
|
67
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
68
|
+
while (1) switch (_context.prev = _context.next) {
|
|
69
|
+
case 0:
|
|
70
|
+
_context.prev = 0;
|
|
71
|
+
if (!handleSendCode) {
|
|
72
|
+
_context.next = 6;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
_context.next = 4;
|
|
76
|
+
return handleSendCode(target, captchaValues);
|
|
77
|
+
case 4:
|
|
78
|
+
_context.next = 8;
|
|
79
|
+
break;
|
|
80
|
+
case 6:
|
|
81
|
+
_context.next = 8;
|
|
82
|
+
return sendValidationCode(_objectSpread(_objectSpread({
|
|
83
|
+
target: target
|
|
84
|
+
}, captchaValues), {}, {
|
|
85
|
+
captcha: captchaValues.captcha ? 1 : 0
|
|
86
|
+
}));
|
|
87
|
+
case 8:
|
|
88
|
+
message.success(formatMessage({
|
|
89
|
+
id: 'login.checkcode.send.success'
|
|
90
|
+
}));
|
|
91
|
+
_context.next = 15;
|
|
92
|
+
break;
|
|
93
|
+
case 11:
|
|
94
|
+
_context.prev = 11;
|
|
95
|
+
_context.t0 = _context["catch"](0);
|
|
96
|
+
console.error(_context.t0);
|
|
97
|
+
handleResetCaptcha();
|
|
98
|
+
case 15:
|
|
99
|
+
case "end":
|
|
100
|
+
return _context.stop();
|
|
101
|
+
}
|
|
102
|
+
}, _callee, null, [[0, 11]]);
|
|
103
|
+
}));
|
|
104
|
+
return _sendCode.apply(this, arguments);
|
|
105
|
+
}
|
|
106
|
+
function onSendClick(_x3) {
|
|
107
|
+
return _onSendClick.apply(this, arguments);
|
|
108
|
+
}
|
|
109
|
+
function _onSendClick() {
|
|
110
|
+
_onSendClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(callback) {
|
|
111
|
+
var captchaValues, values, _target, params;
|
|
112
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
113
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
114
|
+
case 0:
|
|
115
|
+
if (!(!captchaRef.current || sending)) {
|
|
116
|
+
_context2.next = 2;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
return _context2.abrupt("return");
|
|
120
|
+
case 2:
|
|
121
|
+
captchaValues = captchaRef.current.getCaptchaValues();
|
|
122
|
+
if (captchaValues.captcha) {
|
|
123
|
+
_context2.next = 9;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
handleResetCountDown();
|
|
127
|
+
message.error(formatMessage({
|
|
128
|
+
id: 'login.checkcode.error.incomplete'
|
|
129
|
+
}));
|
|
130
|
+
form.setFields([{
|
|
131
|
+
name: 'captcha',
|
|
132
|
+
errors: [formatMessage({
|
|
133
|
+
id: 'login.checkcode.error.incomplete'
|
|
134
|
+
})]
|
|
135
|
+
}]);
|
|
136
|
+
// 尝试解决滑块显示完成,但提示没有完成的问题
|
|
137
|
+
handleResetCaptcha();
|
|
138
|
+
return _context2.abrupt("return");
|
|
139
|
+
case 9:
|
|
140
|
+
_context2.prev = 9;
|
|
141
|
+
_context2.next = 12;
|
|
142
|
+
return form.validateFields([targetFieldName]);
|
|
143
|
+
case 12:
|
|
144
|
+
values = _context2.sent;
|
|
145
|
+
_target = values[targetFieldName];
|
|
146
|
+
if (_target) {
|
|
147
|
+
_context2.next = 17;
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
form.setFields([{
|
|
151
|
+
name: targetFieldName,
|
|
152
|
+
errors: [validateFailedMsg]
|
|
153
|
+
}]);
|
|
154
|
+
return _context2.abrupt("return");
|
|
155
|
+
case 17:
|
|
156
|
+
params = _objectSpread(_objectSpread({}, captchaValues), {}, {
|
|
157
|
+
lang: locale
|
|
158
|
+
});
|
|
159
|
+
_context2.next = 20;
|
|
160
|
+
return sendCode(_target, params);
|
|
161
|
+
case 20:
|
|
162
|
+
callback === null || callback === void 0 || callback();
|
|
163
|
+
onSendCodeClick === null || onSendCodeClick === void 0 || onSendCodeClick();
|
|
164
|
+
_context2.next = 28;
|
|
165
|
+
break;
|
|
166
|
+
case 24:
|
|
167
|
+
_context2.prev = 24;
|
|
168
|
+
_context2.t0 = _context2["catch"](9);
|
|
169
|
+
handleResetCaptcha();
|
|
170
|
+
form.setFields([{
|
|
171
|
+
name: targetFieldName,
|
|
172
|
+
errors: [validateFailedMsg]
|
|
173
|
+
}]);
|
|
174
|
+
case 28:
|
|
175
|
+
case "end":
|
|
176
|
+
return _context2.stop();
|
|
177
|
+
}
|
|
178
|
+
}, _callee2, null, [[9, 24]]);
|
|
179
|
+
}));
|
|
180
|
+
return _onSendClick.apply(this, arguments);
|
|
181
|
+
}
|
|
182
|
+
var getFieldError = form.getFieldError;
|
|
183
|
+
function renderHint() {
|
|
184
|
+
// 重置密码时显示短信发送情况提醒
|
|
185
|
+
if (sending) {
|
|
186
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
187
|
+
className: "mobile-code-hint"
|
|
188
|
+
}, /*#__PURE__*/React.createElement("span", null, formatMessage({
|
|
189
|
+
id: 'login.checkcode.sent'
|
|
190
|
+
})));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
194
|
+
className: cls('mobile-code', 'captcha-check-code')
|
|
195
|
+
}, /*#__PURE__*/React.createElement(Captcha, {
|
|
196
|
+
form: form,
|
|
197
|
+
scene: scene,
|
|
198
|
+
ncName: ncName,
|
|
199
|
+
ref: captchaRef,
|
|
200
|
+
en: en
|
|
201
|
+
}), /*#__PURE__*/React.createElement(Form.Item, {
|
|
202
|
+
className: "mobile-code-showtip",
|
|
203
|
+
help: getFieldError('code') ? getFieldError('code') : renderHint()
|
|
204
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
205
|
+
className: "mobile-code-main"
|
|
206
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
207
|
+
className: "mobile-code-field"
|
|
208
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
209
|
+
name: "code",
|
|
210
|
+
validateTrigger: ['onSubmit', 'onBlur'],
|
|
211
|
+
rules: [{
|
|
212
|
+
required: true,
|
|
213
|
+
message: formatMessage({
|
|
214
|
+
id: 'login.checkcode.required'
|
|
215
|
+
})
|
|
216
|
+
}, {
|
|
217
|
+
pattern: /^\d{6}$/,
|
|
218
|
+
message: formatMessage({
|
|
219
|
+
id: 'login.checkcode.invalid'
|
|
220
|
+
})
|
|
221
|
+
}]
|
|
222
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
223
|
+
type: "text",
|
|
224
|
+
autoComplete: "off",
|
|
225
|
+
ref: inputRef,
|
|
226
|
+
placeholder: formatMessage({
|
|
227
|
+
id: 'login.checkcode.placeholder'
|
|
228
|
+
}),
|
|
229
|
+
maxLength: 6
|
|
230
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
231
|
+
className: "mobile-code-getBtn"
|
|
232
|
+
}, /*#__PURE__*/React.createElement(CountDownButton, {
|
|
233
|
+
en: en,
|
|
234
|
+
onSendClick: onSendClick,
|
|
235
|
+
ref: countDownRef,
|
|
236
|
+
buttonProps: {
|
|
237
|
+
ghost: true,
|
|
238
|
+
htmlType: 'button'
|
|
239
|
+
},
|
|
240
|
+
sendText: countDownSendText,
|
|
241
|
+
onCountDownEnd: onCountDownEnd
|
|
242
|
+
})))));
|
|
243
|
+
}
|
|
244
|
+
export default CheckCode;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
@primary-color: #873bf4;
|
|
2
|
+
@yuque-color-text-caption: #8c8c8c;
|
|
3
|
+
@yuque-color-text-body: #595959;
|
|
4
|
+
@yuque-grey-5: #bfbfbf;
|
|
5
|
+
@yuque-color-bg-tertiary: #fafafa;
|
|
6
|
+
@color-1: #bfbfbf;
|
|
7
|
+
@color: #873bf4;
|
|
8
|
+
@yuque-color-bg-primary-hover-light: #f5f5f5;
|
|
9
|
+
@yuque-color-text-link: #873bf4;
|
|
10
|
+
|
|
11
|
+
.form-pro .mobile-code .ant-legacy-form-explain {
|
|
12
|
+
margin-top: 8px;
|
|
13
|
+
text-align: left;
|
|
14
|
+
padding-right: 120px;
|
|
15
|
+
margin-bottom: 18px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.verify-modal .mobile-code .ant-legacy-form-explain {
|
|
19
|
+
margin-top: 8px;
|
|
20
|
+
text-align: left;
|
|
21
|
+
padding-right: 120px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.captcha-check-code {
|
|
25
|
+
margin-bottom: 22px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.ant-modal-body .mobile-code .ant-legacy-form-explain {
|
|
29
|
+
margin-top: 8px;
|
|
30
|
+
text-align: left;
|
|
31
|
+
padding-right: 120px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.verify-modal .mobile-code .mobile-code-showtip {
|
|
35
|
+
margin-bottom: 8px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.lark-form .mobile-code .ant-legacy-form-item {
|
|
39
|
+
margin-bottom: 8px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.mobile-code {
|
|
43
|
+
position: relative;
|
|
44
|
+
min-height: 72px;
|
|
45
|
+
|
|
46
|
+
.mobile-code-hint {
|
|
47
|
+
color: @yuque-color-text-caption;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&-pwd-link {
|
|
51
|
+
height: 22px;
|
|
52
|
+
padding-top: 1px;
|
|
53
|
+
text-align: left;
|
|
54
|
+
color: @yuque-color-text-body;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
line-height: 1.5;
|
|
57
|
+
margin-right: 200px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&-showtip {
|
|
61
|
+
margin-bottom: 4px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&-main {
|
|
65
|
+
height: 40px;
|
|
66
|
+
display: flex;
|
|
67
|
+
|
|
68
|
+
.mobile-code-field {
|
|
69
|
+
flex: 1;
|
|
70
|
+
margin-bottom: 8px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.mobile-code-getBtn {
|
|
74
|
+
position: relative;
|
|
75
|
+
min-width: 118px;
|
|
76
|
+
margin-left: 14px;
|
|
77
|
+
|
|
78
|
+
.countdown-btn {
|
|
79
|
+
.code-send-button {
|
|
80
|
+
border: 1px solid @yuque-grey-5;
|
|
81
|
+
font-size: 14px;
|
|
82
|
+
letter-spacing: 0;
|
|
83
|
+
width: 100%;
|
|
84
|
+
height: 100%;
|
|
85
|
+
|
|
86
|
+
&:disabled {
|
|
87
|
+
background-color: @yuque-color-bg-tertiary;
|
|
88
|
+
|
|
89
|
+
.code-send-text {
|
|
90
|
+
.code-send-text {
|
|
91
|
+
color: @color-1;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.code-send-text {
|
|
99
|
+
color: @color;
|
|
100
|
+
font-weight: 500;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.mobile-code-pwd-link {
|
|
106
|
+
line-height: 10px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&-tip {
|
|
110
|
+
color: @yuque-color-text-caption;
|
|
111
|
+
text-align: left;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&-swith-channel {
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
color: @yuque-color-text-body;
|
|
117
|
+
padding-top: 8px;
|
|
118
|
+
padding-left: 12px;
|
|
119
|
+
line-height: 1.7;
|
|
120
|
+
|
|
121
|
+
&-highlight {
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
color: @yuque-color-text-link;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
input {
|
|
128
|
+
appearance: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.captcha .nc-container .nc_wrapper .nc_scale,
|
|
132
|
+
.captcha .nc-container #nc_1_wrapper .nc_scale {
|
|
133
|
+
height: 40px;
|
|
134
|
+
background: @yuque-color-bg-primary-hover-light;
|
|
135
|
+
width: auto;
|
|
136
|
+
}
|
|
137
|
+
}
|