Skip to content

Commit 499f4b4

Browse files
committed
:test: ajax tested
1 parent 038bbbb commit 499f4b4

File tree

5 files changed

+27
-10
lines changed

5 files changed

+27
-10
lines changed

src/components/Thefooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function toGithub() {
1818
<template>
1919
<nav class="nav space-x-1">
2020
<Icon @click="toggleTheme" class="text-xl text-zinc-400 cursor-pointer hover:text-emerald-900" :icon="getTheme()" />
21-
<a href='https://github.com/coderbaozi'><Icon class="text-xl text-zinc-400 cursor-pointer hover:text-emerald-900" icon="uil:github" /></a>
21+
<a href='https://github.com/coderbaozi/bollo-lite'><Icon class="text-xl text-zinc-400 cursor-pointer hover:text-emerald-900" icon="uil:github" /></a>
2222
</nav>
2323
</template>
2424

src/service/__test__/test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import fetcher from "../index"
2+
3+
export async function testRequest() {
4+
return await fetcher.get({url:``})
5+
}

src/service/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import Request from './request'
22

33
// replace ajax lib may be causes a name conflict
4-
const fetch = new Request({
5-
baseURL: '',
4+
const fetcher = new Request({
5+
// test example
6+
baseURL: 'https://v.api.aa1.cn/api/yiyan/index.php',
67
timeout: 3000,
78
interceptors: {
89
requestSuccessFn: (config) => {
@@ -20,4 +21,4 @@ const fetch = new Request({
2021
}
2122
})
2223

23-
export default fetch
24+
export default fetcher

src/stores/__test__/__test__.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { defineStore } from 'pinia'
2+
import { testRequest } from "@/service/__test__/test";
3+
4+
const useTestStore = defineStore('test',{
5+
6+
state: ():any => {
7+
return { testData:null}
8+
},
9+
10+
actions:{
11+
async testAction() {
12+
this.testData = await testRequest()
13+
}
14+
}
15+
})
16+
17+
export default useTestStore

src/stores/__test__/test.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)