2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-22 19:10:53 +08:00

修正V2初始化报错问题

This commit is contained in:
Ctrlcvs 2022-09-07 00:47:12 +08:00
parent bd35367007
commit 44569ee8dd

View File

@ -18,9 +18,7 @@ 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|签到)查询$",
@ -219,8 +217,28 @@ 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")) if(isV3){
e.uid = userCk.uid let {
checkAuth
} = (await import(`file:///${_path}/plugins/xiaoyao-cvs-plugin/adapter/mys.js`))
let userCk = (await checkAuth(e, "cookie"))
e.uid = userCk.uid
}else{
// let {
// MysUser
// } = (await import(`file:///${_path}/lib/components/Models.js`))
// console.log(MysUser)
// let uid =await MysUser.getUidByCookie();
// console.log(uid)
// let {
// bing
// } = (await import(`file:///${_path}/lib/app/gachaLog.js`))
// let userCk = (await checkAuth(e, "cookie"))
// e.uid = userCk.uid
e.reply("暂不支持V2")
return true;
}
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")