Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss into dev
正在显示
5 个修改的文件
包含
15 行增加
和
14 行删除
@@ -2,11 +2,10 @@ | @@ -2,11 +2,10 @@ | ||
2 | 2 | ||
3 | ### 测试环境 | 3 | ### 测试环境 |
4 | 4 | ||
5 | -服务端域名 http://sumifcc-discuss-test.sumifcc.com/ | ||
6 | -日志地址 https://sumifcc-discuss-test.sumifcc.com/v1/log/access | ||
7 | - | ||
8 | -管理后台“易数家“前端入口:https://digital-front-platform-dev.fjmaimaimai.com/ | ||
9 | -跳转后的实际管理后台地址: | 5 | + 服务端域名 http://sumifcc-discuss-test.sumifcc.com/ |
6 | + 日志地址 https://sumifcc-discuss-test.sumifcc.com/v1/log/access | ||
7 | + 管理后台“易数家“前端入口:https://digital-front-platform-dev.fjmaimaimai.com/ | ||
8 | + 跳转后的实际管理后台地址: | ||
10 | 9 | ||
11 | ### 可设置环境变量 | 10 | ### 可设置环境变量 |
12 | - DataSource | 11 | - DataSource |
@@ -3,13 +3,14 @@ package main | @@ -3,13 +3,14 @@ package main | ||
3 | import ( | 3 | import ( |
4 | "context" | 4 | "context" |
5 | "flag" | 5 | "flag" |
6 | + "net/http" | ||
7 | + "strings" | ||
8 | + | ||
6 | "github.com/zeromicro/go-zero/rest/httpx" | 9 | "github.com/zeromicro/go-zero/rest/httpx" |
7 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db" | 10 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/db" |
8 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain" | 11 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/interanl/pkg/domain" |
9 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result" | 12 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result" |
10 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/xerr" | 13 | "gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/xerr" |
11 | - "net/http" | ||
12 | - "strings" | ||
13 | 14 | ||
14 | "github.com/golang-jwt/jwt/v4/request" | 15 | "github.com/golang-jwt/jwt/v4/request" |
15 | "github.com/zeromicro/go-zero/core/conf" | 16 | "github.com/zeromicro/go-zero/core/conf" |
@@ -65,7 +66,8 @@ func systemSetup(c config.Config) { | @@ -65,7 +66,8 @@ func systemSetup(c config.Config) { | ||
65 | 66 | ||
66 | // 默认的token头 Authorization 修改为 x-mmm-accesstoken | 67 | // 默认的token头 Authorization 修改为 x-mmm-accesstoken |
67 | request.AuthorizationHeaderExtractor = &request.PostExtractionFilter{ | 68 | request.AuthorizationHeaderExtractor = &request.PostExtractionFilter{ |
68 | - request.HeaderExtractor{"x-mmm-accesstoken"}, func(tok string) (string, error) { | 69 | + Extractor: request.HeaderExtractor{"x-mmm-accesstoken"}, |
70 | + Filter: func(tok string) (string, error) { | ||
69 | // Should be a bearer token | 71 | // Should be a bearer token |
70 | if len(tok) > 6 && strings.ToUpper(tok[0:7]) == "BEARER " { | 72 | if len(tok) > 6 && strings.ToUpper(tok[0:7]) == "BEARER " { |
71 | return tok[7:], nil | 73 | return tok[7:], nil |
@@ -130,7 +130,7 @@ type ( | @@ -130,7 +130,7 @@ type ( | ||
130 | type ( | 130 | type ( |
131 | MiniSetUserLikeRequset { | 131 | MiniSetUserLikeRequset { |
132 | ArticleId int64 `json:"articleId"` //文章id | 132 | ArticleId int64 `json:"articleId"` //文章id |
133 | - CommentId int64 `json:"commentId"` //评论id | 133 | + CommentId int64 `json:"commentId,optional"` //评论id |
134 | UserId int64 `json:",optional"` //操作人 | 134 | UserId int64 `json:",optional"` //操作人 |
135 | Flag int `json:"flag"` //点赞标志 1、点赞 2 、取消点赞 | 135 | Flag int `json:"flag"` //点赞标志 1、点赞 2 、取消点赞 |
136 | } | 136 | } |
@@ -869,10 +869,10 @@ type WhichUserLikeArticle struct { | @@ -869,10 +869,10 @@ type WhichUserLikeArticle struct { | ||
869 | } | 869 | } |
870 | 870 | ||
871 | type MiniSetUserLikeRequset struct { | 871 | type MiniSetUserLikeRequset struct { |
872 | - ArticleId int64 `json:"articleId"` //文章id | ||
873 | - CommentId int64 `json:"commentId"` //评论id | ||
874 | - UserId int64 `json:",optional"` //操作人 | ||
875 | - Flag int `json:"flag"` //点赞标志 1、点赞 2 、取消点赞 | 872 | + ArticleId int64 `json:"articleId"` //文章id |
873 | + CommentId int64 `json:"commentId,optional"` //评论id | ||
874 | + UserId int64 `json:",optional"` //操作人 | ||
875 | + Flag int `json:"flag"` //点赞标志 1、点赞 2 、取消点赞 | ||
876 | } | 876 | } |
877 | 877 | ||
878 | type MiniSetUserLikeResponse struct { | 878 | type MiniSetUserLikeResponse struct { |
-
请 注册 或 登录 后发表评论