mirror of
https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git
synced 2024-12-22 19:10:53 +08:00
增加#扫码绑定
指令开关(#56)
This commit is contained in:
parent
ee7d0bf5f8
commit
f1cf0a8540
@ -19,6 +19,7 @@ let cfgMap = {
|
|||||||
"模板": "mb.len",
|
"模板": "mb.len",
|
||||||
"获取sk":"ck.sk",
|
"获取sk":"ck.sk",
|
||||||
"目录":"Atlas.all",
|
"目录":"Atlas.all",
|
||||||
|
"扫码绑定":'mhy.qrcode',
|
||||||
};
|
};
|
||||||
let sysCfgReg = `^#图鉴设置\s*(${lodash.keys(cfgMap).join("|")})?\s*(.*)$`;
|
let sysCfgReg = `^#图鉴设置\s*(${lodash.keys(cfgMap).join("|")})?\s*(.*)$`;
|
||||||
export const rule = {
|
export const rule = {
|
||||||
@ -74,6 +75,8 @@ export async function sysCfg(e, {
|
|||||||
val = Math.min(200, Math.max(50, val * 1 || 100));
|
val = Math.min(200, Math.max(50, val * 1 || 100));
|
||||||
}else if(cfgKey === "mb.len"){
|
}else if(cfgKey === "mb.len"){
|
||||||
val= Math.min(2,Math.max(val,0));
|
val= Math.min(2,Math.max(val,0));
|
||||||
|
}else if(cfgKey==='mhy.qrcode'){
|
||||||
|
val= Math.min(3,Math.max(val,0));
|
||||||
} else {
|
} else {
|
||||||
val = !/关闭/.test(val);
|
val = !/关闭/.test(val);
|
||||||
}
|
}
|
||||||
@ -88,6 +91,7 @@ export async function sysCfg(e, {
|
|||||||
len:Cfg.get("mb.len", 0),
|
len:Cfg.get("mb.len", 0),
|
||||||
poke: getStatus("note.poke",false),
|
poke: getStatus("note.poke",false),
|
||||||
isSk: getStatus("ck.sk",false),
|
isSk: getStatus("ck.sk",false),
|
||||||
|
qrcode:Cfg.get("mhy.qrcode", 0),
|
||||||
imgPlus: fs.existsSync(plusPath),
|
imgPlus: fs.existsSync(plusPath),
|
||||||
notePlus: fs.existsSync(notePlus),
|
notePlus: fs.existsSync(notePlus),
|
||||||
bg: await rodom(), //获取底图
|
bg: await rodom(), //获取底图
|
||||||
|
@ -5,6 +5,9 @@ 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 {
|
||||||
|
Cfg,
|
||||||
|
} from "../components/index.js";
|
||||||
const _path = process.cwd();
|
const _path = process.cwd();
|
||||||
export const rule = {
|
export const rule = {
|
||||||
qrCodeLogin: {
|
qrCodeLogin: {
|
||||||
@ -31,7 +34,7 @@ export const rule = {
|
|||||||
export async function payOrder(e, { render }) {
|
export async function payOrder(e, { render }) {
|
||||||
let Mys = new mys(e)
|
let Mys = new mys(e)
|
||||||
if (/(商品|充值)列表/.test(e.msg)) {
|
if (/(商品|充值)列表/.test(e.msg)) {
|
||||||
return await Mys.showgoods( { render })
|
return await Mys.showgoods({ render })
|
||||||
} else if (/(订单|查询)(订单|查询)/.test(e.msg)) {
|
} else if (/(订单|查询)(订单|查询)/.test(e.msg)) {
|
||||||
return await Mys.checkOrder()
|
return await Mys.checkOrder()
|
||||||
} else if (e.msg.includes('充值')) {
|
} else if (e.msg.includes('充值')) {
|
||||||
@ -41,6 +44,17 @@ export async function payOrder(e, { render }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function qrCodeLogin(e, { render }) {
|
export async function qrCodeLogin(e, { render }) {
|
||||||
|
let power = Cfg.get("mhy.qrcode")
|
||||||
|
if (power === 3) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if (power == 2 && !e.isPrivate) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (power == 1 && !e.isGroup) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
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;
|
||||||
@ -89,7 +103,7 @@ export async function UserPassLogin(e) {
|
|||||||
export async function bindSkCK(e, res) {
|
export async function bindSkCK(e, res) {
|
||||||
e.msg = res?.stoken, e.raw_message = res?.stoken
|
e.msg = res?.stoken, e.raw_message = res?.stoken
|
||||||
e.isPrivate = true
|
e.isPrivate = true
|
||||||
await bindStoken(e,'1')
|
await bindStoken(e, '1')
|
||||||
e.ck = res?.cookie, e.msg = res.cookie, e.raw_message = res.cookie;
|
e.ck = res?.cookie, e.msg = res.cookie, e.raw_message = res.cookie;
|
||||||
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
|
||||||
|
@ -119,6 +119,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="cfg-desc">开启后将拦截login_ticket自动获取stoken</div>
|
<div class="cfg-desc">开启后将拦截login_ticket自动获取stoken</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="cfg-li">
|
||||||
|
<div class="cfg-line">
|
||||||
|
扫码绑定
|
||||||
|
<span class="cfg-hint">#图鉴设置扫码绑定 + (0~3)</span>
|
||||||
|
<div class="cfg-status">{{@qrcode}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="cfg-desc">0不限制,1限制群聊使用,2限制私聊使用,3禁用功能</div>
|
||||||
|
</li>
|
||||||
<li class="cfg-li">
|
<li class="cfg-li">
|
||||||
<div class="cfg-line">
|
<div class="cfg-line">
|
||||||
图鉴作为默认帮助
|
图鉴作为默认帮助
|
||||||
|
Loading…
Reference in New Issue
Block a user