feat: 图标支持根据语言上传对应图标
This commit is contained in:
1 parent
c16a1675f0
commit
96d6cfcfa2
7 files changed
+188
-147
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { sessionGet } from '@/utils/cache-session-utils';
|
||||
import { validHttp } from '@/utils/regular-utils';
|
||||
|
||||
/**
|
||||
* 解析资源文件绝对路径 http
|
||||
* @param path 服务端资源文件
|
||||
* @returns
|
||||
*/
|
||||
export function parseUrlPath(path: string) {
|
||||
if (!path || path === '#') {
|
||||
return '#';
|
||||
}
|
||||
if (validHttp(path)) {
|
||||
return 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}`;
|
||||
}
|
||||
Reference in new issue
Block a user