Skip to content

二次封装uni-app的uni.request 网络请求接口

Notifications You must be signed in to change notification settings

prenukes/uni-app-http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

uni-app-http

二次封装uni-app的uni.request 网络请求接口

使用

  • 安装
npm install uni-app-http
  • 在main.js中引用
import http from 'uni-app-http' 
http.setHost('you host')
Vue.prototype.$http = http
  • 运用
async onLoad() {
  const end = this.$http.getHost()
  this.$http.get('/xxx').then((e) => {console.log(e, 22)})
  const data = await this.$http.get('/xxx')
} 

方法说明

post

  • url
  • data
  • contentType

get

  • url
  • data

setHost

  • url

getHost

About

二次封装uni-app的uni.request 网络请求接口

Resources

Stars

Watchers

Forks

Packages

No packages published