From 0d38e0bdd32662979943b8c196382b5a9310f345 Mon Sep 17 00:00:00 2001 From: abc Date: Sat, 13 Jan 2024 23:40:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=82=E9=85=8D=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=9A=84gps=E7=9A=84UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend-api/backend-api.go | 2 +- backend-api/me.go | 1 + public-api/proxypublic.go | 2 ++ resource/template/v78GkVQvDccUOBvZi02mN/chat.html | 1 + resource/template/v78GkVQvDccUOBvZi02mN/discovery.html | 1 + resource/template/v78GkVQvDccUOBvZi02mN/editor.html | 1 + resource/template/v78GkVQvDccUOBvZi02mN/g.html | 1 + resource/template/v78GkVQvDccUOBvZi02mN/gc.html | 1 + resource/template/v78GkVQvDccUOBvZi02mN/gpts.html | 1 + resource/template/v78GkVQvDccUOBvZi02mN/mine.html | 1 + resource/template/v78GkVQvDccUOBvZi02mN/slug.html | 1 + 11 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 resource/template/v78GkVQvDccUOBvZi02mN/chat.html create mode 100644 resource/template/v78GkVQvDccUOBvZi02mN/discovery.html create mode 100644 resource/template/v78GkVQvDccUOBvZi02mN/editor.html create mode 100644 resource/template/v78GkVQvDccUOBvZi02mN/g.html create mode 100644 resource/template/v78GkVQvDccUOBvZi02mN/gc.html create mode 100644 resource/template/v78GkVQvDccUOBvZi02mN/gpts.html create mode 100644 resource/template/v78GkVQvDccUOBvZi02mN/mine.html create mode 100644 resource/template/v78GkVQvDccUOBvZi02mN/slug.html diff --git a/backend-api/backend-api.go b/backend-api/backend-api.go index 80c9243..0e9c443 100644 --- a/backend-api/backend-api.go +++ b/backend-api/backend-api.go @@ -28,7 +28,7 @@ var ( func init() { s := g.Server() s.BindHandler("/backend-api/*any", ProxyAll) - s.BindHandler("/public-api/*any", ProxyAll) + // s.BindHandler("/public-api/*any", ProxyAll) // s.BindHandler("/_next/data/*any", NextDataGptsFixed) backendGroup := s.Group("/backend-api") backendGroup.POST("/accounts/data_export", NotFound) // 禁用导出 diff --git a/backend-api/me.go b/backend-api/me.go index 7bb74c6..01a45cb 100644 --- a/backend-api/me.go +++ b/backend-api/me.go @@ -40,6 +40,7 @@ func Me(r *ghttp.Request) { res, err := g.Client().SetHeaderMap(map[string]string{ "Authorization": "Bearer " + AccessToken, "User-Agent": r.Header.Get("User-Agent"), + "authKey": config.AUTHKEY(ctx), }).Get(ctx, UpStream+"/backend-api/me") if err != nil { r.Response.WriteStatus(http.StatusUnauthorized) diff --git a/public-api/proxypublic.go b/public-api/proxypublic.go index 027888a..be50609 100644 --- a/public-api/proxypublic.go +++ b/public-api/proxypublic.go @@ -22,6 +22,8 @@ func ProxyPublic(r *ghttp.Request) { newreq.URL.Host = u.Host newreq.URL.Scheme = u.Scheme newreq.Host = u.Host + newreq.Header.Set("authkey", config.AUTHKEY(ctx)) + // newreq.Header.Set("Cookie", "__Secure-next-auth.session-token="+carinfo.RefreshCookie) // // 去除header 中的 压缩 // newreq.Header.Del("Accept-Encoding") diff --git a/resource/template/v78GkVQvDccUOBvZi02mN/chat.html b/resource/template/v78GkVQvDccUOBvZi02mN/chat.html new file mode 100644 index 0000000..da3fe55 --- /dev/null +++ b/resource/template/v78GkVQvDccUOBvZi02mN/chat.html @@ -0,0 +1 @@ +{{.envScript}}ChatGPT
\ No newline at end of file diff --git a/resource/template/v78GkVQvDccUOBvZi02mN/discovery.html b/resource/template/v78GkVQvDccUOBvZi02mN/discovery.html new file mode 100644 index 0000000..802d817 --- /dev/null +++ b/resource/template/v78GkVQvDccUOBvZi02mN/discovery.html @@ -0,0 +1 @@ +{{.envScript}}ChatGPT
\ No newline at end of file diff --git a/resource/template/v78GkVQvDccUOBvZi02mN/editor.html b/resource/template/v78GkVQvDccUOBvZi02mN/editor.html new file mode 100644 index 0000000..496c0fe --- /dev/null +++ b/resource/template/v78GkVQvDccUOBvZi02mN/editor.html @@ -0,0 +1 @@ +{{.envScript}}ChatGPT
\ No newline at end of file diff --git a/resource/template/v78GkVQvDccUOBvZi02mN/g.html b/resource/template/v78GkVQvDccUOBvZi02mN/g.html new file mode 100644 index 0000000..d1f3f8b --- /dev/null +++ b/resource/template/v78GkVQvDccUOBvZi02mN/g.html @@ -0,0 +1 @@ +{{.envScript}}ChatGPT
\ No newline at end of file diff --git a/resource/template/v78GkVQvDccUOBvZi02mN/gc.html b/resource/template/v78GkVQvDccUOBvZi02mN/gc.html new file mode 100644 index 0000000..1e46372 --- /dev/null +++ b/resource/template/v78GkVQvDccUOBvZi02mN/gc.html @@ -0,0 +1 @@ +{{.envScript}}ChatGPT
\ No newline at end of file diff --git a/resource/template/v78GkVQvDccUOBvZi02mN/gpts.html b/resource/template/v78GkVQvDccUOBvZi02mN/gpts.html new file mode 100644 index 0000000..802d817 --- /dev/null +++ b/resource/template/v78GkVQvDccUOBvZi02mN/gpts.html @@ -0,0 +1 @@ +{{.envScript}}ChatGPT
\ No newline at end of file diff --git a/resource/template/v78GkVQvDccUOBvZi02mN/mine.html b/resource/template/v78GkVQvDccUOBvZi02mN/mine.html new file mode 100644 index 0000000..fbbd273 --- /dev/null +++ b/resource/template/v78GkVQvDccUOBvZi02mN/mine.html @@ -0,0 +1 @@ +{{.envScript}}ChatGPT
\ No newline at end of file diff --git a/resource/template/v78GkVQvDccUOBvZi02mN/slug.html b/resource/template/v78GkVQvDccUOBvZi02mN/slug.html new file mode 100644 index 0000000..492ec11 --- /dev/null +++ b/resource/template/v78GkVQvDccUOBvZi02mN/slug.html @@ -0,0 +1 @@ +{{.envScript}}ChatGPT
\ No newline at end of file