mirror of
https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git
synced 2025-01-22 13:51:10 +08:00
账号密码登录 改为手动验证
This commit is contained in:
parent
bc7ad7b40e
commit
59c736a489
20
CHANGELOG.md
20
CHANGELOG.md
@ -63,22 +63,4 @@
|
|||||||
* 如果出现了安装其中一个包导致另外的包出问题的请群里询问
|
* 如果出现了安装其中一个包导致另外的包出问题的请群里询问
|
||||||
* 需要完整的cookie内容要包含`login_ticket`不然是无法实现米游社签到的
|
* 需要完整的cookie内容要包含`login_ticket`不然是无法实现米游社签到的
|
||||||
* 获取到的cookies发送bot后请触发一次`#mys原神签到`指令以保存`stoken`实现自动签到**(注:触发指令后无需多次获取cookies)**
|
* 获取到的cookies发送bot后请触发一次`#mys原神签到`指令以保存`stoken`实现自动签到**(注:触发指令后无需多次获取cookies)**
|
||||||
* `stoken`文件数据在**xiaoyao-cvs-plugin/data/yaml/**目录下
|
* `stoken`文件数据在**xiaoyao-cvs-plugin/data/yaml/**目录下
|
||||||
|
|
||||||
# 1.1.0
|
|
||||||
* 增加`#图鉴帮助`用于查看帮助命令
|
|
||||||
* 增加`#图鉴设置`用于设置图鉴相关功能
|
|
||||||
* 支持戳一戳返回体力
|
|
||||||
* 需要使用喵喵分支Yunzai以支持此能力,如需切换可在Yunzai跟目录输入下方命令后更新重启
|
|
||||||
* `git remote set-url origin https://gitee.com/yoimiya-kokomi/Yunzai-Bot`
|
|
||||||
* 可通过`#图鉴设置` 关闭戳一戳
|
|
||||||
* 增加`体力推送方法`
|
|
||||||
*可通过修改init.js方法调用实现新版体力推送
|
|
||||||
*具体将**YunzaiApps.dailyNote.DailyNoteTask()**方法改为**YunzaiApps["plugin_xiaoyao-cvs-plugin"].DailyNoteTask()**
|
|
||||||
* 增加`#体力模板2`指定模板
|
|
||||||
*可通过`#体力模板列表`获取你当前已有的模板
|
|
||||||
*通过`#体力模板设置(模板)`来指定你需要的模板
|
|
||||||
*可以通过`#体力模板设置随机`来恢复之前的状态
|
|
||||||
* 增加`#**图鉴`用于查看逍遥全图鉴
|
|
||||||
* 增加`#图鉴更新`用于获取图鉴数据
|
|
||||||
* 增加`#图鉴插件(强制)更新`用于插件包更新
|
|
@ -5,14 +5,15 @@ import mys from "../model/mhyTopUpLogin.js"
|
|||||||
import Common from "../components/Common.js";
|
import Common from "../components/Common.js";
|
||||||
import { bindStoken } from './user.js'
|
import { bindStoken } from './user.js'
|
||||||
import utils from '../model/mys/utils.js';
|
import utils from '../model/mys/utils.js';
|
||||||
|
import {segment} from 'oicq'
|
||||||
const _path = process.cwd();
|
const _path = process.cwd();
|
||||||
export const rule = {
|
export const rule = {
|
||||||
qrCodeLogin: {
|
qrCodeLogin: {
|
||||||
reg: `^#(扫码|二维码|辅助)登录$`,
|
reg: `^#(扫码|二维码|辅助)(登录|绑定|登陆)$`,
|
||||||
describe: "扫码登录"
|
describe: "扫码登录"
|
||||||
},
|
},
|
||||||
UserPassMsg: {
|
UserPassMsg: {
|
||||||
reg: `^#(账号|密码)(密码)?登录$`,
|
reg: `^#(账号|密码)(密码)?(登录|绑定|登陆)$`,
|
||||||
describe: "账号密码登录"
|
describe: "账号密码登录"
|
||||||
},
|
},
|
||||||
UserPassLogin: {
|
UserPassLogin: {
|
||||||
@ -51,14 +52,20 @@ export async function qrCodeLogin(e, { render }) {
|
|||||||
let Mys = new mys(e)
|
let Mys = new mys(e)
|
||||||
let res = await Mys.qrCodeLogin()
|
let res = await Mys.qrCodeLogin()
|
||||||
if (!res?.data) return false;
|
if (!res?.data) return false;
|
||||||
let r= await Common.render(`qrCode/index`, {
|
e._reply=e.reply
|
||||||
|
let sendMsg=[segment.at(e.user_id),'\n请扫码以完成绑定\n']
|
||||||
|
e.reply=(msg)=>{
|
||||||
|
sendMsg.push(msg)
|
||||||
|
}
|
||||||
|
await Common.render(`qrCode/index`, {
|
||||||
url: res.data.url
|
url: res.data.url
|
||||||
}, {
|
}, {
|
||||||
e,
|
e,
|
||||||
render,
|
render,
|
||||||
scale: 1.2,retMsgId: true
|
scale: 1.2,retMsgId: true
|
||||||
})
|
})
|
||||||
utils.recallMsg(e,r,60) //默认60,有需要请自行修改
|
let r= await e._reply(sendMsg)
|
||||||
|
utils.recallMsg(e,r,30) //默认30,有需要请自行修改
|
||||||
res = await Mys.GetQrCode(res.data.ticket)
|
res = await Mys.GetQrCode(res.data.ticket)
|
||||||
if (!res) return true;
|
if (!res) return true;
|
||||||
await bindSkCK(e,res)
|
await bindSkCK(e,res)
|
||||||
@ -67,6 +74,9 @@ export async function qrCodeLogin(e, { render }) {
|
|||||||
|
|
||||||
|
|
||||||
export async function UserPassMsg(e) {
|
export async function UserPassMsg(e) {
|
||||||
|
if (!e.isPrivate) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
let Mys = new mys(e)
|
let Mys = new mys(e)
|
||||||
await Mys.UserPassMsg()
|
await Mys.UserPassMsg()
|
||||||
return true;
|
return true;
|
||||||
|
@ -46,7 +46,7 @@ export default class mysTopLogin {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!res) {
|
if (!res?.data?.payload?.raw) {
|
||||||
await this.e.reply("验证超时", true)
|
await this.e.reply("验证超时", true)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@ export default class mysTopLogin {
|
|||||||
|
|
||||||
async UserPassMsg() {
|
async UserPassMsg() {
|
||||||
this.e.reply(this.sendMsgUserPassLogin)
|
this.e.reply(this.sendMsgUserPassLogin)
|
||||||
this.e.reply(`请将账号密码用逗号隔开发送以完成绑定\n例:账号xxx@qq.com,密码xxxxx`)
|
this.e.reply(`请将账号密码用逗号隔开私聊发送以完成绑定\n例:账号xxx@qq.com,密码xxxxx`)
|
||||||
}
|
}
|
||||||
async UserPassLogin() {
|
async UserPassLogin() {
|
||||||
let msg = this.e.msg.replace(/账号|密码|:|:/g, '').replace(/,|,/, ',').split(',');
|
let msg = this.e.msg.replace(/账号|密码|:|:/g, '').replace(/,|,/, ',').split(',');
|
||||||
@ -76,19 +76,21 @@ export default class mysTopLogin {
|
|||||||
if (res.retcode == -3101) {
|
if (res.retcode == -3101) {
|
||||||
Bot.logger.mark("[米哈游登录] 正在验证")
|
Bot.logger.mark("[米哈游登录] 正在验证")
|
||||||
this.aigis_captcha_data = JSON.parse(res.aigis_data.data)
|
this.aigis_captcha_data = JSON.parse(res.aigis_data.data)
|
||||||
// let validate = await this.crack_geetest()
|
let vlData = await this.crack_geetest()
|
||||||
let validate = await this.user.getData("validate", this.aigis_captcha_data, false)
|
console.log(vlData)
|
||||||
if (validate?.data?.validate) {
|
// let validate = await this.user.getData("validate", this.aigis_captcha_data, false)
|
||||||
|
if (vlData?.geetest_validate) {
|
||||||
Bot.logger.mark("[米哈游登录] 验证成功")
|
Bot.logger.mark("[米哈游登录] 验证成功")
|
||||||
} else {
|
} else {
|
||||||
Bot.logger.error("[米哈游登录] 验证失败")
|
Bot.logger.error("[米哈游登录] 验证失败")
|
||||||
this.e.reply('接口效验失败,请重新尝试~')
|
this.e.reply('接口效验失败,请重新尝试~')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
let validate=vlData.geetest_validate
|
||||||
let aigis = res.aigis_data.session_id + ";" + Buffer.from(JSON.stringify({
|
let aigis = res.aigis_data.session_id + ";" + Buffer.from(JSON.stringify({
|
||||||
geetest_challenge: validate?.data?.challenge,
|
geetest_challenge: vlData?.geetest_challenge,
|
||||||
geetest_seccode: validate?.data?.validate + "|jordan",
|
geetest_seccode: validate + "|jordan",
|
||||||
geetest_validate: validate?.data?.validate
|
geetest_validate: validate
|
||||||
})).toString("base64")
|
})).toString("base64")
|
||||||
body.headers = {
|
body.headers = {
|
||||||
'x-rpc-aigis': aigis,
|
'x-rpc-aigis': aigis,
|
||||||
|
@ -11,11 +11,20 @@
|
|||||||
.topTitle table{
|
.topTitle table{
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
.txt{
|
||||||
|
text-align: center;
|
||||||
|
color: red;
|
||||||
|
margin-top: 10px;
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
{{/block}}
|
{{/block}}
|
||||||
{{block 'main'}}
|
{{block 'main'}}
|
||||||
<div class="topTitle" style="margin: 0 auth;">
|
<div class="topTitle" style="margin: 0 auth;">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="txt">
|
||||||
|
免责声明:请勿随意扫码,谁触发谁扫码,bot仅提供功能。<br/>如果恶意抢码导致账号出问题的请自行承担后果
|
||||||
</div>
|
</div>
|
||||||
<script src="{{_res_path}}/qrCode/js/jquery-1.10.2.min.js"></script>
|
<script src="{{_res_path}}/qrCode/js/jquery-1.10.2.min.js"></script>
|
||||||
<script src="{{_res_path}}/qrCode/js/jquery.qrcode.min.js"></script>
|
<script src="{{_res_path}}/qrCode/js/jquery.qrcode.min.js"></script>
|
||||||
|
Loading…
Reference in New Issue
Block a user