From e0379f7da7c53cd454d7765ce978996d370e8e7b Mon Sep 17 00:00:00 2001 From: Binx Date: Sun, 21 Jun 2026 14:35:45 +0800 Subject: [PATCH] fix: fix redirect to read page url error --- ui/src/stores/modules/application.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/src/stores/modules/application.ts b/ui/src/stores/modules/application.ts index 0709b2e293a..470abef82d8 100644 --- a/ui/src/stores/modules/application.ts +++ b/ui/src/stores/modules/application.ts @@ -1,9 +1,18 @@ import { defineStore } from 'pinia' const useApplicationStore = defineStore('application', { state: () => ({ - location: `${window.location.origin}${window.MaxKB.chatPrefix ? window.MaxKB.chatPrefix : window.MaxKB.prefix}/`, + location: `${getChatOrigin()}${ + window.MaxKB.chatPrefix ? window.MaxKB.chatPrefix : window.MaxKB.prefix + }/`, }), actions: {}, }) +function getChatOrigin() { + if (import.meta.env.DEV && window.location.port === '3000') { + return `${window.location.protocol}//${window.location.hostname}:3001` + } + return window.location.origin +} + export default useApplicationStore