Commit 3c56787e by zhanghaozhe

Merge branch 'study' into search

parents d07c2bc6 d87ff37b
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import { Course, Tag } from '../../../common' import { Course, Tag } from '../../../common'
import { api } from '@/utils' import { http, api } from '@/utils'
import './free-courses.scss' import './free-courses.scss'
...@@ -42,11 +42,11 @@ class FreeCourse extends PureComponent { ...@@ -42,11 +42,11 @@ class FreeCourse extends PureComponent {
} }
getFreeCourses = () => { getFreeCourses = () => {
return api.get(`/api/m/free_course/${this.state.page}/${this.state.num}`) return http.get(`${api.home}/m/free_course/${this.state.page}/${this.state.num}`)
} }
getFreeLive = () => { getFreeLive = () => {
return api.get(`/m/live/free_list`) return http.get(`${api.home}/m/live/free_list`)
} }
render() { render() {
......
import { api } from '@/utils' import { http, api } from '@/utils'
export const RECEIVE_MY_COURSES = 'RECEIVE_MY_COURSES' export const RECEIVE_MY_COURSES = 'RECEIVE_MY_COURSES'
...@@ -22,7 +22,7 @@ export const fetchCoursesListIfNeeded = () => (dispatch, getState) => { ...@@ -22,7 +22,7 @@ export const fetchCoursesListIfNeeded = () => (dispatch, getState) => {
} }
export const getMyCourses = payload => dispatch => { export const getMyCourses = payload => dispatch => {
return api.get(`/m/my_course/${payload.page}/${payload.num}`) return http.get(`${api.home}/m/my_course/${payload.page}/${payload.num}`)
.then(res => { .then(res => {
const {data, code, msg} = res.data const {data, code, msg} = res.data
if (data.length === 0) { if (data.length === 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment