-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mis): 在管理系统修改用户密码时配置的正则不生效 (#1253)
**背景** 使用`typebox`时会沿用之前的特殊注释以优化为可进行后端校验 这使原本在`@pattern`下注释的正则规则被执行进代码 导致`common.yml`中即使更改了配置,在页面也可以正常显示,但是无法通过接口参数校验 ` passwordPattern`是可配置的,原本在mis-web下的`@pattern`注释应理解为默认值而不是真正的校验值 此PR进一步检查了typebox相关属性定义是否与原有代码含义一致,优化了平台管理/租户管理下修改密码时对密码`@pattern`注释的描述,删除了`typebox`中关于`pattern`的属性定义 其他关于正则的typebox转换因为后端也没有做特殊的`@pattern`的注释没有上述问题 同时追加了管理系统下 平台管理和租户管理对用户密码修改的后端校验 ai 系统下 个人信息的密码修改后端校验 **修复前** ``` common.yml passwordPattern: # 正则表达式。下面为默认值 regex: ^(?=.*[a-zA-Z])(?=.*[`~!@#\$%^&*()_+\-[\];',./{}|:"<>?]).{8,}$ # 出错时的消息。下面为默认值 errorMessage: 必须包含数字和符号,长度大于等于8位 ``` 页面显示正常 ![image](https://github.com/PKUHPC/SCOW/assets/43978285/a0eb580d-3d88-4ea9-8c98-e31c80ec6ab4) 但是接口请求参数校验失败,提示正则不满足包含数字 ![image](https://github.com/PKUHPC/SCOW/assets/43978285/7ff9f87e-d75c-4810-a7ac-8475b8550eb8) **修复后** 可正常在管理系统下的平台管理/租户管理/ai的个人信息下按配置的passwordPattern的正则修改用户密码 后端校验失败是提示错误信息 //TODO auth服务中校验?
- Loading branch information
Showing
11 changed files
with
81 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@scow/mis-web": patch | ||
"@scow/config": patch | ||
--- | ||
|
||
修复在 common.yml 中自定义更改用户密码正则后在管理系统不生效的问题, | ||
增加平台管理和租户管理下修改用户密码的后端校验 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@scow/ai": patch | ||
--- | ||
|
||
增加 ai 系统下个人信息中修改密码的后端校验 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters