mirror of
https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git
synced 2025-01-07 16:31:08 +08:00
修正未绑定ck时,无法刷新ck的问题
This commit is contained in:
parent
57489b68c0
commit
bd35367007
@ -120,7 +120,6 @@ export async function checkAuth (e, cfg) {
|
|||||||
/* 检查user ck */
|
/* 检查user ck */
|
||||||
let isCookieUser = await MysInfo.checkUidBing(uid)
|
let isCookieUser = await MysInfo.checkUidBing(uid)
|
||||||
if (auth === 'cookie' && !isCookieUser) {
|
if (auth === 'cookie' && !isCookieUser) {
|
||||||
e.reply('尚未绑定Cookie...')
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
e.selfUser = new User({ id: e.user_id, uid })
|
e.selfUser = new User({ id: e.user_id, uid })
|
||||||
|
@ -18,6 +18,9 @@ import {
|
|||||||
} from "oicq";
|
} from "oicq";
|
||||||
import YAML from 'yaml'
|
import YAML from 'yaml'
|
||||||
import User from "../model/user.js"
|
import User from "../model/user.js"
|
||||||
|
import {
|
||||||
|
checkAuth
|
||||||
|
} from "../adapter/mys.js"
|
||||||
export const rule = {
|
export const rule = {
|
||||||
userInfo: {
|
userInfo: {
|
||||||
reg: "^#*(ck|stoken|cookie|cookies|签到)查询$",
|
reg: "^#*(ck|stoken|cookie|cookies|签到)查询$",
|
||||||
@ -216,6 +219,8 @@ export async function delSign(e){
|
|||||||
export async function updCookie(e) {
|
export async function updCookie(e) {
|
||||||
let user = new User(e);
|
let user = new User(e);
|
||||||
await user.getCookie(e)
|
await user.getCookie(e)
|
||||||
|
let userCk = (await checkAuth(e, "cookie"))
|
||||||
|
e.uid = userCk.uid
|
||||||
let miHoYoApi = new MihoYoApi(e);
|
let miHoYoApi = new MihoYoApi(e);
|
||||||
if (!e.cookies || e.cookies.includes("undefined")) {
|
if (!e.cookies || e.cookies.includes("undefined")) {
|
||||||
e.reply("请先绑定stoken")
|
e.reply("请先绑定stoken")
|
||||||
@ -231,9 +236,9 @@ export async function updCookie(e){
|
|||||||
e.reply = (msg) => {
|
e.reply = (msg) => {
|
||||||
sendMsg.push(msg)
|
sendMsg.push(msg)
|
||||||
}
|
}
|
||||||
let sk = await utils.getCookieMap(e.cookie)
|
let sk = await utils.getCookieMap(e.cookies)
|
||||||
let ck = resObj["data"]["cookie_token"];
|
let ck = resObj["data"]["cookie_token"];
|
||||||
e.msg=`ltoken=${sk.get("ltoken")};ltuid=${sk.get("ltuid")};cookie_token=${ck}; account_id=${sk.get("ltuid")};`
|
e.msg = `ltoken=${sk.get("ltoken")};ltuid=${sk.get("stuid")};cookie_token=${ck}; account_id=${sk.get("stuid")};`
|
||||||
if (isV3) {
|
if (isV3) {
|
||||||
let userck = (await import(`file:///${_path}/plugins/genshin/model/user.js`)).default
|
let userck = (await import(`file:///${_path}/plugins/genshin/model/user.js`)).default
|
||||||
e.ck = e.msg;
|
e.ck = e.msg;
|
||||||
|
Loading…
Reference in New Issue
Block a user