新增tk版 自动私信

This commit is contained in:
2026-04-17 16:32:07 +08:00
parent c0125a5a9f
commit 5bdf5722a1
6 changed files with 275 additions and 474 deletions

View File

@@ -58,26 +58,28 @@ const PERMISSIONS_KEY = 'user_permissions';
/**
* 存储权限信息
* @param {Object} permissions - 权限对象 { bigBrother, crawl, webAi }
* @param {Object} permissions - 权限对象 { bigBrother, crawl, webAi, autotk }
*/
export function setPermissions(permissions) {
const autotkValue = permissions.autotk ?? permissions.autoTK ?? 0;
localStorage.setItem(PERMISSIONS_KEY, JSON.stringify({
bigBrother: permissions.bigBrother ?? 0,
crawl: permissions.crawl ?? 0,
webAi: permissions.webAi ?? 0,
autotk: autotkValue,
}));
}
/**
* 获取权限信息
* @returns {Object} 权限对象 { bigBrother, crawl, webAi }
* @returns {Object} 权限对象 { bigBrother, crawl, webAi, autotk }
*/
export function getPermissions() {
try {
const permissions = JSON.parse(localStorage.getItem(PERMISSIONS_KEY));
return permissions || { bigBrother: 0, crawl: 0, webAi: 0 };
return permissions || { bigBrother: 0, crawl: 0, webAi: 0, autotk: 0 };
} catch {
return { bigBrother: 0, crawl: 0, webAi: 0 };
return { bigBrother: 0, crawl: 0, webAi: 0, autotk: 0 };
}
}