diff --git a/src/main.js b/src/main.js index e463008..45bd638 100644 --- a/src/main.js +++ b/src/main.js @@ -7,6 +7,7 @@ import VueAxios from 'vue-axios' import axios from 'axios' // 配置默认axios参数 const service = axios.create({ + baseURL: '/api/heart_dream', timeout: 10000 }) service.interceptors.response.use(response => response.data.data) diff --git a/src/views/History.vue b/src/views/History.vue index 0102c0a..9f675b3 100644 --- a/src/views/History.vue +++ b/src/views/History.vue @@ -30,8 +30,8 @@ export default { async created() { this.history = JSON.parse(localStorage.getItem('card_history') || '[]') if(this.history.length) { - this.cardTypes = await this.$http.get('/api/rainbow_card/card/types') - this.historyCardList = await this.$http.post('/api/rainbow_card/card/list', this.history.map(item => item.num)) + this.cardTypes = await this.$http.get('/rainbow_card/types') + this.historyCardList = await this.$http.post('/rainbow_card/list', this.history.map(item => item.num)) } }, methods: { diff --git a/src/views/Introduce.vue b/src/views/Introduce.vue index 7290c35..e123dd2 100644 --- a/src/views/Introduce.vue +++ b/src/views/Introduce.vue @@ -85,15 +85,15 @@ export default { } }, async created() { - this.cardTypes = await this.$http.get('/api/rainbow_card/card/types') + this.cardTypes = await this.$http.get('/rainbow_card/types') }, methods: { async showCard() { let lastCard = findLastCard() if(lastCard) { - this.currentCard = await this.$http.get('/api/rainbow_card/card/get', {params: {cardNum: lastCard.num}}) + this.currentCard = await this.$http.get('/rainbow_card/get', {params: {cardNum: lastCard.num}}) } else { - this.currentCard = await this.$http.post('/api/rainbow_card/card/random') + this.currentCard = await this.$http.post('/rainbow_card/random') history.push({ date: dayjs().format('YYYY-MM-DD'), num: this.currentCard.num,