chore(frontend): 更新前端配置文件和构建脚本

- 更新 uni-app 配置文件(manifest.json、vue.config.js)
- 新增 babel.config.js 和 uni-h5-polyfill.js 支持
- 更新缓存工具类(cache.js、index.js)
- 新增 nginx-crmeb.conf 部署配置
- 更新 package-lock.json
This commit is contained in:
apple
2026-03-10 13:50:35 +08:00
parent 9bb10cbe57
commit 263df94d95
12 changed files with 319 additions and 115 deletions

View File

@@ -193,30 +193,34 @@ class Cache {
* 清除过期缓存
*/
clearOverdue() {
let cahceValue = this.cacheGetHandler(this.cacheExpire),
time = this.time(),
newBeOverdueValue = [],
newTagValue = [];
try {
let cahceValue = this.cacheGetHandler(this.cacheExpire),
time = this.time(),
newBeOverdueValue = [],
newTagValue = [];
if (cahceValue && typeof cahceValue === 'object' && cahceValue.length) {
cahceValue.map(item => {
if (item) {
if ((item.expire !== undefined && item.expire > time) || item.expire === 0) {
newTagValue.push(item);
} else {
newBeOverdueValue.push(item.key);
if (Array.isArray(cahceValue) && cahceValue.length) {
cahceValue.map(item => {
if (item) {
if ((item.expire !== undefined && item.expire > time) || item.expire === 0) {
newTagValue.push(item);
} else {
newBeOverdueValue.push(item.key);
}
}
}
});
});
}
//保存没有过期的缓存标签
if (!Array.isArray(cahceValue) || newTagValue.length !== cahceValue.length) {
this.cacheSetHandler(this.cacheExpire, newTagValue);
}
//删除过期缓存
newBeOverdueValue.forEach(k => {
this.cacheClearHandler(k);
})
} catch (e) {
// H5 初始化阶段 uni 存储 API 可能尚未就绪,忽略错误
}
//保存没有过期的缓存标签
if (newTagValue.length !== cahceValue.length) {
this.cacheSetHandler(this.cacheExpire, newTagValue);
}
//删除过期缓存
newBeOverdueValue.forEach(k => {
this.cacheClearHandler(k);
})
}
}