Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
583d7297
authored
Jul 24, 2026
by
light5980
Committed by
GitHub
Jul 24, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(certification): remove bank account length verification (#7369)
parent
146ade2d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
13 deletions
+16
-13
packages/global/openapi/support/user/team/enterpriseAuth/api.ts
+1
-1
packages/global/support/user/team/enterpriseAuth/utils.ts
+2
-2
packages/global/test/openapi/support/user/team/enterpriseAuth/api.test.ts
+6
-4
pro
+1
-1
projects/app/test/pageComponents/account/team/EnterpriseAuth/shared.test.ts
+6
-5
No files found.
packages/global/openapi/support/user/team/enterpriseAuth/api.ts
View file @
583d7297
...
@@ -91,7 +91,7 @@ const BankAccountSchema = EnterpriseAuthRequiredStringSchema.transform((account)
...
@@ -91,7 +91,7 @@ const BankAccountSchema = EnterpriseAuthRequiredStringSchema.transform((account)
)
)
.
pipe
(
z
.
string
().
refine
(
isBankAccount
))
.
pipe
(
z
.
string
().
refine
(
isBankAccount
))
.
meta
({
.
meta
({
description
:
'企业银行账号,
15-19 位
数字,可输入空格分隔'
,
description
:
'企业银行账号,
仅支持
数字,可输入空格分隔'
,
example
:
'4111111111111111'
example
:
'4111111111111111'
});
});
const
UnifiedCreditCodeSchema
=
EnterpriseAuthRequiredStringSchema
.
transform
((
code
)
=>
const
UnifiedCreditCodeSchema
=
EnterpriseAuthRequiredStringSchema
.
transform
((
code
)
=>
...
...
packages/global/support/user/team/enterpriseAuth/utils.ts
View file @
583d7297
const
UnifiedCreditCodeChars
=
'0123456789ABCDEFGHJKLMNPQRTUWXY'
;
const
UnifiedCreditCodeChars
=
'0123456789ABCDEFGHJKLMNPQRTUWXY'
;
const
UnifiedCreditCodeWeights
=
[
1
,
3
,
9
,
27
,
19
,
26
,
16
,
17
,
20
,
29
,
25
,
13
,
8
,
24
,
10
,
30
,
28
];
const
UnifiedCreditCodeWeights
=
[
1
,
3
,
9
,
27
,
19
,
26
,
16
,
17
,
20
,
29
,
25
,
13
,
8
,
24
,
10
,
30
,
28
];
const
UnifiedCreditCodePattern
=
/^
[
0-9A-HJ-NP-RTUWXY
]{18}
$/
;
const
UnifiedCreditCodePattern
=
/^
[
0-9A-HJ-NP-RTUWXY
]{18}
$/
;
const
BankAccountPattern
=
/^
\d
{15,19}
$/
;
const
BankAccountPattern
=
/^
\d
+
$/
;
export
const
normalizeUnifiedCreditCode
=
(
code
:
string
)
=>
code
.
trim
().
toUpperCase
();
export
const
normalizeUnifiedCreditCode
=
(
code
:
string
)
=>
code
.
trim
().
toUpperCase
();
...
@@ -29,7 +29,7 @@ export const isUnifiedCreditCode = (code: string) => {
...
@@ -29,7 +29,7 @@ export const isUnifiedCreditCode = (code: string) => {
};
};
/**
/**
* 校验企业银行账号:去除空格后需为
15-19 位数字
。
* 校验企业银行账号:去除空格后需为
纯数字,不限制账号长度
。
*/
*/
export
const
isBankAccount
=
(
account
:
string
)
=>
{
export
const
isBankAccount
=
(
account
:
string
)
=>
{
const
normalizedAccount
=
normalizeBankAccount
(
account
);
const
normalizedAccount
=
normalizeBankAccount
(
account
);
...
...
packages/global/test/openapi/support/user/team/enterpriseAuth/api.test.ts
View file @
583d7297
...
@@ -59,16 +59,18 @@ describe('StartEnterpriseAuthBodySchema', () => {
...
@@ -59,16 +59,18 @@ describe('StartEnterpriseAuthBodySchema', () => {
).
toBe
(
false
);
).
toBe
(
false
);
});
});
it
(
'银行账号
需为 15-19 位数字
,并在入参解析时去除空格'
,
()
=>
{
it
(
'银行账号
不限制长度
,并在入参解析时去除空格'
,
()
=>
{
expect
(
StartEnterpriseAuthBodySchema
.
parse
(
validBody
).
bankAccount
).
toBe
(
'4111111111111111'
);
expect
(
StartEnterpriseAuthBodySchema
.
parse
(
validBody
).
bankAccount
).
toBe
(
'4111111111111111'
);
[
'1'
,
'1'
.
repeat
(
32
)].
forEach
((
bankAccount
)
=>
{
expect
(
expect
(
StartEnterpriseAuthBodySchema
.
parse
({
StartEnterpriseAuthBodySchema
.
parse
({
...
validBody
,
...
validBody
,
bankAccount
:
'571919104910201'
bankAccount
}).
bankAccount
}).
bankAccount
).
toBe
(
'571919104910201'
);
).
toBe
(
bankAccount
);
});
[
'
4111-1111-1111-1111'
,
'1'
.
repeat
(
14
),
'1'
.
repeat
(
20
)
].
forEach
((
bankAccount
)
=>
{
[
'
'
,
' '
,
'4111-1111-1111-1111'
].
forEach
((
bankAccount
)
=>
{
expect
(
expect
(
StartEnterpriseAuthBodySchema
.
safeParse
({
StartEnterpriseAuthBodySchema
.
safeParse
({
...
validBody
,
...
validBody
,
...
...
pro
@
d0cdce9e
Subproject commit
ce171ee3520e72f63bba30aba343ffc7e0b51e65
Subproject commit
d0cdce9e0de80af2ef697526da4958b6882a791f
projects/app/test/pageComponents/account/team/EnterpriseAuth/shared.test.ts
View file @
583d7297
...
@@ -8,16 +8,17 @@ import {
...
@@ -8,16 +8,17 @@ import {
}
from
'../../../../../src/pageComponents/account/team/EnterpriseAuth/shared'
;
}
from
'../../../../../src/pageComponents/account/team/EnterpriseAuth/shared'
;
describe
(
'enterprise auth bank account validation'
,
()
=>
{
describe
(
'enterprise auth bank account validation'
,
()
=>
{
it
(
'去除空格后校验
15-19 位数字银行账号
'
,
()
=>
{
it
(
'去除空格后校验
纯数字银行账号,不限制长度
'
,
()
=>
{
expect
(
normalizeBankAccount
(
' 4111 1111 1111 1111 '
)).
toBe
(
'4111111111111111'
);
expect
(
normalizeBankAccount
(
' 4111 1111 1111 1111 '
)).
toBe
(
'4111111111111111'
);
expect
(
fieldRules
.
bankAccount
.
validate
(
'4111 1111 1111 1111'
)).
toBe
(
true
);
expect
(
fieldRules
.
bankAccount
.
validate
(
'4111 1111 1111 1111'
)).
toBe
(
true
);
expect
(
fieldRules
.
bankAccount
.
validate
(
'571919104910201'
)).
toBe
(
true
);
expect
(
fieldRules
.
bankAccount
.
validate
(
'1'
)).
toBe
(
true
);
expect
(
fieldRules
.
bankAccount
.
validate
(
'1'
.
repeat
(
32
))).
toBe
(
true
);
});
});
it
(
'银行账号包含非数字或长度不符时校验失败'
,
()
=>
{
it
(
'银行账号为空或包含非数字时校验失败'
,
()
=>
{
expect
(
fieldRules
.
bankAccount
.
validate
(
''
)).
toBe
(
false
);
expect
(
fieldRules
.
bankAccount
.
validate
(
' '
)).
toBe
(
false
);
expect
(
fieldRules
.
bankAccount
.
validate
(
'4111-1111-1111-1111'
)).
toBe
(
false
);
expect
(
fieldRules
.
bankAccount
.
validate
(
'4111-1111-1111-1111'
)).
toBe
(
false
);
expect
(
fieldRules
.
bankAccount
.
validate
(
'1'
.
repeat
(
14
))).
toBe
(
false
);
expect
(
fieldRules
.
bankAccount
.
validate
(
'1'
.
repeat
(
20
))).
toBe
(
false
);
});
});
it
(
'统一社会信用代码按 GB 32100-2015 校验第 18 位'
,
()
=>
{
it
(
'统一社会信用代码按 GB 32100-2015 校验第 18 位'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment