88c6ce8ccc
- 迁移为 frontend-web、frontend-electron、backend-web 与 docker 部署结构 - 网页端:订阅门禁二次弹窗、套餐/支付组件化、顶栏分组对齐 - 首页:最近文件与模板库布局优化,缩略图对齐,下载与删除操作 - 新增管理后台、支付与云端文件 API,更新 README 与项目规范 Co-authored-by: Cursor <cursoragent@cursor.com>
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
(function () {
|
|
'use strict';
|
|
|
|
function computeAssetBase() {
|
|
if (typeof window === 'undefined' || !window.location) {
|
|
return 'assets/images/';
|
|
}
|
|
var p = window.location.pathname || '/';
|
|
if (p.indexOf('/pages/') !== -1 || /\.web\.html$/i.test(p) || /\/pages\/[^/]+\.html$/i.test(p)) {
|
|
return '../assets/images/';
|
|
}
|
|
if (p.endsWith('/pages/') || p.endsWith('/pages')) {
|
|
return '../assets/images/';
|
|
}
|
|
return 'assets/images/';
|
|
}
|
|
|
|
function computeJsBase() {
|
|
if (typeof window === 'undefined' || !window.location) {
|
|
return 'js/';
|
|
}
|
|
var p = window.location.pathname || '/';
|
|
if (p.indexOf('/pages/') !== -1 || /\.web\.html$/i.test(p) || /\/pages\/[^/]+\.html$/i.test(p)) {
|
|
return '../js/';
|
|
}
|
|
return 'js/';
|
|
}
|
|
|
|
window.SOON_ASSET_BASE = computeAssetBase();
|
|
window.SOON_JS_BASE = computeJsBase();
|
|
|
|
window.soonAsset = function (name) {
|
|
var n = String(name || '').replace(/^\/+/, '');
|
|
return window.SOON_ASSET_BASE + n;
|
|
};
|
|
|
|
window.soonJs = function (rel) {
|
|
var n = String(rel || '').replace(/^\/+/, '');
|
|
return window.SOON_JS_BASE + n;
|
|
};
|
|
})();
|