This commit is contained in:
lcw
2025-08-27 17:26:29 +08:00
parent 42f5e37f65
commit f4c108b4b4
47 changed files with 4087 additions and 300 deletions

View File

@ -6,6 +6,7 @@ import { saveAs } from 'file-saver'
import { tansParams, blobValidate } from "@/utils/ruoyi";
let downloadLoadingInstance;
const service = axios.create({
withCredentials: true,
baseURL: process.env.VUE_APP_BASE_API,
timeout: 100000
});
@ -66,6 +67,8 @@ service.interceptors.response.use(
error.response.data &&
error.response.data.code === 401
) {
console.log("Xxxxx");
store.dispatch('user/logout');
}
}

View File

@ -15,6 +15,10 @@ export const setItem = (key, value) => {
export const getItem = (key) => {
const data = window.localStorage.getItem(key);
try {
if (typeof data === 'string' && /^\d+$/.test(data) && data.length > 15) {
// 如果是长数字字符串,直接返回,不进行 JSON.parse
return data;
}
return JSON.parse(data);
} catch (err) {
return data;

View File

@ -90,6 +90,18 @@ export function timeValidate(date, type) {
if (type == 'md') {
return `${MM}.${dd}`
}
if (type == 'td') {
return `${yyyy}${MM}${dd}`
}
if (type == 'yd') {
return `${yyyy}`
}
if (type == 'mm') {
return `${yyyy}${MM}${dd}${hh}${mm}${ss}`
}
if (type == 'ydm') {
return `${yyyy}${MM}${dd}${hh}${mm}${ss}`
}
return `${yyyy}-${MM}-${dd} ${hh}:${mm}:${ss}`
}