1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2025-07-02 09:19:23 +00:00

Integrate uuid library for UUID generation in settings.js and update default server settings for Classworks cloud storage. Change server domain to a production URL and clear the site key for improved configuration management.

This commit is contained in:
SunWuyuan 2025-05-11 12:10:29 +08:00
parent d40e467183
commit c6f99da050
No known key found for this signature in database
GPG Key ID: A6A54CF66F56BB64

View File

@ -1,3 +1,4 @@
import { v4 as uuidv4 } from "uuid";
// 请求通知权限 // 请求通知权限
async function requestNotificationPermission() { async function requestNotificationPermission() {
if (Notification && Notification.requestPermission) { if (Notification && Notification.requestPermission) {
@ -67,17 +68,13 @@ const SETTINGS_STORAGE_KEY = "Classworks_settings";
* @returns {string} 生成的UUID字符串 * @returns {string} 生成的UUID字符串
*/ */
function generateUUID() { function generateUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { return uuidv4();
const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
} }
// 新增: Classworks云端存储的默认设置 // 新增: Classworks云端存储的默认设置
const classworksCloudDefaults = { const classworksCloudDefaults = {
"server.domain": "http://localhost:3030", "server.domain": "https://kv.wuyuan.dev",
"server.siteKey": "123456", "server.siteKey": "",
}; };
/** /**