From a5b9e61c227c5cb6223848385241f64c6430cb82 Mon Sep 17 00:00:00 2001 From: ZhenYi <434836402@qq.com> Date: Wed, 20 Nov 2024 15:34:37 +0800 Subject: [PATCH] :green_heart: update backend url --- chart/templates/ingress.yaml | 17 +++++++++++++++-- src/app/auth/Register.tsx | 2 -- src/libs/Nets.tsx | 2 +- vite.config.ts | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml index 315c426..970866c 100644 --- a/chart/templates/ingress.yaml +++ b/chart/templates/ingress.yaml @@ -1,19 +1,25 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: gitdata-rust + name: gitdata-rust namespace: gitdata annotations: meta.helm.sh/release-name: gitdata-rust nginx.ingress.kubernetes.io/proxy-connect-timeout: "30" nginx.ingress.kubernetes.io/proxy-read-timeout: "1800" nginx.ingress.kubernetes.io/proxy-send-timeout: "1800" + nginx.ingress.kubernetes.io/enable-cors: "true" + nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,User-Agent,X-Requested-With,Content-Type,Authorization,Origin,Accept,Access-Control-Request-Method,Access-Control-Request-Headers" # 允许的请求头 + nginx.ingress.kubernetes.io/cors-allow-methods: "GET, PUT, POST, DELETE, PATCH, OPTIONS" + nginx.ingress.kubernetes.io/cors-max-age: "86400" + nginx.ingress.kubernetes.io/cors-allow-credentials: "true" + nginx.ingress.kubernetes.io/cors-expose-headers: "Content-Length,Content-Range" labels: apptype: gitdata-rust app.kubernetes.io/managed-by: Helm heritage: Helm - release: gitdata-rust + release: gitdata-rust spec: ingressClassName: {{.Values.ingress_name}} rules: @@ -25,5 +31,12 @@ spec: backend: service: name: gitdata-rust-service + port: + number: 80 + - path: /api/ + pathType: Prefix + backend: + service: + name: jzfs-rust-service port: number: 80 \ No newline at end of file diff --git a/src/app/auth/Register.tsx b/src/app/auth/Register.tsx index fcfd051..ac10eaa 100644 --- a/src/app/auth/Register.tsx +++ b/src/app/auth/Register.tsx @@ -75,8 +75,6 @@ const Register = () => { } } useEffect(() => { - console.log(isCountDown) - console.log(CountDown) if (isCountDown){ const timer = setTimeout(() => { setCountDown(CountDown - 1) diff --git a/src/libs/Nets.tsx b/src/libs/Nets.tsx index ef726dd..9023cb0 100644 --- a/src/libs/Nets.tsx +++ b/src/libs/Nets.tsx @@ -13,7 +13,7 @@ class Nets extends Urls { constructor() { super(); } - public baseUrl = "https://v1.jiaozifs.com"; + public baseUrl = "/api"; // @eslint-disable-next-line @typescript-eslint/no-explicit-any public async POST( urls: string, diff --git a/vite.config.ts b/vite.config.ts index db42171..02a1941 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,7 +7,7 @@ export default defineConfig({ server: { proxy: { "/api": { - target: "http://221.128.225.26:34513", + target: "https://v1.jiaozifs.com", changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ""), },