Русифицировать README и интерфейс HY2XS admin
This commit is contained in:
@@ -209,7 +209,7 @@ func GetAccountInfo(c *gin.Context) {
|
||||
vo.Fail(err.Error(), c)
|
||||
return
|
||||
}
|
||||
// 更新最近登录时间
|
||||
// Обновление времени последнего входа
|
||||
now := time.Now().UnixMilli()
|
||||
if err = service.UpdateAccount(entity.Account{
|
||||
BaseEntity: entity.BaseEntity{Id: &accountInfoVo.Id},
|
||||
@@ -255,12 +255,12 @@ func ImportAccount(c *gin.Context) {
|
||||
vo.Fail(constant.SysError, c)
|
||||
return
|
||||
}
|
||||
// 文件大小 2MB
|
||||
// Размер файла 2 MB
|
||||
if header.Size > 1024*1024*2 {
|
||||
vo.Fail("the file is too big", c)
|
||||
return
|
||||
}
|
||||
// 文件后缀.json
|
||||
// Расширение файла .json
|
||||
if !strings.HasSuffix(header.Filename, ".json") {
|
||||
vo.Fail("file format not supported", c)
|
||||
return
|
||||
@@ -297,7 +297,7 @@ func ExportAccount(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// 下载
|
||||
// Скачивание
|
||||
if !util.Exists(filePath) {
|
||||
vo.Fail("file not exist", c)
|
||||
return
|
||||
@@ -333,3 +333,4 @@ func VerifyDefaultPass(c *gin.Context) {
|
||||
}
|
||||
vo.Success(account.Pass != nil && *account.Pass == "02f382b76ca1ab7aa06ab03345c7712fd5b971fb0c0f2aef98bac9cd", c)
|
||||
}
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ func ExportHysteria2Config(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// 默认值
|
||||
// Значения по умолчанию
|
||||
config, err := dao.ListConfig("key in ?", []string{constant.HUIWebPort, constant.JwtSecret})
|
||||
if err != nil {
|
||||
vo.Fail(err.Error(), c)
|
||||
@@ -324,7 +324,7 @@ func ImportHysteria2Config(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// 默认值
|
||||
// Значения по умолчанию
|
||||
config, err := dao.ListConfig("key in ?", []string{constant.HUIWebPort, constant.JwtSecret})
|
||||
if err != nil {
|
||||
vo.Fail(err.Error(), c)
|
||||
@@ -501,3 +501,4 @@ func UploadCertFile(c *gin.Context) {
|
||||
}
|
||||
vo.Success(certPath, c)
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ func Hysteria2Auth(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// 更新最近连接时间
|
||||
// Обновление времени последнего подключения
|
||||
now := time.Now().UnixMilli()
|
||||
if err = service.UpdateAccount(entity.Account{
|
||||
BaseEntity: entity.BaseEntity{Id: &id},
|
||||
@@ -69,7 +69,7 @@ func Hysteria2Url(c *gin.Context) {
|
||||
vo.Fail(err.Error(), c)
|
||||
return
|
||||
}
|
||||
// 生成二维码
|
||||
// Генерация QR-кода
|
||||
qrCode, err := qrcode.Encode(url, qrcode.Medium, 300)
|
||||
if err != nil {
|
||||
vo.Fail(err.Error(), c)
|
||||
@@ -150,3 +150,4 @@ func Hysteria2Subscribe(c *gin.Context) {
|
||||
|
||||
c.String(200, configStr)
|
||||
}
|
||||
|
||||
|
||||
@@ -114,3 +114,4 @@ func ExportLog(c *gin.Context) {
|
||||
c.Header("Content-Disposition", fmt.Sprintf("attachment; filename=%s", fileName))
|
||||
c.File(filePath)
|
||||
}
|
||||
|
||||
|
||||
@@ -23,3 +23,4 @@ func MonitorHysteria2(c *gin.Context) {
|
||||
}
|
||||
vo.Success(hysteria2MonitorVo, c)
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ func init() {
|
||||
|
||||
func validateStr(f validator.FieldLevel) bool {
|
||||
field := f.Field().String()
|
||||
// 字符串必须6-32位是字母或者数字或部分特殊字符的组合
|
||||
// Строка должна быть длиной 6-32 символа и состоять из букв, цифр или разрешённых спецсимволов
|
||||
reg := "^[a-zA-Z0-9!@#$%^&*()_+-=]{6,32}$"
|
||||
compile := regexp.MustCompile(reg)
|
||||
return field == "" || compile.MatchString(field)
|
||||
@@ -39,3 +39,4 @@ func validateField[T interface{}](c *gin.Context, field T) (T, error) {
|
||||
}
|
||||
return field, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user