Skip to content

Commit c6f99da

Browse files
committed
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.
1 parent d40e467 commit c6f99da

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/utils/settings.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { v4 as uuidv4 } from "uuid";
12
// 请求通知权限
23
async function requestNotificationPermission() {
34
if (Notification && Notification.requestPermission) {
@@ -67,17 +68,13 @@ const SETTINGS_STORAGE_KEY = "Classworks_settings";
6768
* @returns {string} 生成的UUID字符串
6869
*/
6970
function generateUUID() {
70-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
71-
const r = Math.random() * 16 | 0;
72-
const v = c === 'x' ? r : (r & 0x3 | 0x8);
73-
return v.toString(16);
74-
});
71+
return uuidv4();
7572
}
7673

7774
// 新增: Classworks云端存储的默认设置
7875
const classworksCloudDefaults = {
79-
"server.domain": "http://localhost:3030",
80-
"server.siteKey": "123456",
76+
"server.domain": "https://kv.wuyuan.dev",
77+
"server.siteKey": "",
8178
};
8279

8380
/**

0 commit comments

Comments
 (0)