修复部分浏览器判定为app的bug

This commit is contained in:
qaq
2025-08-21 21:52:04 +08:00
parent 07a0b9e3fa
commit 365387576f
13 changed files with 183 additions and 168 deletions
+3 -12
View File
@@ -1,15 +1,6 @@
import axios, { AxiosResponse } from 'axios';
import { getPanelAddresses} from '@/utils/panel';
// 检测是否在WebView中运行
const isWebView = (): boolean => {
if((window as any).JsInterface !== undefined) {
return true;
}else if((window as any).webkit && (window as any).webkit.messageHandlers) {
return true;
}else {
return false;
}
};
import { getPanelAddresses, isWebViewFunc} from '@/utils/panel';
interface PanelAddress {
name: string;
@@ -34,7 +25,7 @@ function getWebViewPanelAddress() {
let baseURL: string = '';
export const reinitializeBaseURL = () => {
if (isWebView()) {
if (isWebViewFunc()) {
getWebViewPanelAddress();
} else {
baseURL = import.meta.env.VITE_API_BASE ? `${import.meta.env.VITE_API_BASE}/api/v1/` : '/api/v1/';