Skip to content

Commit

Permalink
fix: 🐛 fix auth
Browse files Browse the repository at this point in the history
  • Loading branch information
adams549659584 committed Jun 1, 2023
1 parent 5aaa77f commit e6b8dec
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 25 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/launch.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

.DS_Store

release
2 changes: 1 addition & 1 deletion api/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func Index(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, common.PROXY_WEB_PAGE_PATH, http.StatusFound)
return
}
if strings.HasPrefix("/turing", r.URL.Path) {
if strings.HasPrefix(r.URL.Path, "/turing") {
if !helper.CheckAuth(r) {
helper.UnauthorizedResult(w)
return
Expand Down
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.6",
"version": "1.8.7",
"private": true,
"scripts": {
"dev": "vite",
Expand Down
6 changes: 5 additions & 1 deletion frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions frontend/src/sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ registerRoute(new NavigationRoute(createHandlerBoundToURL('./index.html')));

registerRoute(
({ request, url }) => {
if (url.pathname.includes('/sw.js')) {
return false;
}
return request.destination === 'style' || request.destination === 'manifest' || request.destination === 'script' || request.destination === 'worker';
},
new StaleWhileRevalidate({
Expand All @@ -52,17 +49,6 @@ registerRoute(
})
);

self.addEventListener('activate', async (ev) => {
const cacheKeys = await caches.keys();
for (const cacheKey of cacheKeys) {
// 删除旧缓存
if (!cacheKey.startsWith('workbox') && !cacheKey.startsWith(CACHE_NAME_PREFIX)) {
await caches.delete(cacheKey);
console.log(`del cache : `, cacheKey);
}
}
});

self.addEventListener('install', (ev) => {
self.skipWaiting();
});
1 change: 1 addition & 0 deletions web/assets/index-29dab197.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions web/assets/index-199bf4d7.js → web/assets/index-3a8b3b00.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion web/assets/index-4b631cfd.css

This file was deleted.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
<script src="/web/js/bing/chat/global.js"></script>
<script src="/web/js/bing/chat/amd.js"></script>
<script src="/web/js/bing/chat/config.js"></script>
<script type="module" crossorigin src="/web/assets/index-3378e00b.js"></script>
<link rel="stylesheet" href="/web/assets/index-4b631cfd.css">
<script type="module" crossorigin src="/web/assets/index-63d32cbb.js"></script>
<link rel="stylesheet" href="/web/assets/index-29dab197.css">
<link rel="manifest" href="/web/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/web/registerSW.js"></script></head>

<body>
Expand Down
Loading

1 comment on commit e6b8dec

@vercel
Copy link

@vercel vercel bot commented on e6b8dec Jun 1, 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.