2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-23 03:20:52 +08:00

修正未绑定cookie时会报错

This commit is contained in:
Ctrlcvs 2022-08-17 08:00:28 +08:00 committed by leiyilu
parent 1eb79ddbe5
commit 0819e3de5f
2 changed files with 3 additions and 2 deletions

View File

@ -36,10 +36,11 @@ export async function userInfo(e,{render}){
let ck=""; let ck="";
if(e.cookie){ if(e.cookie){
ck= user.getCookieMap(e.cookie); ck= user.getCookieMap(e.cookie);
ck=ck.get("ltuid")
} }
return await Common.render(`user/userInfo`, { return await Common.render(`user/userInfo`, {
uid: e.user_id, uid: e.user_id,
ltuid:ck.get("ltuid")||e.user_id, ltuid:ck||e.user_id,
save_id:e.user_id, save_id:e.user_id,
day, day,
sumData sumData

View File

@ -113,7 +113,7 @@ export default class user {
let cookiesDoc = await this.getcookiesDoc(); let cookiesDoc = await this.getcookiesDoc();
let miHoYoApi = new MihoYoApi(this.e); let miHoYoApi = new MihoYoApi(this.e);
if (!cookie) { if (!cookie) {
e.reply("cookie失效请重新绑定~【教程】\n" + cookiesDoc) e.reply("请先#绑定cookie\n发送【体力帮助】查看配置教程")
return false; return false;
} }