Commit aef25083 by 杨明

更改post请求格式

1 parent 46500def
{
"name": "glsx-common",
"version": "1.3.2",
"version": "2.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
......@@ -28,7 +28,8 @@ function Http(options = {}) {
Http.prototype.create = function () {
this.service.interceptors.request.use(
config => {
let { data = {}, sign = true, noSignAttr = [] } = config
let { data = {}, sign = true, noSignAttr = [],noNeed = false} = config
if(!noNeed)
data.sessionId = this.customer.sessionId || data.sessionId
if (sign) {
let _configSign = this.customer.sign || {}
......@@ -40,6 +41,8 @@ Http.prototype.create = function () {
} else if (method == 'post') {
if (config.headers['Content-Type'] == 'multipart/form-data') {
config.data = util.appendFormData(data)
}else if(config.headers['Content-Type'] == 'application/json') {
config.data = data
} else {
config.data = qs.stringify(data)
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!