fix: 兼容旧前端可改配置文件
This commit is contained in:
@@ -4,6 +4,7 @@ import defaultLOGOBrand from '@/assets/logo_brand.png';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { validHttp } from '@/utils/regular-utils';
|
||||
import { defineStore } from 'pinia';
|
||||
import { sessionGet } from '@/utils/cache-session-utils';
|
||||
|
||||
/**应用参数类型 */
|
||||
type AppStore = {
|
||||
@@ -52,8 +53,11 @@ const useAppStore = defineStore('app', {
|
||||
if (validHttp(path)) {
|
||||
return path;
|
||||
}
|
||||
const baseApi = import.meta.env.VITE_API_BASE_URL;
|
||||
return `${baseApi}${path}`;
|
||||
// 兼容旧前端可改配置文件
|
||||
const baseUrl = import.meta.env.PROD
|
||||
? sessionGet('baseUrl') || import.meta.env.VITE_API_BASE_URL
|
||||
: import.meta.env.VITE_API_BASE_URL;
|
||||
return `${baseUrl}${path}`;
|
||||
},
|
||||
/**
|
||||
* 获取正确LOGO地址-brand
|
||||
@@ -68,8 +72,11 @@ const useAppStore = defineStore('app', {
|
||||
if (validHttp(path)) {
|
||||
return path;
|
||||
}
|
||||
const baseApi = import.meta.env.VITE_API_BASE_URL;
|
||||
return `${baseApi}${path}`;
|
||||
// 兼容旧前端可改配置文件
|
||||
const baseUrl = import.meta.env.PROD
|
||||
? sessionGet('baseUrl') || import.meta.env.VITE_API_BASE_URL
|
||||
: import.meta.env.VITE_API_BASE_URL;
|
||||
return `${baseUrl}${path}`;
|
||||
},
|
||||
/**
|
||||
* 获取正确登录背景地址
|
||||
@@ -84,8 +91,11 @@ const useAppStore = defineStore('app', {
|
||||
if (validHttp(path)) {
|
||||
return path;
|
||||
}
|
||||
const baseApi = import.meta.env.VITE_API_BASE_URL;
|
||||
return `${baseApi}${path}`;
|
||||
// 兼容旧前端可改配置文件
|
||||
const baseUrl = import.meta.env.PROD
|
||||
? sessionGet('baseUrl') || import.meta.env.VITE_API_BASE_URL
|
||||
: import.meta.env.VITE_API_BASE_URL;
|
||||
return `${baseUrl}${path}`;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
|
||||
Reference in New Issue
Block a user