feat: 完善官网配置、预约管理与文章编辑

This commit is contained in:
zhanjunhao
2026-10-31 19:02:58 +08:00
parent a2e5f6ef0e
commit 90b710215a
54 changed files with 4898 additions and 203 deletions
+40
View File
@@ -0,0 +1,40 @@
/*
Copyright (C) 2025 QuantumNous
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
// Local preview is disabled; uploads use the backend resource endpoint.
export const LOCAL_QR_PREVIEW_ENABLED = false;
export function isLocalQrPreview(value) {
return (
LOCAL_QR_PREVIEW_ENABLED &&
/^data:image\/(?:jpeg|png|webp);base64,(?:[A-Za-z0-9+/]{4})+(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(
value,
)
);
}
export function readLocalQrPreview(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => resolve(reader.result);
reader.onerror = () => reject(new Error('图片读取失败,请重新选择'));
reader.onabort = () => reject(new Error('图片读取已取消,请重新选择'));
reader.readAsDataURL(file);
});
}