From 6016fb5c4d92a12c28aba42a12f7c5ffb9472b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=8C=E7=B3=96=E5=8C=85=E5=AD=90?= Date: Thu, 5 Sep 2024 16:44:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 1 + src/views/History.vue | 4 ++-- src/views/Introduce.vue | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) 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,