This is an automated email from the ASF dual-hosted git repository.
juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new c613573 fix(username_regex): cp consumer name regx different with dp
(#2232)
c613573 is described below
commit c613573e61957d439d1f7edd1cfc77d295de0f76
Author: Yu.Bozhong <[email protected]>
AuthorDate: Fri Dec 3 13:19:32 2021 +0800
fix(username_regex): cp consumer name regx different with dp (#2232)
Co-authored-by: okaybase <[email protected]>
---
web/src/pages/Consumer/components/Step1.tsx | 2 +-
web/src/pages/Consumer/locales/en-US.ts | 2 +-
web/src/pages/Consumer/locales/zh-CN.ts | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/web/src/pages/Consumer/components/Step1.tsx
b/web/src/pages/Consumer/components/Step1.tsx
index ce23093..093e703 100644
--- a/web/src/pages/Consumer/components/Step1.tsx
+++ b/web/src/pages/Consumer/components/Step1.tsx
@@ -43,7 +43,7 @@ const Step1: React.FC<Props> = ({ form, disabled }) => {
rules={[
{ required: true },
{
- pattern: new RegExp(/^[a-zA-Z][a-zA-Z0-9_]{0,100}$/, 'g'),
+ pattern: new RegExp(/^[a-zA-Z0-9_]+$/, 'g'),
message: formatMessage({ id:
'page.consumer.form.itemRuleMessage.username' }),
},
]}
diff --git a/web/src/pages/Consumer/locales/en-US.ts
b/web/src/pages/Consumer/locales/en-US.ts
index 86836b7..9d353c5 100644
--- a/web/src/pages/Consumer/locales/en-US.ts
+++ b/web/src/pages/Consumer/locales/en-US.ts
@@ -16,7 +16,7 @@
*/
export default {
'page.consumer.form.itemRuleMessage.username':
- 'Maximum length is 100, only letters, numbers and _ are supported, and can
only begin with letters',
+ 'Maximum length is 100, only letters, numbers and _ are supported.',
'page.consumer.form.itemExtraMessage.username': 'Name should be unique',
'page.consumer.notification.warning.enableAuthenticationPlugin':
'Please enable at least one of the following authentication plugin:',
diff --git a/web/src/pages/Consumer/locales/zh-CN.ts
b/web/src/pages/Consumer/locales/zh-CN.ts
index 5ab9398..1866133 100644
--- a/web/src/pages/Consumer/locales/zh-CN.ts
+++ b/web/src/pages/Consumer/locales/zh-CN.ts
@@ -16,7 +16,7 @@
*/
export default {
'page.consumer.form.itemRuleMessage.username':
- '最大长度100,仅支持字母、数字和 _ ,且只能以字母开头',
+ '最大长度100,仅支持字母、数字和 _ 。',
'page.consumer.form.itemExtraMessage.username': '名称需唯一',
'page.consumer.notification.warning.enableAuthenticationPlugin':
'请至少启用如下一种认证类插件:',
'page.consumer.username': '名称',