关于login重构
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user