diff --git a/apps/user.js b/apps/user.js index 58db8f2..b8d53c1 100644 --- a/apps/user.js +++ b/apps/user.js @@ -215,7 +215,7 @@ export async function delSign(e) { return true; } export async function updCookie(e) { - let stoken=await gsCfg.getBingStoken(); + let stoken=await gsCfg.getBingStoken(e.user_id); if (Object.keys(stoken).length==0) { e.reply("请先绑定stoken") return true; diff --git a/model/gsCfg.js b/model/gsCfg.js index 91628b7..9aae7c1 100644 --- a/model/gsCfg.js +++ b/model/gsCfg.js @@ -59,6 +59,15 @@ class GsCfg { ckQQ } } + async getBingStoken(userId){ + try { + return YAML.parse( + fs.readFileSync(`plugins/${plugin}/data/yaml/${userId}.yaml`, 'utf8') + ) + }catch (ex) { + return {} + } + } /** 读取所有用户绑定的stoken */ async getBingStoken() { let ck = []