forked from Eddylib/etvp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tridays
committed
Oct 11, 2016
1 parent
884527d
commit 989837d
Showing
9 changed files
with
78 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
/** | ||
* Created by cauchywei on 16/10/11. | ||
*/ | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
/** | ||
* Created by cauchywei on 16/10/11. | ||
*/ | ||
import axios from 'axios' | ||
import MockAdapter from 'axios-mock-adapter' | ||
|
||
var instance = axios.create() | ||
const mock = new MockAdapter(instance) | ||
|
||
mock.onPost('/users/login').reply(200, { | ||
role: 'reader', | ||
role: 'READER', | ||
id: 1, | ||
username: 'cauchywei', | ||
name: 'Wei Qin', | ||
|
@@ -17,11 +14,11 @@ mock.onPost('/users/login').reply(200, { | |
major: 'CS', | ||
phone: '23333', | ||
email: '[email protected]', | ||
remarks: [] | ||
remarks: 'hi' | ||
}) | ||
|
||
mock.onGet('/test').reply(200, { | ||
role: 'reader', | ||
mock.onGet('/users/self/').reply(200, { | ||
role: 'READER', | ||
id: 1, | ||
username: 'cauchywei', | ||
name: 'Wei Qin', | ||
|
@@ -30,7 +27,7 @@ mock.onGet('/test').reply(200, { | |
major: 'CS', | ||
phone: '23333', | ||
email: '[email protected]', | ||
remarks: [] | ||
remarks: 'hi' | ||
}) | ||
|
||
export default instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
/** | ||
* Created by cauchywei on 16/10/11. | ||
*/ | ||
import axios from 'axios' | ||
|
||
export function serviceUrl () { | ||
return 'http://localhsot:8080/api/' | ||
return 'http://xupu.name:6001/' | ||
} | ||
|
||
const instance = axios.create({ | ||
baseURL: serviceUrl(), | ||
timeout: 1000, | ||
headers: {'X-Custom-Header': 'foobar'} | ||
}) | ||
}); | ||
|
||
export default instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters