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 77<script >
88export default {
99 async asyncData ({ app }) {
10- let res = await app .$axios .$get (' foo/bar' )
10+ const res = await app .$axios .$get (' foo/bar' )
1111 return {
1212 res
1313 }
Original file line number Diff line number Diff line change 1010let reqCtr = 1
1111
1212export 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
2116 },
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++ )
2726 }
27+ }
2828}
2929 </script >
Original file line number Diff line number Diff line change 1- export default function ( { $axios, redirect } ) {
1+ export default function ( { $axios } ) {
22 $axios . onRequest ( ( config ) => {
33 // eslint-disable-next-line no-console
44 console . log ( 'SPY: ' + config . url )
You can’t perform that action at this time.
0 commit comments