提交 20c838e6 编写于 作者: D DebugIsFalse

fix: 延用系统fetch方法

上级 4edda11e
...@@ -13,14 +13,9 @@ const useFetchRequest = (baseUrl) => { ...@@ -13,14 +13,9 @@ const useFetchRequest = (baseUrl) => {
fetchConfig['Content-Type'] = 'application/json'; fetchConfig['Content-Type'] = 'application/json';
} }
fetchConfig = Object.assign(config, fetchConfig); fetchConfig = Object.assign(config, fetchConfig);
return window.fetch(url, fetchConfig).then(async (response) => { return $fetch(url, fetchConfig).then(async (response) => {
let result = await response.text() console.log(`response:`, response)
try { return response;
result = JSON.parse(result)
} catch(error) {
console.log(error)
}
return result;
}).finally(() => { }).finally(() => {
loading.value = false loading.value = false
}) })
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
</div> </div>
</template> </template>
<script setup> <script setup>
const query = ref(null) const query = ref('')
const selectedRepo = ref(null) const selectedRepo = ref('https://github.com/keycloak/keycloak.git')
const repos = ['keycloak', 'ViewUIPlus'] const repos = ['keycloak', 'ViewUIPlus']
const handleSearch = () => { const handleSearch = () => {
navigateTo(`/search/1?query=${query.value}&repo=${selectedRepo.value}`); navigateTo(`/search/1?query=${query.value}&repo=${selectedRepo.value}`);
......
...@@ -58,9 +58,7 @@ ...@@ -58,9 +58,7 @@
<UIcon name="i-heroicons-chat-bubble-left-right-20-solid" /> <UIcon name="i-heroicons-chat-bubble-left-right-20-solid" />
<span>答案</span> <span>答案</span>
</div> </div>
<article> <MdRenderer :content="item.article" />
{{ item.article }}
</article>
<div class="space-x-2"> <div class="space-x-2">
<UButton size="xs" color="gray" @click="handleCopyMD(index)" leading-icon="i-heroicons-document-duplicate-20-solid" label="复制" /> <UButton size="xs" color="gray" @click="handleCopyMD(index)" leading-icon="i-heroicons-document-duplicate-20-solid" label="复制" />
<UButton size="xs" color="gray" @click="handleShare(index + 1)" leading-icon="i-heroicons-share-20-solid" label="分享" /> <UButton size="xs" color="gray" @click="handleShare(index + 1)" leading-icon="i-heroicons-share-20-solid" label="分享" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册