新增tk版 自动私信
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user