三端用户手机号联通,增加临时用户
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"qnc-server/app/main/api/internal/svc"
|
||||
"qnc-server/app/main/api/internal/types"
|
||||
"qnc-server/app/main/model"
|
||||
jwtx "qnc-server/common/jwt"
|
||||
"qnc-server/common/xerr"
|
||||
"qnc-server/pkg/lzkit/crypto"
|
||||
@@ -71,7 +72,14 @@ func (l *AdminLoginLogic) AdminLogin(req *types.AdminLoginReq) (resp *types.Admi
|
||||
// 5. 生成token
|
||||
refreshToken := l.svcCtx.Config.JwtAuth.RefreshAfter
|
||||
expiresAt := l.svcCtx.Config.JwtAuth.AccessExpire
|
||||
token, err := jwtx.GenerateJwtToken(user.Id, l.svcCtx.Config.JwtAuth.AccessSecret, expiresAt)
|
||||
claims := jwtx.JwtClaims{
|
||||
UserId: user.Id,
|
||||
AgentId: 0,
|
||||
Platform: model.PlatformAdmin,
|
||||
UserType: model.UserTypeAdmin,
|
||||
IsAgent: model.AgentStatusNo,
|
||||
}
|
||||
token, err := jwtx.GenerateJwtToken(claims, l.svcCtx.Config.JwtAuth.AccessSecret, expiresAt)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrMsg("生成token失败"), "用户登录, 生成token失败, 用户名: %s", req.Username)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user