修改接口地址
This commit is contained in:
parent
a5f857c0f4
commit
6016fb5c4d
@ -7,6 +7,7 @@ import VueAxios from 'vue-axios'
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
// 配置默认axios参数
|
// 配置默认axios参数
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
|
baseURL: '/api/heart_dream',
|
||||||
timeout: 10000
|
timeout: 10000
|
||||||
})
|
})
|
||||||
service.interceptors.response.use(response => response.data.data)
|
service.interceptors.response.use(response => response.data.data)
|
||||||
|
|||||||
@ -30,8 +30,8 @@ export default {
|
|||||||
async created() {
|
async created() {
|
||||||
this.history = JSON.parse(localStorage.getItem('card_history') || '[]')
|
this.history = JSON.parse(localStorage.getItem('card_history') || '[]')
|
||||||
if(this.history.length) {
|
if(this.history.length) {
|
||||||
this.cardTypes = await this.$http.get('/api/rainbow_card/card/types')
|
this.cardTypes = await this.$http.get('/rainbow_card/types')
|
||||||
this.historyCardList = await this.$http.post('/api/rainbow_card/card/list', this.history.map(item => item.num))
|
this.historyCardList = await this.$http.post('/rainbow_card/list', this.history.map(item => item.num))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@ -85,15 +85,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
this.cardTypes = await this.$http.get('/api/rainbow_card/card/types')
|
this.cardTypes = await this.$http.get('/rainbow_card/types')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async showCard() {
|
async showCard() {
|
||||||
let lastCard = findLastCard()
|
let lastCard = findLastCard()
|
||||||
if(lastCard) {
|
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 {
|
} else {
|
||||||
this.currentCard = await this.$http.post('/api/rainbow_card/card/random')
|
this.currentCard = await this.$http.post('/rainbow_card/random')
|
||||||
history.push({
|
history.push({
|
||||||
date: dayjs().format('YYYY-MM-DD'),
|
date: dayjs().format('YYYY-MM-DD'),
|
||||||
num: this.currentCard.num,
|
num: this.currentCard.num,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user