关于login重构

This commit is contained in:
2025-03-21 20:41:01 +08:00
parent 0179fe73a3
commit 8053a3db64
28 changed files with 889 additions and 596 deletions

View File

@@ -15,8 +15,9 @@ export const validateDirectory = (directory?: string) => {
};
}
// 把directory的/替换掉后,只能包含数字、字母、下划线、中划线
// 可以包含.
let _directory = directory?.replace(/\//g, '');
if (_directory && !/^[a-zA-Z0-9_-]+$/.test(_directory)) {
if (_directory && !/^[a-zA-Z0-9_.-]+$/.test(_directory)) {
return {
code: 500,
message: 'directory is invalid, only number, letter, underline and hyphen are allowed',