fix: 🐛 fix auth

master v1.8.7
adams549659584 2023-06-01 23:23:55 +08:00
parent 5aaa77f183
commit e6b8dec171
11 changed files with 29 additions and 25 deletions

14
.gitignore vendored 100644
View File

@ -0,0 +1,14 @@
# Editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/launch.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.DS_Store
release

View File

@ -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

View File

@ -1,6 +1,6 @@
{
"name": "go-proxy-bingai",
"version": "1.8.6",
"version": "1.8.7",
"private": true,
"scripts": {
"dev": "vite",

View File

@ -1,4 +1,8 @@
lockfileVersion: '6.0'
lockfileVersion: '6.1'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
dependencies:
pinia:

View File

@ -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({
@ -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();
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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>

File diff suppressed because one or more lines are too long