Skip to content

Commit 76282db

Browse files
committed
fix: 权限判断
1 parent d5e6fe2 commit 76282db

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/apps/update.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ export const updatePlugin = karin.command(/^#(全部)?(强制)?更新(.*)?$/, as
164164
let res
165165
if (name !== 'node-karin') {
166166
const info = getPluginInfo(name.trim())
167-
if (!info) return await e.reply('插件未安装~', { reply: true })
167+
if (!info) {
168+
await e.reply('插件未安装~', { reply: true })
169+
return false
170+
}
168171
if (info.type === 'app') return await e.reply('应用插件不支持更新~', { reply: true })
169172
res = info.type === 'git'
170173
? await updateGitPlugin(info.dir, cmd, 120)
@@ -180,7 +183,7 @@ export const updatePlugin = karin.command(/^#(全部)?(强制)?更新(.*)?$/, as
180183
}
181184
return await e.reply(`\n更新成功\n${res.data}`, { at: true })
182185
}
183-
})
186+
}, { name: '更新插件', perm: 'admin', priority: 100 })
184187
/** 检查更新 */
185188
export const check = karin.command(/^#/, async (e) => {
186189
let name = e.msg.replace(/^#/, '').trim()

0 commit comments

Comments
 (0)