From c5d50a9919291a234439a2366cfbb14980a78575 Mon Sep 17 00:00:00 2001 From: ctrlcvs <1509167646@qq.com> Date: Fri, 9 Sep 2022 10:17:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=88=B7=E6=96=B0ck=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user.js | 2 +- model/gsCfg.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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 = []