From 984134aaec745bbce1415465967dcf08c42f5389 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Wed, 18 Oct 2023 15:44:01 +0800 Subject: [PATCH 1/2] debug toekn --- utils/auth/user.go | 3 +++ utils/auth/user_test.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/auth/user.go b/utils/auth/user.go index 8c9e2ca5..b8b2dee6 100644 --- a/utils/auth/user.go +++ b/utils/auth/user.go @@ -198,6 +198,9 @@ func GenerateBaseJwtTokenUint64(AccessSecret uint64, accessExpire int64, nowSec for i := 0; i < myclaimsType.NumField(); i++ { field := myclaimsType.Field(i) tag := field.Tag.Get("json") + if tag == "exp" || tag == "iat" { + continue + } value := myclaimsValue.Field(i).Interface() // 将字段值赋给 claims 对象的相应键 claims[tag] = value diff --git a/utils/auth/user_test.go b/utils/auth/user_test.go index 8577988f..7280665d 100644 --- a/utils/auth/user_test.go +++ b/utils/auth/user_test.go @@ -19,7 +19,7 @@ func TestCase(t *testing.T) { data, _ := json.Marshal(info) log.Println(string(data)) - a := `{"user_id":0,"guest_id":1,"exp":0, "debug": { "exp": 12321213321}}` + a := `{"user_id":0,"guest_id":1,"exp":0, "debug": { "exp": 123212, "is_cache": 1}}` err := json.Unmarshal([]byte(a), info) log.Println(err) log.Printf("%#v %v", info, info.Debug) From 82ff819cf86f4c8a0f598eec7159c52b4d4d791b Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Wed, 18 Oct 2023 16:05:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=E5=90=88=E5=9B=BE=E6=96=B0=E5=A2=9Ede?= =?UTF-8?q?bug=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/image_handle.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/repositories/image_handle.go b/service/repositories/image_handle.go index 0090dd50..910b707b 100644 --- a/service/repositories/image_handle.go +++ b/service/repositories/image_handle.go @@ -93,6 +93,8 @@ func (l *defaultImageHandle) LogoInfoSet(ctx context.Context, in *LogoInfoSetReq if in.Debug != nil && in.Debug.IsAllTemplateTag == 1 { postMap["is_all_template"] = "1" + } else { + postMap["is_all_template"] = "0" } logc.Infof(ctx, "算法请求--LOGO基础信息--开始时间:%v", time.Now().UTC())