-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### 做了什么 在`common.yml`中增加可选配置项`systemLanguage` ``` # 设置系统语言 可选配置 类型为对象或字符串,默认值为对象类型 # 1.systemLanguage对象类型 # systemLanguage: # # 可选,默认为true。 # # 如果true,则SCOW在用户未手动选择语言时,自动header判断语言,如判断失败使用default语言 # # 如果为false,则SCOW首次进入系统时使用下方配置的default语言 # autoDetectWhenUserNotSet: true # # 默认语言,默认为"zh_cn" # # 类型必须为当前系统合法语言["zh_cn","en"]的字符串枚举值 # default: "zh_cn" # 2.systemLanguage字符串类型 # 若systemLanguage配置为字符串,类型必须指定为当前系统合法语言["zh_cn","en"]的字符串枚举值 # SCOW直接使用此语言,不允许用户再进行语言切换 # systemLanguage: "zh_cn" ``` 1.当配置为字符串类型时 `systemLanguage: "zh_cn"` 隐藏语言切换器,进入系统后设置语言cookie为“zh_cn”不再变更,系统一直使用中文显示 2.当配置为对象类型 ``` systemLanguage: autoDetectWhenUserNotSet: false default: "zh_cn" ``` 显示语言切换器。如果用户手动选择了语言,则一直使用用户选择的语言。否则,当用户没有选择过自己的语言时,语言为配置的"zh_cn" 3.当不配置或配置为对象类型 ``` systemLanguage: autoDetectWhenUserNotSet: true 或不配置此项时 default: "zh_cn" ``` 显示语言切换器,如果用户手动选择了语言,则一直使用用户选择的语言。否则,当用户没有选择过自己的语言时,SCOW根据用户的accept-language header判断用户浏览器或者系统所使用的语言。如果判断出来为SCOW支持的语言,则使用此语言,否则,使用配置的default语言"zh_cn" **systemLanguage为对象,或systemLanguage为字符串时,配置的语言不在系统合法语言列表的枚举值中时,系统报错,无法启动** ![image](https://github.com/PKUHPC/SCOW/assets/43978285/3d23c593-1316-454d-99ea-b311c170663a)
- Loading branch information
Showing
74 changed files
with
682 additions
and
334 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,6 @@ | ||
--- | ||
"@scow/config": minor | ||
"@scow/cli": minor | ||
--- | ||
|
||
在 common.yml 中增加可选配置项 systemLanguage,指定的语言必须为系统当前合法语言["zh_cn", "en"]的枚举值,允许用户指定系统唯一语言不再进行语言切换,或允许用户指定进入 SCOW 时的默认语言 |
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,9 @@ | ||
--- | ||
"@scow/portal-web": minor | ||
"@scow/mis-web": minor | ||
"@scow/lib-server": minor | ||
"@scow/auth": minor | ||
"@scow/lib-web": minor | ||
--- | ||
|
||
增加用户指定系统语言功能,可以指定系统唯一语言不再进行语言切换,也可以指定进入 SCOW 时的默认初始语言 |
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,26 @@ | ||
# 创建用户、修改密码时,密码的规则。必须设置 | ||
passwordPattern: | ||
# 正则表达式。下面为默认值 | ||
regex: ^(?=.*\d)(?=.*[a-zA-Z])(?=.*[`~!@#\$%^&*()_+\-[\];',./{}|:"<>?]).{8,}$ | ||
|
||
# 出错时的消息。下面为默认值 | ||
errorMessage: 必须包含字母、数字和符号,长度大于等于8位 | ||
|
||
|
||
# 设置系统语言 可选配置 类型为对象或字符串,默认值为对象类型 | ||
# 1.systemLanguage对象类型 | ||
# systemLanguage: | ||
# # 可选,默认为true。 | ||
# # 如果true,则SCOW在用户未手动选择语言时,自动优先根据cookies, 其次根据浏览器header判断语言,判断失败使用下方配置的default语言。 | ||
# # 如果为false,则SCOW在首次进入系统用户未手动选择语言时使用下方配置的default语言, | ||
# # 用户手动选择过语言之后优先从cookies中进行判断,cookies不存在合法语言信息则使用下方配置的默认语言。 | ||
# autoDetectWhenUserNotSet: true | ||
# # 默认语言,选填。 | ||
# # 类型必须为当前系统合法语言["zh_cn","en"]的字符串枚举值 | ||
# # 若没有配置,则默认为"zh_cn" | ||
# default: "zh_cn" | ||
|
||
# 2.systemLanguage字符串类型 | ||
# 若systemLanguage配置为字符串,类型必须指定为当前系统合法语言["zh_cn","en"]的字符串枚举值 | ||
# SCOW直接使用此语言,不允许用户再进行语言切换 | ||
# systemLanguage: "zh_cn" |
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
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
Oops, something went wrong.