修改接口地址

This commit is contained in:
灌糖包子 2024-09-05 16:44:30 +08:00
parent a5f857c0f4
commit 6016fb5c4d
Signed by: sookie
GPG Key ID: 67E8D0AE905C79B0
3 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -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: {

View File

@ -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,