Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
e89a522f
Commit
e89a522f
authored
May 24, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proxy
parent
0e9cf3bb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
7 deletions
+10
-7
src/components/study/myCourses/index.js
+2
-2
src/index.js
+4
-3
src/setupProxy.js
+3
-1
src/utils/api.js
+1
-1
No files found.
src/components/study/myCourses/index.js
View file @
e89a522f
import
React
,
{
Component
}
from
"react"
import
React
,
{
Pure
Component
}
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
Pure
Component
{
handleClick
=
()
=>
{
console
.
log
(
1
);
}
...
...
src/index.js
View file @
e89a522f
...
...
@@ -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
=
{
tool
tore
}
>
<
Provider
store
=
{
s
tore
}
>
<
App
/>
<
/Provider>
,
document
.
getElementById
(
'root'
));
\ No newline at end of file
src/setupProxy.js
View file @
e89a522f
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'
,
...
...
src/utils/api.js
View file @
e89a522f
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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment