1.解决多个接口报错,出现多个提示的问题

v1.0.0
sws 2024-09-04 15:58:43 +08:00
parent 975d92d970
commit 8c1844f7f3
2 changed files with 8 additions and 2 deletions

View File

@ -20,6 +20,7 @@ export const commonStore = defineStore('common', () => {
common_tencent_map_ak: '',
common_tianditu_map_ak: '',
currency_symbol: '',
attachment_host: '',
} as any, // 基础数据配置参数
});
// 存储链接数据

View File

@ -1,4 +1,8 @@
import { isEmpty } from 'lodash';
import { commonStore } from '@/store';
const { common } = commonStore();
// 定义一组预定义的颜色数组,用于在各种场景中轻松引用这些颜色
// 这些颜色包括从白色到黑色的不同灰度以及一些鲜艳的颜色格式有十六进制、RGB、RGBA、HSV、HSL等
export const predefine_colors = ['#fff', '#ddd', '#ccc', '#999', '#666', '#333', '#000', '#ff4500', '#ff8c00', '#ffd700', '#90ee90', '#00ced1', '#c71585', 'rgba(255, 69, 0, 0.68)', 'rgb(255, 120, 0)', 'hsv(51, 100, 98)', 'hsva(120, 40, 94, 0.5)', 'hsl(181, 100%, 37%)', '#1F93FF', '#c7158577'];
/**
*
@ -67,7 +71,7 @@ export function gradient_handle(color_list: color_list[], direction: string, is_
if (color_list.length == 1) {
container_common_styles += ` ${item.color_percentage || 0}%, ${item.color} 100%`;
} else {
if (typeof item.color_percentage === "number") {
if (typeof item.color_percentage === 'number') {
if (index == color_list.length - 1) {
container_common_styles += ` ${item.color_percentage}%`;
} else {
@ -332,10 +336,11 @@ export const tabs_style = (color: string, style: string | number | boolean | und
* @returns {Promise<string>} PromiseURL
*/
export const online_url = async (directory: string) => {
const attachemnt_host = common.config.attachment_host;
if (import.meta.env.VITE_APP_BASE_API == '/dev-api') {
let temp_data = await import(import.meta.env.VITE_APP_BASE_API == '/dev-api' ? '../../temp.d' : '../../temp_pro.d');
return temp_data.default.temp_attachment_host + directory;
} else {
return get_cookie('attachment_host') + directory;
return attachemnt_host + directory;
}
};