This commit is contained in:
手瓜一十雪
2025-01-21 21:43:11 +08:00
parent da94faa9bb
commit 9204b9b286
7 changed files with 192 additions and 180 deletions

View File

@@ -33,23 +33,37 @@
import { ref, watch } from 'vue';
import { HttpServerConfig } from '../../../../src/onebot/config/config';
const defaultConfig: HttpServerConfig = {
name: 'http-server',
enable: false,
port: 3000,
host: '0.0.0.0',
enableCors: true,
enableWebsocket: true,
messagePostFormat: 'array',
token: '',
debug: false
};
const props = defineProps<{
config: HttpServerConfig;
}>();
const config = ref(Object.assign({}, defaultConfig, props.config));
const messageFormatOptions = ref([
{ label: 'Array', value: 'array' },
{ label: 'String', value: 'string' },
]);
watch(
() => props.config.messagePostFormat,
() => config.value.messagePostFormat,
(newValue) => {
if (newValue !== 'array' && newValue !== 'string') {
props.config.messagePostFormat = 'array';
config.value.messagePostFormat = 'array';
}
}
);
</script>
<style scoped></style>
<style scoped></style>