feat: 优化上报问题

This commit is contained in:
手瓜一十雪
2024-11-16 11:32:27 +08:00
parent 8981f12b1a
commit 2f61ba7f25
4 changed files with 60 additions and 12 deletions

View File

@@ -7,7 +7,7 @@
<t-input v-model="config.url" />
</t-form-item>
<t-form-item label="消息格式">
<t-input v-model="config.messagePostFormat" />
<t-select v-model="config.messagePostFormat" :options="messageFormatOptions" />
</t-form-item>
<t-form-item label="报告自身消息">
<t-checkbox v-model="config.reportSelfMessage" />
@@ -30,11 +30,23 @@
</template>
<script setup lang="ts">
import { defineProps } from 'vue';
import { defineProps, ref, watch } from 'vue';
import { WebsocketClientConfig } from '../../../../src/onebot/config/config';
defineProps<{
const props = defineProps<{
config: WebsocketClientConfig;
}>();
const messageFormatOptions = ref([
{ label: 'Array', value: 'array' },
{ label: 'String', value: 'string' }
]);
watch(() => props.config.messagePostFormat, (newValue) => {
if (newValue !== 'array' && newValue !== 'string') {
props.config.messagePostFormat = 'array';
}
});
</script>
<style scoped>