1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <script src="./src/index.js"></script>
- </head>
- <body>
-
- <script>
- /**
- * 1、函数功能
- */
- // axios({
- // methods:'',
- // url:'',
- // params:{},
- // data:{}
- // }).then(res=>{
- // console.log(res)
- // })
- // axios.get().then()
- // axios.post().then()
- // axios.put().then()
- // axios.delete().then()
- /**
- * 2、axios函数封装
- */
- axios({
- method:'POST',
- url:'https://api.apiopen.top/getJok',
- params:{
- a:1,
- b:2
- },
- data:{
- c:3,
- d:4
- }
- }).then(res=>{
- console.log(res)
- }).catch(reason=>{
- console.log(reason)
- })
- </script>
- </body>
- </html>
|