fix version 1
This commit is contained in:
@@ -10,7 +10,8 @@ import (
|
||||
"bsm/full/module/ec/market/internal/password"
|
||||
pb "bsm/full/module/ec/market/pb"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/crypto/encipher"
|
||||
"git.apinb.com/bsm-sdk/core/crypto/token"
|
||||
"git.apinb.com/bsm-sdk/core/env"
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@@ -50,7 +51,8 @@ func Login(ctx context.Context, in *pb.LoginRequest) (reply *pb.LoginReply, err
|
||||
Market_Identity: marketData.Identity,
|
||||
}
|
||||
|
||||
token, err := encipher.GenerateTokenAes(marketData.ID, marketData.Identity, "", "", market, map[string]string{})
|
||||
// 与接口侧 ParseMetaCtx 的 JWT 校验保持一致,使用 SDK 的签发函数
|
||||
tokenStr, err := token.New(env.Runtime.JwtSecretKey).GenerateJwt(marketData.ID, marketData.Identity, "", "", market, map[string]string{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -63,7 +65,7 @@ func Login(ctx context.Context, in *pb.LoginRequest) (reply *pb.LoginReply, err
|
||||
}
|
||||
|
||||
return &pb.LoginReply{
|
||||
Token: token,
|
||||
Token: tokenStr,
|
||||
Identity: marketData.Identity,
|
||||
Name: marketData.Name,
|
||||
Account: marketData.Account,
|
||||
|
||||
Reference in New Issue
Block a user