fix: apiv2 failed in container (#2307)

This commit is contained in:
Athurg Gooth 2023-09-28 18:45:45 +08:00 committed by GitHub
parent fbbfb11916
commit 5b6b2f0528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -5,10 +5,8 @@ import { SystemServiceDefinition } from "./types/proto/api/v2/system_service";
import { TagServiceDefinition } from "./types/proto/api/v2/tag_service"; import { TagServiceDefinition } from "./types/proto/api/v2/tag_service";
import { UserServiceDefinition } from "./types/proto/api/v2/user_service"; import { UserServiceDefinition } from "./types/proto/api/v2/user_service";
const address = import.meta.env.MODE === "development" ? "http://localhost:8081" : window.location.origin;
const channel = createChannel( const channel = createChannel(
address, window.location.origin,
FetchTransport({ FetchTransport({
credentials: "include", credentials: "include",
}) })

View File

@ -19,6 +19,10 @@ export default defineConfig({
target: devProxyServer, target: devProxyServer,
xfwd: true, xfwd: true,
}, },
"^/memos.api.v2": {
target: devProxyServer,
xfwd: true,
},
"^/o/": { "^/o/": {
target: devProxyServer, target: devProxyServer,
xfwd: true, xfwd: true,