修正V3云崽下的master判定

This commit is contained in:
yoimiya-kokomi 2022-07-26 01:45:44 +08:00
parent 15dd51ca54
commit 9964b5df1f
2 changed files with 19 additions and 4 deletions

View File

@ -110,5 +110,21 @@ 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
}

View File

@ -1,11 +1,10 @@
import { Common, Cfg } from '../components/index.js'
import { renderAvatar } from './character/avatar-card.js'
import { getTargetUid, getProfile, profileHelp, getProfileAll } from './character/profile-common.js'
import { profileArtis } from './character/profile-artis.js'
import { renderProfile } from './character/profile-detail.js'
import { Character } from '../components/models.js'
import { isV3 } from '../components/Changelog.js'
export { enemyLv, getOriginalPicture } from './character/utils.js'
@ -23,7 +22,7 @@ export { wife, pokeWife, wifeReg } from './character/avatar-wife.js'
// 查看当前角色
export async function character (e, { render }) {
let msg = e.raw_message || e.msg
let msg = isV3 ? e.raw_message : e.msg
if (!msg) {
return
}