Skip to content

Commit

Permalink
fix: 🐛 fix auth
Browse files Browse the repository at this point in the history
  • Loading branch information
adams549659584 committed May 26, 2023
1 parent d1dab64 commit 681b0ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 6 additions & 2 deletions api/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ import (
"adams549659584/go-proxy-bingai/api/helper"
"adams549659584/go-proxy-bingai/common"
"net/http"
"strings"
)

func Index(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/" {
http.Redirect(w, r, common.PROXY_WEB_PAGE_PATH, http.StatusFound)
} else {
return
}
if strings.HasPrefix("/turing", r.URL.Path) {
if !helper.CheckAuth(r) {
helper.UnauthorizedResult(w)
return
}
common.NewSingleHostReverseProxy(common.BING_URL).ServeHTTP(w, r)
}
common.NewSingleHostReverseProxy(common.BING_URL).ServeHTTP(w, r)

}
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "go-proxy-bingai",
"version": "1.8.1",
"version": "1.8.2",
"private": true,
"scripts": {
"dev": "vite",
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/views/chat/components/Chat/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ onMounted(async () => {
// show conversion
SydneyFullScreenConv.initWithWaitlistUpdate({ cookLoc: {} }, 10);
initChatService();
isShowLoading.value = false;
hackStyle();
initChatPrompt();
Expand Down Expand Up @@ -97,6 +95,7 @@ const afterAuth = (data: SysConfig) => {
if (!data.isSysCK) {
userStore.checkUserToken();
}
initChatService();
};
const initChat = async () => {
Expand Down

1 comment on commit 681b0ca

@vercel
Copy link

@vercel vercel bot commented on 681b0ca May 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.