修改接口地址
This commit is contained in:
parent
a5f857c0f4
commit
6016fb5c4d
@ -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)
|
||||
|
||||
@ -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: {
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user