mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
fix: 修改初始化错误返回 (#873)
This commit is contained in:
parent
f4f83283d3
commit
3ac64d65b6
@ -1,11 +1,11 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/backend/app/dto"
|
||||
"github.com/1Panel-dev/1Panel/backend/buserr"
|
||||
"github.com/1Panel-dev/1Panel/backend/constant"
|
||||
"github.com/1Panel-dev/1Panel/backend/global"
|
||||
"github.com/1Panel-dev/1Panel/backend/utils/encrypt"
|
||||
@ -191,5 +191,5 @@ func (u *AuthService) InitUser(c *gin.Context, req dto.InitUser) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
return fmt.Errorf("can't init user because user %s is in system", user.Value)
|
||||
return buserr.New(constant.ErrInitUser)
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ var (
|
||||
ErrTypeNotSafety = "ErrNotSafety"
|
||||
ErrNameIsExist = "ErrNameIsExist"
|
||||
ErrDemoEnvironment = "ErrDemoEnvironment"
|
||||
ErrInitUser = "ErrInitUser"
|
||||
)
|
||||
|
||||
// app
|
||||
|
@ -17,6 +17,7 @@ ErrRepoNotValid: "Remote repository verification failed!"
|
||||
ErrNameIsExist: "Name is already exist"
|
||||
ErrDemoEnvironment: "Demo server, prohibit this operation!"
|
||||
ErrCmdTimeout: "Command execution timed out!"
|
||||
ErrInitUser: "The user initialization has been completed by the system. Please do not repeat the operation!"
|
||||
|
||||
#app
|
||||
ErrPortInUsed: "{{ .detail }} port already in use"
|
||||
|
@ -17,6 +17,7 @@ ErrRepoNotValid: "远程仓库校验失败!"
|
||||
ErrNameIsExist: "名称已存在"
|
||||
ErrDemoEnvironment: "演示服务器,禁止此操作!"
|
||||
ErrCmdTimeout: "命令执行超时!"
|
||||
ErrInitUser: "系统已完成用户初始化,请勿重复操作!"
|
||||
|
||||
#app
|
||||
ErrPortInUsed: "{{ .detail }} 端口已被占用!"
|
||||
|
Loading…
x
Reference in New Issue
Block a user