Skip to content

Commit 681b0ca

Browse files
fix: 🐛 fix auth
1 parent d1dab64 commit 681b0ca

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

api/index.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@ import (
44
"adams549659584/go-proxy-bingai/api/helper"
55
"adams549659584/go-proxy-bingai/common"
66
"net/http"
7+
"strings"
78
)
89

910
func Index(w http.ResponseWriter, r *http.Request) {
1011
if r.URL.Path == "/" {
1112
http.Redirect(w, r, common.PROXY_WEB_PAGE_PATH, http.StatusFound)
12-
} else {
13+
return
14+
}
15+
if strings.HasPrefix("/turing", r.URL.Path) {
1316
if !helper.CheckAuth(r) {
1417
helper.UnauthorizedResult(w)
1518
return
1619
}
17-
common.NewSingleHostReverseProxy(common.BING_URL).ServeHTTP(w, r)
1820
}
21+
common.NewSingleHostReverseProxy(common.BING_URL).ServeHTTP(w, r)
22+
1923
}

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "go-proxy-bingai",
3-
"version": "1.8.1",
3+
"version": "1.8.2",
44
"private": true,
55
"scripts": {
66
"dev": "vite",

frontend/src/views/chat/components/Chat/Chat.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ onMounted(async () => {
5050
// show conversion
5151
SydneyFullScreenConv.initWithWaitlistUpdate({ cookLoc: {} }, 10);
5252
53-
initChatService();
54-
5553
isShowLoading.value = false;
5654
hackStyle();
5755
initChatPrompt();
@@ -97,6 +95,7 @@ const afterAuth = (data: SysConfig) => {
9795
if (!data.isSysCK) {
9896
userStore.checkUserToken();
9997
}
98+
initChatService();
10099
};
101100
102101
const initChat = async () => {

0 commit comments

Comments
 (0)