1.0.2 • Published 5 years ago
huyue-tools-ajax v1.0.2
使用说明
js 原生ajax 方法
- 安装
npm i huyue-tools-ajax --save
- 引入
import hyAjax from 'huyue-tools-ajax'
- 使用
get 或者 post;
hyAjax({
url:"http://server-name/login",
type:'post',
data:{
username:'username',
password:'password'
},
dataType:'json',
timeout:10000,
contentType:"application/json",
success:function(data){
console.log(data)
}, //异常处理
error:function(e){
console.log(e)
}
})
- 更新
npm update huyue-tools-ajax