fix: 修正MeiliSearch配置页面的显示问题
This commit is contained in:
@ -14,7 +14,7 @@
|
||||
<section>
|
||||
<v-form collection="meili_search_config" v-model="formData" ref="form">
|
||||
<v-text-field v-model="formData.host" label="MeiliSearch Host" required />
|
||||
<v-text-field v-model="formData.apiKey" label="API Key" required />
|
||||
<v-text-field v-model="formData.api_key" label="API Key" required />
|
||||
</v-form>
|
||||
<div class="button-group">
|
||||
<v-button v-if="!pending" color="secondary" @click="testConnection">
|
||||
@ -51,16 +51,16 @@ const pending = ref(false);
|
||||
|
||||
let configExists = false;
|
||||
|
||||
const formData = ref<{ host: string; apiKey: string }>({
|
||||
const formData = ref<{ host: string; api_key: string }>({
|
||||
host: '',
|
||||
apiKey: '',
|
||||
api_key: '',
|
||||
});
|
||||
|
||||
const fetchConfig = async () => {
|
||||
const resp = await api.get('/items/meili_search_config?limit=1');
|
||||
if (resp.data.data) {
|
||||
formData.value.host = resp.data.data.host;
|
||||
formData.value.apiKey = resp.data.data.apiKey;
|
||||
formData.value.api_key = resp.data.data.api_key;
|
||||
configExists = true;
|
||||
}
|
||||
};
|
||||
@ -69,7 +69,7 @@ const testConnection = async () => {
|
||||
statusMessage.value = '';
|
||||
try {
|
||||
pending.value = true;
|
||||
const resp = await api.post('/meilisearch/connection-test', { host: formData.value.host, apiKey: formData.value.apiKey });
|
||||
const resp = await api.post('/meilisearch/connection-test', { host: formData.value.host, apiKey: formData.value.api_key });
|
||||
if (resp.data.success) {
|
||||
statusSuccess.value = true;
|
||||
statusMessage.value = '连接成功!';
|
||||
|
||||
Reference in New Issue
Block a user