mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-10-13 13:33:44 +08:00
用户操作权限增加角色权限过滤,优化角色/部门关系树生成,修复验证码空参数不验证问题
This commit is contained in:
@@ -8,6 +8,7 @@ package admin
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/role"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/contexts"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
@@ -69,7 +70,7 @@ func (c *cRole) UpdatePermissions(ctx context.Context, req *role.UpdatePermissio
|
||||
// DataScopeSelect 获取数据权限选项
|
||||
func (c *cRole) DataScopeSelect(_ context.Context, _ *role.DataScopeSelectReq) (res *role.DataScopeSelectRes, err error) {
|
||||
res = new(role.DataScopeSelectRes)
|
||||
res.List = service.AdminRole().DataScopeSelect()
|
||||
res.List = consts.DataScopeSelect //service.AdminRole().DataScopeSelect()
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -99,9 +99,9 @@ func (c *cSite) AccountLogin(ctx context.Context, req *common.AccountLoginReq) (
|
||||
return
|
||||
}
|
||||
|
||||
if login.CaptchaSwitch == 1 {
|
||||
if !req.IsLock && login.CaptchaSwitch == 1 {
|
||||
// 校验 验证码
|
||||
if !req.IsLock && !captcha.Verify(req.Cid, req.Code) {
|
||||
if !captcha.Verify(req.Cid, req.Code) {
|
||||
err = gerror.New("验证码错误")
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user