Commit e89a522f by zhanghaozhe

proxy

parent 0e9cf3bb
import React, { Component } from "react"
import React, { PureComponent } from "react"
import { VList } from '../../../common'
import './my-courses.scss'
import { api } from '@/utils'
......@@ -50,7 +50,7 @@ function AddCourse(props) {
)
}
export default class MyCourses extends Component {
export default class MyCourses extends PureComponent {
handleClick = () => {
console.log(1);
}
......
......@@ -5,7 +5,7 @@ import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import { logger } from 'redux-logger'
// import Router from './router';
import store from './store'
import rootReducers from './store'
import App from './App';
// 默认样式
......@@ -15,12 +15,12 @@ import './assets/css/index.scss';
import './assets/font/iconfont.css';
var tooltore = createStore(store, compose(
var store = createStore(rootReducers, compose(
applyMiddleware(thunk,logger)
))
ReactDOM.render(
<Provider store={tooltore}>
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root'));
\ No newline at end of file
import { BASE_URL as target } from './utils/api'
// import { BASE_URL as target } from './utils/api'
const proxy = require('http-proxy-middleware')
const target = 'http://fast-test.julyedu.com'
module.exports = function (app) {
app.use(proxy(
'/api',
......
import axios from "axios";
import qs from 'qs'
export const BASE_URL = process.env.NODE_ENV === 'development' ? 'http://fast-test.julyedu.com/api': 'https://api.julyedu.com'
export const BASE_URL = process.env.NODE_ENV === 'development' ? '/api': 'https://api.julyedu.com'
const instance = axios.create({
baseURL: BASE_URL,
......
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