-
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
Showing
3 changed files
with
32 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,20 @@ | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<script src="https://unpkg.com/[email protected]/dist/axios.min.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/qs.js"></script> | ||
<title>static</title> | ||
</head> | ||
<body> | ||
测试静态资源请求 | ||
|
||
<script> | ||
async function urlParam() { | ||
const res = await axios.get('/api/person/1'); | ||
console.log('Get /api/persion ->', res.data) | ||
} | ||
urlParam(); | ||
</script> | ||
|
||
<script> | ||
async function query() { | ||
const res = await axios.get('/api/person/find', { | ||
|
@@ -18,9 +27,22 @@ | |
age: 31, | ||
} | ||
}); | ||
console.log('/api/person/find-->', res.data); | ||
console.log('Get /api/person/find-->', res.data); | ||
} | ||
query(); | ||
</script> | ||
|
||
<script> | ||
async function formUrlEncoded() { | ||
const res = await axios.post('/api/person', Qs.stringify({ | ||
name: 'cwy007', | ||
age: 32, | ||
}), { | ||
headers: { 'content-type': 'application/x-www-form-urlencoded' } | ||
}); | ||
console.log('Post /api/person-->', res.data) | ||
} | ||
formUrlEncoded(); | ||
</script> | ||
</body> | ||
</html> |
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 +1,4 @@ | ||
export class CreatePersonDto {} | ||
export class CreatePersonDto { | ||
name: string; | ||
age: number; | ||
} |
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