mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-11-06 08:05:22 +00:00
fix: update community edition auth defaults (#12828)
This commit is contained in:
@@ -4,7 +4,7 @@ base:
|
||||
is_demo: false
|
||||
is_offline: false
|
||||
is_fxplay: false
|
||||
is_enterprise: true
|
||||
is_enterprise: false
|
||||
|
||||
log:
|
||||
level: debug
|
||||
|
||||
@@ -250,6 +250,9 @@ func GetCurrentUserInfo() (*dto.CurrentUserInfo, error) {
|
||||
info.MFAInterval, _ = strconv.Atoi(settingMap["MFAInterval"])
|
||||
info.ApiKeyValidityTime, _ = strconv.Atoi(settingMap["ApiKeyValidityTime"])
|
||||
info.Name = settingMap["UserName"]
|
||||
info.Role = "ADMIN"
|
||||
info.Permissions = []string{}
|
||||
info.NodeRoles = []dto.CurrentUserNodeRole{}
|
||||
return &info, nil
|
||||
}
|
||||
func UpdateCurrentUserInfo(c *gin.Context, req dto.CurrentUserUpdate) error {
|
||||
|
||||
@@ -73,7 +73,19 @@ type CurrentUserInfo struct {
|
||||
ApiKey string `json:"apiKey"`
|
||||
IpWhiteList string `json:"ipWhiteList"`
|
||||
ApiKeyValidityTime int `json:"apiKeyValidityTime"`
|
||||
|
||||
Role string `json:"role"`
|
||||
Permissions []string `json:"permissions"`
|
||||
NodeRoles []CurrentUserNodeRole `json:"nodeRoles"`
|
||||
}
|
||||
|
||||
type CurrentUserNodeRole struct {
|
||||
NodeID uint `json:"nodeId"`
|
||||
NodeName string `json:"nodeName"`
|
||||
RoleID uint `json:"roleId"`
|
||||
RoleName string `json:"roleName"`
|
||||
}
|
||||
|
||||
type CurrentUserUpdate struct {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Password string `json:"password"`
|
||||
|
||||
@@ -4,7 +4,7 @@ base:
|
||||
is_demo: false
|
||||
is_offline: false
|
||||
is_fxplay: false
|
||||
is_enterprise: true
|
||||
is_enterprise: false
|
||||
port: 9999
|
||||
username: admin
|
||||
password: admin123
|
||||
@@ -15,4 +15,4 @@ log:
|
||||
time_zone: Asia/Shanghai
|
||||
log_name: 1Panel-Core
|
||||
log_suffix: .log
|
||||
max_backup: 10
|
||||
max_backup: 10
|
||||
|
||||
Reference in New Issue
Block a user