feat: 消息平台热重载

This commit is contained in:
Junyan Qin
2024-11-16 12:40:57 +08:00
parent 3239c9ec3f
commit bb219889e5
14 changed files with 168 additions and 36 deletions

View File

@@ -67,6 +67,12 @@
</v-list-item-title>
</v-list-item>
<v-list-item @click="reload('platform')">
<v-list-item-title>
重载消息平台
</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-list-item>
@@ -137,6 +143,25 @@ function openDocs() {
window.open('https://docs.langbot.app', '_blank')
}
function reload(scope) {
proxy.$axios.post('/system/reload',
{ scope: scope },
{ headers: { 'Content-Type': 'application/json' } }
).then(response => {
if (response.data.code === 0) {
success('消息平台已重载')
// 关闭菜单
} else {
error('消息平台重载失败:' + response.data.message)
}
}).catch(error => {
console.error(error)
error('消息平台重载失败:' + error)
})
}
const aboutDialogShow = ref(false)
function showAboutDialog() {