Commit e8c1abe3 by li_hongchao

http.js优化,添加默认值

parent 424902d8
......@@ -35,7 +35,7 @@ export default {
* @date: 2022/1/5 11:31
*/
yhList() {
return fHttp.get(_path.ljkyh + 'getUserAndUserGroup', {})
return fHttp.get(_path.ljkyh + 'getUserAndUserGroup')
},
/**
......
......@@ -216,7 +216,7 @@ export default {
/**
* 封装get方法
*/
get(url, data) {
get(url, data = {}) {
return new Promise((resolve, reject) => {
common
.get(url, {
......@@ -235,7 +235,7 @@ export default {
/**
* 封装post请求
*/
post(url, data, config) {
post(url, data = {}, config = {}) {
return new Promise((resolve, reject) => {
common.post(url, qs.stringify(data), config)
.then(response => {
......@@ -251,7 +251,7 @@ export default {
/**
* 封装post请求 multipart/form-data
*/
postform(url, data, config) {
postform(url, data = {}, config = {}) {
return new Promise((resolve, reject) => {
instance.post(url, data, config).then(response => {
logger.net(data, url, response)
......@@ -265,7 +265,7 @@ export default {
/**
* 封装post请求 文件下载
*/
postdown(url, data, config) {
postdown(url, data = {}, config = {}) {
return new Promise((resolve, reject) => {
down.post(url, data, config).then(response => {
logger.net(data, url, response)
......@@ -280,7 +280,7 @@ export default {
/**
* 封装post请求 json格式
*/
postJson(url, data, config) {
postJson(url, data = {}, config = {}) {
return new Promise((resolve, reject) => {
json.post(url, data, config).then(response => {
logger.net(data, url, response)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment