File tree Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 7
7
<script >
8
8
export default {
9
9
async asyncData ({ app }) {
10
- let res = await app .$axios .$get (' foo/bar' )
10
+ const res = await app .$axios .$get (' foo/bar' )
11
11
return {
12
12
res
13
13
}
Original file line number Diff line number Diff line change 10
10
let reqCtr = 1
11
11
12
12
export default {
13
- computed: {
14
- axiosSessionId () {
15
- return this .$axios .defaults .headers .common .sessionId
16
- },
17
-
18
- axiosEncoding () {
19
- return this .$axios .defaults .headers .common [' accept-encoding' ]
20
- }
13
+ computed: {
14
+ axiosSessionId () {
15
+ return this .$axios .defaults .headers .common .sessionId
21
16
},
22
- async fetch ({app, route}) {
23
- let doLogin = route .query .login !== undefined
24
- if (doLogin) {
25
- app .$axios .setHeader (' sessionId' , reqCtr++ )
26
- }
17
+
18
+ axiosEncoding () {
19
+ return this .$axios .defaults .headers .common [' accept-encoding' ]
20
+ }
21
+ },
22
+ fetch ({ app, route }) {
23
+ const doLogin = route .query .login !== undefined
24
+ if (doLogin) {
25
+ app .$axios .setHeader (' sessionId' , reqCtr++ )
27
26
}
27
+ }
28
28
}
29
29
</script >
Original file line number Diff line number Diff line change 1
- export default function ( { $axios, redirect } ) {
1
+ export default function ( { $axios } ) {
2
2
$axios . onRequest ( ( config ) => {
3
3
// eslint-disable-next-line no-console
4
4
console . log ( 'SPY: ' + config . url )
You can’t perform that action at this time.
0 commit comments