Web 端本地缓存、首页与会员弹窗体验优化
新增 IndexedDB 与最近文件 L1 缓存、云保存/打开链路;首页支持下载与清空本地缓存;修复清空 storage 后语言初始化报错;优化 design2 背景加载与侧栏标签样式;完善会员激活/支付弹层样式;后端补充文件缩略图字段与 thumb 接口。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -19,8 +19,43 @@
|
||||
}
|
||||
}
|
||||
|
||||
function initClearCache() {
|
||||
var btn = document.getElementById('auth_clear_cache');
|
||||
if (!btn) return;
|
||||
btn.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
if (typeof layui === 'undefined' || typeof window.soonClearLocalDesignCache !== 'function') return;
|
||||
layui.use('layer', function () {
|
||||
var layer = layui.layer;
|
||||
layer.open({
|
||||
type: 1,
|
||||
skin: 'soon-layer',
|
||||
title: '清除本地缓存',
|
||||
content: '<div class="soon-dialog-body">将清除最近文件与本地缓存,不会退出登录。未上传的本地编辑将丢失。</div>',
|
||||
btn: ['确定清除', '取消'],
|
||||
btnAlign: 'r',
|
||||
area: ['320px', 'auto'],
|
||||
shadeClose: true,
|
||||
yes: function (index) {
|
||||
layer.close(index);
|
||||
window.soonClearLocalDesignCache().then(function () {
|
||||
if (typeof window.soonToast === 'function') window.soonToast('已清除本地缓存', 'success');
|
||||
else layer.msg('已清除本地缓存', { icon: 1, time: 1200 });
|
||||
setTimeout(function () {
|
||||
if (/design[12]\.web\.html/i.test(location.pathname || '')) location.href = 'index.web.html';
|
||||
else location.reload();
|
||||
}, 400);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function initTopbar(options) {
|
||||
options = options || {};
|
||||
initClearCache();
|
||||
|
||||
var tok = localStorage.getItem('soon_access') || '';
|
||||
var login = document.getElementById('auth_login');
|
||||
var reg = document.getElementById('auth_register');
|
||||
|
||||
Reference in New Issue
Block a user