Open x478328818 opened 5 years ago
var Fly = require("../wx/wx") var fly = new Fly fly.interceptors.request.use((config, promise) => { //给所有请求添加自定义header config.headers["X-Tag"] = "flyio"; return config; }) fly.config.baseURL = "https://wendux.github.io/" Page({ bindViewTap: function() { //调用 fly.get("http://10.10.180.81/doris/1/1.0.0/user/login", { xx: 6 }).then((d) => { //输出请求数据 console.log(d.data) //输出响应头 console.log(d.header) }).catch(err => { console.log(err.status, err.message) }) } })
var Fly = require("../wx/wx") var fly = new Fly fly.interceptors.request.use((config, promise) => { //给所有请求添加自定义header config.headers["X-Tag"] = "flyio"; return config; }) fly.config.baseURL = "https://wendux.github.io/" Page({ bindViewTap: function() { //调用 fly.get("http://10.10.180.81/doris/1/1.0.0/user/login", { xx: 6 }).then((d) => { //输出请求数据 console.log(d.data) //输出响应头 console.log(d.header) }).catch(err => { console.log(err.status, err.message) }) } })