Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway into dev
正在显示
3 个修改的文件
包含
13 行增加
和
5 行删除
@@ -58,7 +58,7 @@ func (repository *LoginAccessRepository) Save(loginAccess *domain.LoginAccess) ( | @@ -58,7 +58,7 @@ func (repository *LoginAccessRepository) Save(loginAccess *domain.LoginAccess) ( | ||
58 | &loginAccess.CreatedTime, | 58 | &loginAccess.CreatedTime, |
59 | &loginAccess.UpdatedTime, | 59 | &loginAccess.UpdatedTime, |
60 | ), | 60 | ), |
61 | - fmt.Sprintf("INSERT INTO login_accesss (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet), | 61 | + fmt.Sprintf("INSERT INTO login_access (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet), |
62 | loginAccess.Account, | 62 | loginAccess.Account, |
63 | loginAccess.Platform, | 63 | loginAccess.Platform, |
64 | loginAccess.CompanyId, | 64 | loginAccess.CompanyId, |
@@ -86,7 +86,7 @@ func (repository *LoginAccessRepository) Save(loginAccess *domain.LoginAccess) ( | @@ -86,7 +86,7 @@ func (repository *LoginAccessRepository) Save(loginAccess *domain.LoginAccess) ( | ||
86 | &loginAccess.CreatedTime, | 86 | &loginAccess.CreatedTime, |
87 | &loginAccess.UpdatedTime, | 87 | &loginAccess.UpdatedTime, |
88 | ), | 88 | ), |
89 | - fmt.Sprintf("UPDATE login_accesss SET %s WHERE login_access_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet), | 89 | + fmt.Sprintf("UPDATE login_access SET %s WHERE login_access_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet), |
90 | loginAccess.Account, | 90 | loginAccess.Account, |
91 | loginAccess.Platform, | 91 | loginAccess.Platform, |
92 | loginAccess.CompanyId, | 92 | loginAccess.CompanyId, |
@@ -32,7 +32,7 @@ func init() { | @@ -32,7 +32,7 @@ func init() { | ||
32 | } | 32 | } |
33 | filters.SecureKeyMap["token"] = "x-mmm-accesstoken" | 33 | filters.SecureKeyMap["token"] = "x-mmm-accesstoken" |
34 | web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors()) | 34 | web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors()) |
35 | - web.InsertFilter("/*", web.BeforeExec, filters.CreateRequstLogFilter(log.Logger)) | 35 | + web.InsertFilter("/*", web.BeforeRouter, filters.CreateRequstLogFilter(log.Logger)) |
36 | web.InsertFilter("/*", web.AfterExec, filters.CreateResponseLogFilter(log.Logger), web.WithReturnOnOutput(false)) | 36 | web.InsertFilter("/*", web.AfterExec, filters.CreateResponseLogFilter(log.Logger), web.WithReturnOnOutput(false)) |
37 | web.InsertFilter("/v1/app11/*", web.BeforeExec, filters.SecureHandler( | 37 | web.InsertFilter("/v1/app11/*", web.BeforeExec, filters.SecureHandler( |
38 | filters.WithEnableCheckTimestamp(false), | 38 | filters.WithEnableCheckTimestamp(false), |
1 | package mobile_client | 1 | package mobile_client |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | + "github.com/linmadan/egglib-go/utils/json" | ||
4 | "github.com/linmadan/egglib-go/web/beego" | 5 | "github.com/linmadan/egglib-go/web/beego" |
5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" |
7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log" | ||
6 | ) | 8 | ) |
7 | 9 | ||
8 | type baseController struct { | 10 | type baseController struct { |
@@ -39,8 +41,11 @@ func (controller *baseController) GetOrgId() int64 { | @@ -39,8 +41,11 @@ func (controller *baseController) GetOrgId() int64 { | ||
39 | func (controller *baseController) GetOperator() domain.Operator { | 41 | func (controller *baseController) GetOperator() domain.Operator { |
40 | token := controller.Ctx.Input.Header("X-Mmm-Accesstoken") | 42 | token := controller.Ctx.Input.Header("X-Mmm-Accesstoken") |
41 | loginToken := &domain.LoginToken{} | 43 | loginToken := &domain.LoginToken{} |
42 | - loginToken.ParseToken(token) | ||
43 | - return domain.Operator{ | 44 | + err := loginToken.ParseToken(token) |
45 | + if err != nil { | ||
46 | + log.Logger.Error(err.Error()) | ||
47 | + } | ||
48 | + op := domain.Operator{ | ||
44 | UserId: loginToken.UserId, | 49 | UserId: loginToken.UserId, |
45 | CompanyId: loginToken.CompanyId, | 50 | CompanyId: loginToken.CompanyId, |
46 | OrgId: loginToken.OrgId, | 51 | OrgId: loginToken.OrgId, |
@@ -48,4 +53,7 @@ func (controller *baseController) GetOperator() domain.Operator { | @@ -48,4 +53,7 @@ func (controller *baseController) GetOperator() domain.Operator { | ||
48 | Phone: loginToken.Account, | 53 | Phone: loginToken.Account, |
49 | Token: token, | 54 | Token: token, |
50 | } | 55 | } |
56 | + // TODO:打印测试日志 | ||
57 | + log.Logger.Debug("operator " + json.MarshalToString(op)) | ||
58 | + return op | ||
51 | } | 59 | } |
-
请 注册 或 登录 后发表评论