mirror of
https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git
synced 2024-12-23 03:20:52 +08:00
主人权限修正及更新成功后回复修正
This commit is contained in:
parent
583ee3c064
commit
64c884cddb
@ -110,5 +110,20 @@ export async function getMysApi (e, cfg) {
|
||||
}
|
||||
|
||||
export async function checkAuth (e, cfg) {
|
||||
return new User({ id: e.user_id })
|
||||
let { auth = 'all' } = cfg
|
||||
let uid = await MysInfo.getUid(e)
|
||||
if (!uid) return false
|
||||
|
||||
if (auth === 'master' && !e.isMaster) {
|
||||
return false
|
||||
}
|
||||
|
||||
/* 检查user ck */
|
||||
let isCookieUser = await MysInfo.checkUidBing(uid)
|
||||
if (auth === 'cookie' && !isCookieUser) {
|
||||
e.reply('尚未绑定Cookie...')
|
||||
return false
|
||||
}
|
||||
e.selfUser = new User({ id: e.user_id, uid })
|
||||
return e.selfUser
|
||||
}
|
||||
|
18
index.js
18
index.js
@ -1,9 +1,14 @@
|
||||
// 适配V3 Yunzai,将index.js移至app/index.js
|
||||
import { currentVersion, isV3 } from './components/Changelog.js'
|
||||
import {
|
||||
currentVersion,
|
||||
isV3
|
||||
} from './components/Changelog.js'
|
||||
import Data from './components/Data.js'
|
||||
|
||||
export * from './apps/index.js'
|
||||
let index = { atlas: {} }
|
||||
let index = {
|
||||
atlas: {}
|
||||
}
|
||||
if (isV3) {
|
||||
index = await Data.importModule('/plugins/xiaoyao-cvs-plugin/adapter', 'index.js')
|
||||
console.log(index)
|
||||
@ -12,9 +17,14 @@ export const atlas = index.atlas || {}
|
||||
|
||||
console.log(`图鉴插件${currentVersion}初始化~`)
|
||||
|
||||
setTimeout(async function () {
|
||||
setTimeout(async function() {
|
||||
let msgStr = await redis.get('xiaoyao:restart-msg')
|
||||
let relpyPrivate = async function () {
|
||||
let relpyPrivate = async function() {}
|
||||
if (!isV3) {
|
||||
let common = await Data.importModule('/lib', 'common.js')
|
||||
if (common && common.default && common.default.relpyPrivate) {
|
||||
relpyPrivate = common.default.relpyPrivate
|
||||
}
|
||||
}
|
||||
if (msgStr) {
|
||||
let msg = JSON.parse(msgStr)
|
||||
|
Loading…
Reference in New Issue
Block a user