evepraisal id
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { evepraisalAxiosInstance } from '@/service';
|
||||||
import { useVModel } from '@vueuse/core';
|
import { useVModel } from '@vueuse/core';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -16,11 +17,28 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
const emit = defineEmits<Emits>();
|
const emit = defineEmits<Emits>();
|
||||||
|
|
||||||
const value = useVModel(props, 'modelValue', emit);
|
const value = useVModel(props, 'modelValue', emit);
|
||||||
|
|
||||||
|
const loadFromId = async (e: Event) => {
|
||||||
|
const input = e.target as HTMLInputElement;
|
||||||
|
const id = input.value;
|
||||||
|
|
||||||
|
if (!id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const response = await evepraisalAxiosInstance.get(`/a/${id}.json`);
|
||||||
|
|
||||||
|
if (response.status !== 200) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
value.value = JSON.stringify(response.data);
|
||||||
|
input.value = '';
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="flex-1 mx-1">
|
<div class="flex-1 mx-1">
|
||||||
<span>{{ name }}</span>
|
<span>{{ name }}</span><input type="text" class="border rounded ms-2 px-1" @change="loadFromId" placeholder="id evepraisal" />
|
||||||
<textarea class="w-full border rounded" v-model="value" />
|
<textarea class="w-full border rounded mt-1" v-model="value" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -6,4 +6,12 @@ export const apiAxiosInstance = axios.create({
|
|||||||
'accept': 'application/json',
|
'accept': 'application/json',
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
},
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export const evepraisalAxiosInstance = axios.create({
|
||||||
|
baseURL: '/appraisal/',
|
||||||
|
headers: {
|
||||||
|
'accept': 'application/json',
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
},
|
||||||
})
|
})
|
||||||
@@ -20,6 +20,12 @@ export default defineConfig({
|
|||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
followRedirects: true,
|
followRedirects: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
|
},
|
||||||
|
'/appraisal/': {
|
||||||
|
target: 'https://evepraisal.shendai.rip/',
|
||||||
|
changeOrigin: true,
|
||||||
|
followRedirects: true,
|
||||||
|
rewrite: (path) => path.replace(/^\/appraisal/, ''),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user