File tree 5 files changed +5
-5
lines changed
5 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
declare namespace GetTest {
2
2
interface params {
3
3
a : number
4
+ isLoading ?: boolean
4
5
}
5
6
interface data {
6
7
name : string
Original file line number Diff line number Diff line change 1
1
const commonParams = {
2
- isLoading : true ,
2
+ // ...
3
3
}
4
4
5
5
export function getCommonParams ( ) {
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { AxiosRequestConfig } from 'axios'
2
2
3
3
declare module 'axios' {
4
4
export interface AxiosRequestConfig {
5
- isLoading ?: boolean
6
5
[ propName : string ] : any
7
6
}
8
7
}
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ methods.forEach(
34
34
}
35
35
36
36
return new Promise < any > ( ( resolve ) => {
37
- if ( fullParams . isLoading ) loadingShow ( )
37
+ if ( isLoading ) loadingShow ( )
38
38
axios ( axiosOptions )
39
39
. then ( ( { data } ) => {
40
40
const { fedLogout } = useStore ( 'user' )
@@ -64,7 +64,7 @@ methods.forEach(
64
64
resolve ( null )
65
65
} )
66
66
. finally ( ( ) => {
67
- if ( fullParams . isLoading ) loadingClose ( )
67
+ if ( isLoading ) loadingClose ( )
68
68
} )
69
69
} )
70
70
} ) ,
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const dateVal = ref(new Date())
24
24
const icons = [' foundation-indent-more' , ' foundation-indent-less' ]
25
25
26
26
async function getTest() {
27
- const res = await apiTest .getTest ({ a: 1 })
27
+ const res = await apiTest .getTest ({ a: 1 , isLoading: true })
28
28
if (! res ) return
29
29
console .log (res , 111 )
30
30
// res.data.age
You can’t perform that action at this time.
0 commit comments