1.0.2 • Published 5 years ago

huyue-tools-ajax v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

使用说明

js 原生ajax 方法

  1. 安装
npm i huyue-tools-ajax --save
  1. 引入
import hyAjax from 'huyue-tools-ajax'
  1. 使用

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)
    }
})

  1. 更新
npm update huyue-tools-ajax
1.0.2

5 years ago

1.0.1

5 years ago