refactor: 部分日志请求入参调整为json

This commit is contained in:
meilin.huang
2023-09-09 23:34:26 +08:00
parent 08c381fa60
commit 8e75e1f6ef
16 changed files with 98 additions and 88 deletions

View File

@@ -98,7 +98,7 @@ func (a *Oauth2Login) OAuth2Callback(rc *req.Ctx) {
account.Id = accountId
err = a.AccountApp.GetAccount(account, "username")
biz.ErrIsNilAppendErr(err, "该账号不存在")
rc.ReqParam = fmt.Sprintf("oauth2 bind username: %s", account.Username)
rc.ReqParam = jsonx.Kvs("username", account.Username, "type", "bind")
err = a.Oauth2App.GetOAuthAccount(&entity.Oauth2Account{
AccountId: accountId,
@@ -173,7 +173,7 @@ func (a *Oauth2Login) doLoginAction(rc *req.Ctx, userId string, oauth *config.Oa
biz.ErrIsNilAppendErr(err, "获取用户信息失败: %s")
clientIp := getIpAndRegion(rc)
rc.ReqParam = fmt.Sprintf("oauth2 login username: %s | ip: %s", account.Username, clientIp)
rc.ReqParam = jsonx.Kvs("username", account.Username, "ip", clientIp, "type", "login")
res := LastLoginCheck(account, config.GetAccountLoginSecurity(), clientIp)
res["action"] = "oauthLogin"