Files
junhong_cmp_fiber/internal/handler/validation/password.go
邹进 260fec7114
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
fix: 第1批 M1、M4~M6 登录密码统一规则与三类导出补列
- 七个设置登录密码入口统一 8~12 位、四类字符至少三类(1001/1016),修改密码与建店铺返回字段级提示
- 订单导出末列“操作人”、IoT 卡导出末列“套餐到期时间”、设备导出流量标 MB 并新增“设备合计(GB)”
- 历史导出任务按冻结表头识别新旧尾列,行宽不变
- OpenSpec Change fix-august-iteration-export-and-password-hints:10/12,5.3 前端同步与 5.4 测试部署导出验证待完成
2026-10-11 23:41:40 +09:00

22 lines
618 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package validation
import (
stderrors "errors"
"github.com/break/junhong_cmp_fiber/pkg/errors"
"github.com/break/junhong_cmp_fiber/pkg/validator"
)
// LoginPassword 按统一登录密码规则校验,失败时在规则提示前加上 prefix,错误码保持规则给出的值。
func LoginPassword(prefix, label, password string) error {
err := validator.ValidateLoginPassword(label, password)
if err == nil {
return nil
}
var appErr *errors.AppError
if !stderrors.As(err, &appErr) {
return errors.New(errors.CodeInvalidParam, prefix)
}
return errors.New(appErr.Code, prefix+":"+appErr.Message)
}