Debug axios

This commit is contained in:
liangping 2021-07-22 16:18:47 +08:00
parent 3fb71b2dda
commit db623812aa
5 changed files with 30 additions and 12 deletions

View File

@ -6,9 +6,13 @@ import axios from 'axios'
const axiosIns = axios.create({ const axiosIns = axios.create({
// You can add your headers here // You can add your headers here
// ================================ // ================================
// baseURL: 'https://some-domain.com/api/', baseURL: 'http://lcd.akash.forbole.com',
// timeout: 1000, // timeout: 1000,
// headers: {'X-Custom-Header': 'foobar'} // headers: {'X-Custom-Header': 'foobar'}
headers: {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json',
},
}) })
Vue.prototype.$http = axiosIns Vue.prototype.$http = axiosIns

View File

@ -11,6 +11,7 @@ import App from './App.vue'
// Global Components // Global Components
import './global-components' import './global-components'
import '@/libs/axios'
// 3rd party plugins // 3rd party plugins
import '@/libs/portal-vue' import '@/libs/portal-vue'

View File

@ -199,9 +199,6 @@ import {
BRow, BCol, BCard, BCardTitle, BCardText, BCardBody, BCardFooter, BButton, BProgressBar, BProgress, BBadge, BTooltip, BRow, BCol, BCard, BCardTitle, BCardText, BCardBody, BCardFooter, BButton, BProgressBar, BProgress, BBadge, BTooltip,
} from 'bootstrap-vue' } from 'bootstrap-vue'
import Ripple from 'vue-ripple-directive' import Ripple from 'vue-ripple-directive'
import store from '@/store'
console.log(store.state.chains)
export default { export default {
components: { components: {

View File

@ -1,7 +1,7 @@
<template> <template>
<b-card title="Create Awesome 🙌"> <b-card title="Create Awesome 🙌">
<b-card-text>This is your second page. ]] {{ $t('staking') }} </b-card-text> <b-card-text>This is your second page. ]] {{ $t('staking') }} </b-card-text>
<b-card-text>Chocolate sesame snaps pie carrot cake pastry pie lollipop muffin. Carrot cake dragée chupa chups jujubes. Macaroon liquorice cookie wafer tart marzipan bonbon. Gingerbread jelly-o dragée chocolate.</b-card-text> <b-card-text> {{ info }} Chocolate sesame snaps pie carrot cake pastry pie lollipop muffin. Carrot cake dragée chupa chups jujubes. Macaroon liquorice cookie wafer tart marzipan bonbon. Gingerbread jelly-o dragée chocolate.</b-card-text>
</b-card> </b-card>
</template> </template>
@ -13,6 +13,18 @@ export default {
BCard, BCard,
BCardText, BCardText,
}, },
data() {
return {
info: 'unloaded',
}
},
mounted() {
this.$http.get('/api/node_info', { crossdomain: true }).then(response => {
this.data.info = response.data
}).catch(e => {
this.errors.push(e)
})
},
} }
</script> </script>

View File

@ -42,13 +42,17 @@ module.exports = {
} }
return options return options
}) })
config.module
.rule('i18n')
.resourceQuery(/blockType=i18n/)
.type('javascript/auto')
.use('i18n')
.loader('@intlify/vue-i18n-loader')
.end()
}, },
transpileDependencies: ['vue-echarts', 'resize-detector'], transpileDependencies: ['vue-echarts', 'resize-detector'],
devServer: {
proxy: {
api: {
target: 'https://api.cosmos.network',
changeOrigin: true,
pathRewrite: {
'^/api': '',
},
},
},
},
} }