eoss-mobiles 0.2.20 → 0.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/checkbox.js +5 -3
- package/lib/eoss-mobile.common.js +52 -39
- package/lib/flow.js +51 -38
- package/lib/index.js +1 -1
- package/lib/picker.js +5 -3
- package/lib/radio.js +5 -3
- package/lib/retrial-auth.js +5 -3
- package/lib/selector.js +5 -3
- package/lib/table-column.js +5 -3
- package/lib/table.js +5 -3
- package/lib/utils/axios.js +4 -3
- package/lib/utils/http.js +1 -0
- package/package.json +1 -1
- package/packages/flow/src/components/Handle.vue +13 -4
- package/packages/flow/src/components/Reject.vue +17 -9
- package/packages/flow/src/components/StartFlow.vue +2 -1
- package/packages/flow/src/components/taskUnionExamine.vue +3 -1
- package/src/index.js +1 -1
- package/src/utils/axios.js +4 -3
- package/src/utils/http.js +4 -3
package/lib/picker.js
CHANGED
|
@@ -1740,8 +1740,8 @@ var axios_ajax = function ajax(url) {
|
|
|
1740
1740
|
withCredentials: false
|
|
1741
1741
|
});
|
|
1742
1742
|
http.interceptors.request.use(function (config) {
|
|
1743
|
-
if (type === 'post' && format) {
|
|
1744
|
-
config.
|
|
1743
|
+
if (type === 'post' && !format) {
|
|
1744
|
+
config.params = external_qs_default.a.stringify(params.params || params);
|
|
1745
1745
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
1746
1746
|
config.headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
|
|
1747
1747
|
}
|
|
@@ -1749,7 +1749,7 @@ var axios_ajax = function ajax(url) {
|
|
|
1749
1749
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
1750
1750
|
config.headers['content-type'] = 'application/json;charset=UTF-8';
|
|
1751
1751
|
}
|
|
1752
|
-
config.
|
|
1752
|
+
config.params = params.params || params;
|
|
1753
1753
|
}
|
|
1754
1754
|
|
|
1755
1755
|
if (util["a" /* default */].getStorage('token')) {
|
|
@@ -1896,6 +1896,7 @@ var base = {
|
|
|
1896
1896
|
}, headers, format);
|
|
1897
1897
|
},
|
|
1898
1898
|
post: function post(url, params, headers, format) {
|
|
1899
|
+
console.log(params, 'params');
|
|
1899
1900
|
if (params.params) {
|
|
1900
1901
|
params.params.userId = params.params.userId || util["a" /* default */].getStorage('userId');
|
|
1901
1902
|
} else {
|
|
@@ -1908,6 +1909,7 @@ var base = {
|
|
|
1908
1909
|
// CONCATENATED MODULE: ./src/utils/http.js
|
|
1909
1910
|
|
|
1910
1911
|
var http_request = function request(options) {
|
|
1912
|
+
console.log(options, 'options');
|
|
1911
1913
|
var fn = void 0;
|
|
1912
1914
|
switch (options.type) {
|
|
1913
1915
|
case 'post':
|
package/lib/radio.js
CHANGED
|
@@ -1740,8 +1740,8 @@ var axios_ajax = function ajax(url) {
|
|
|
1740
1740
|
withCredentials: false
|
|
1741
1741
|
});
|
|
1742
1742
|
http.interceptors.request.use(function (config) {
|
|
1743
|
-
if (type === 'post' && format) {
|
|
1744
|
-
config.
|
|
1743
|
+
if (type === 'post' && !format) {
|
|
1744
|
+
config.params = external_qs_default.a.stringify(params.params || params);
|
|
1745
1745
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
1746
1746
|
config.headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
|
|
1747
1747
|
}
|
|
@@ -1749,7 +1749,7 @@ var axios_ajax = function ajax(url) {
|
|
|
1749
1749
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
1750
1750
|
config.headers['content-type'] = 'application/json;charset=UTF-8';
|
|
1751
1751
|
}
|
|
1752
|
-
config.
|
|
1752
|
+
config.params = params.params || params;
|
|
1753
1753
|
}
|
|
1754
1754
|
|
|
1755
1755
|
if (util["a" /* default */].getStorage('token')) {
|
|
@@ -1896,6 +1896,7 @@ var base = {
|
|
|
1896
1896
|
}, headers, format);
|
|
1897
1897
|
},
|
|
1898
1898
|
post: function post(url, params, headers, format) {
|
|
1899
|
+
console.log(params, 'params');
|
|
1899
1900
|
if (params.params) {
|
|
1900
1901
|
params.params.userId = params.params.userId || util["a" /* default */].getStorage('userId');
|
|
1901
1902
|
} else {
|
|
@@ -1908,6 +1909,7 @@ var base = {
|
|
|
1908
1909
|
// CONCATENATED MODULE: ./src/utils/http.js
|
|
1909
1910
|
|
|
1910
1911
|
var http_request = function request(options) {
|
|
1912
|
+
console.log(options, 'options');
|
|
1911
1913
|
var fn = void 0;
|
|
1912
1914
|
switch (options.type) {
|
|
1913
1915
|
case 'post':
|
package/lib/retrial-auth.js
CHANGED
|
@@ -1744,8 +1744,8 @@ var axios_ajax = function ajax(url) {
|
|
|
1744
1744
|
withCredentials: false
|
|
1745
1745
|
});
|
|
1746
1746
|
http.interceptors.request.use(function (config) {
|
|
1747
|
-
if (type === 'post' && format) {
|
|
1748
|
-
config.
|
|
1747
|
+
if (type === 'post' && !format) {
|
|
1748
|
+
config.params = external_qs_default.a.stringify(params.params || params);
|
|
1749
1749
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
1750
1750
|
config.headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
|
|
1751
1751
|
}
|
|
@@ -1753,7 +1753,7 @@ var axios_ajax = function ajax(url) {
|
|
|
1753
1753
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
1754
1754
|
config.headers['content-type'] = 'application/json;charset=UTF-8';
|
|
1755
1755
|
}
|
|
1756
|
-
config.
|
|
1756
|
+
config.params = params.params || params;
|
|
1757
1757
|
}
|
|
1758
1758
|
|
|
1759
1759
|
if (util["a" /* default */].getStorage('token')) {
|
|
@@ -1900,6 +1900,7 @@ var base = {
|
|
|
1900
1900
|
}, headers, format);
|
|
1901
1901
|
},
|
|
1902
1902
|
post: function post(url, params, headers, format) {
|
|
1903
|
+
console.log(params, 'params');
|
|
1903
1904
|
if (params.params) {
|
|
1904
1905
|
params.params.userId = params.params.userId || util["a" /* default */].getStorage('userId');
|
|
1905
1906
|
} else {
|
|
@@ -1912,6 +1913,7 @@ var base = {
|
|
|
1912
1913
|
// CONCATENATED MODULE: ./src/utils/http.js
|
|
1913
1914
|
|
|
1914
1915
|
var http_request = function request(options) {
|
|
1916
|
+
console.log(options, 'options');
|
|
1915
1917
|
var fn = void 0;
|
|
1916
1918
|
switch (options.type) {
|
|
1917
1919
|
case 'post':
|
package/lib/selector.js
CHANGED
|
@@ -1740,8 +1740,8 @@ var axios_ajax = function ajax(url) {
|
|
|
1740
1740
|
withCredentials: false
|
|
1741
1741
|
});
|
|
1742
1742
|
http.interceptors.request.use(function (config) {
|
|
1743
|
-
if (type === 'post' && format) {
|
|
1744
|
-
config.
|
|
1743
|
+
if (type === 'post' && !format) {
|
|
1744
|
+
config.params = external_qs_default.a.stringify(params.params || params);
|
|
1745
1745
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
1746
1746
|
config.headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
|
|
1747
1747
|
}
|
|
@@ -1749,7 +1749,7 @@ var axios_ajax = function ajax(url) {
|
|
|
1749
1749
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
1750
1750
|
config.headers['content-type'] = 'application/json;charset=UTF-8';
|
|
1751
1751
|
}
|
|
1752
|
-
config.
|
|
1752
|
+
config.params = params.params || params;
|
|
1753
1753
|
}
|
|
1754
1754
|
|
|
1755
1755
|
if (util["a" /* default */].getStorage('token')) {
|
|
@@ -1896,6 +1896,7 @@ var base = {
|
|
|
1896
1896
|
}, headers, format);
|
|
1897
1897
|
},
|
|
1898
1898
|
post: function post(url, params, headers, format) {
|
|
1899
|
+
console.log(params, 'params');
|
|
1899
1900
|
if (params.params) {
|
|
1900
1901
|
params.params.userId = params.params.userId || util["a" /* default */].getStorage('userId');
|
|
1901
1902
|
} else {
|
|
@@ -1908,6 +1909,7 @@ var base = {
|
|
|
1908
1909
|
// CONCATENATED MODULE: ./src/utils/http.js
|
|
1909
1910
|
|
|
1910
1911
|
var http_request = function request(options) {
|
|
1912
|
+
console.log(options, 'options');
|
|
1911
1913
|
var fn = void 0;
|
|
1912
1914
|
switch (options.type) {
|
|
1913
1915
|
case 'post':
|
package/lib/table-column.js
CHANGED
|
@@ -1740,8 +1740,8 @@ var axios_ajax = function ajax(url) {
|
|
|
1740
1740
|
withCredentials: false
|
|
1741
1741
|
});
|
|
1742
1742
|
http.interceptors.request.use(function (config) {
|
|
1743
|
-
if (type === 'post' && format) {
|
|
1744
|
-
config.
|
|
1743
|
+
if (type === 'post' && !format) {
|
|
1744
|
+
config.params = external_qs_default.a.stringify(params.params || params);
|
|
1745
1745
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
1746
1746
|
config.headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
|
|
1747
1747
|
}
|
|
@@ -1749,7 +1749,7 @@ var axios_ajax = function ajax(url) {
|
|
|
1749
1749
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
1750
1750
|
config.headers['content-type'] = 'application/json;charset=UTF-8';
|
|
1751
1751
|
}
|
|
1752
|
-
config.
|
|
1752
|
+
config.params = params.params || params;
|
|
1753
1753
|
}
|
|
1754
1754
|
|
|
1755
1755
|
if (util["a" /* default */].getStorage('token')) {
|
|
@@ -1896,6 +1896,7 @@ var base = {
|
|
|
1896
1896
|
}, headers, format);
|
|
1897
1897
|
},
|
|
1898
1898
|
post: function post(url, params, headers, format) {
|
|
1899
|
+
console.log(params, 'params');
|
|
1899
1900
|
if (params.params) {
|
|
1900
1901
|
params.params.userId = params.params.userId || util["a" /* default */].getStorage('userId');
|
|
1901
1902
|
} else {
|
|
@@ -1908,6 +1909,7 @@ var base = {
|
|
|
1908
1909
|
// CONCATENATED MODULE: ./src/utils/http.js
|
|
1909
1910
|
|
|
1910
1911
|
var http_request = function request(options) {
|
|
1912
|
+
console.log(options, 'options');
|
|
1911
1913
|
var fn = void 0;
|
|
1912
1914
|
switch (options.type) {
|
|
1913
1915
|
case 'post':
|
package/lib/table.js
CHANGED
|
@@ -1628,8 +1628,8 @@ var axios_ajax = function ajax(url) {
|
|
|
1628
1628
|
withCredentials: false
|
|
1629
1629
|
});
|
|
1630
1630
|
http.interceptors.request.use(function (config) {
|
|
1631
|
-
if (type === 'post' && format) {
|
|
1632
|
-
config.
|
|
1631
|
+
if (type === 'post' && !format) {
|
|
1632
|
+
config.params = external_qs_default.a.stringify(params.params || params);
|
|
1633
1633
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
1634
1634
|
config.headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
|
|
1635
1635
|
}
|
|
@@ -1637,7 +1637,7 @@ var axios_ajax = function ajax(url) {
|
|
|
1637
1637
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
1638
1638
|
config.headers['content-type'] = 'application/json;charset=UTF-8';
|
|
1639
1639
|
}
|
|
1640
|
-
config.
|
|
1640
|
+
config.params = params.params || params;
|
|
1641
1641
|
}
|
|
1642
1642
|
|
|
1643
1643
|
if (util["a" /* default */].getStorage('token')) {
|
|
@@ -1784,6 +1784,7 @@ var base = {
|
|
|
1784
1784
|
}, headers, format);
|
|
1785
1785
|
},
|
|
1786
1786
|
post: function post(url, params, headers, format) {
|
|
1787
|
+
console.log(params, 'params');
|
|
1787
1788
|
if (params.params) {
|
|
1788
1789
|
params.params.userId = params.params.userId || util["a" /* default */].getStorage('userId');
|
|
1789
1790
|
} else {
|
|
@@ -1796,6 +1797,7 @@ var base = {
|
|
|
1796
1797
|
// CONCATENATED MODULE: ./src/utils/http.js
|
|
1797
1798
|
|
|
1798
1799
|
var http_request = function request(options) {
|
|
1800
|
+
console.log(options, 'options');
|
|
1799
1801
|
var fn = void 0;
|
|
1800
1802
|
switch (options.type) {
|
|
1801
1803
|
case 'post':
|
package/lib/utils/axios.js
CHANGED
|
@@ -35,8 +35,8 @@ var ajax = function ajax(url) {
|
|
|
35
35
|
withCredentials: false
|
|
36
36
|
});
|
|
37
37
|
http.interceptors.request.use(function (config) {
|
|
38
|
-
if (type === 'post' && format) {
|
|
39
|
-
config.
|
|
38
|
+
if (type === 'post' && !format) {
|
|
39
|
+
config.params = _qs2.default.stringify(params.params || params);
|
|
40
40
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
41
41
|
config.headers['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
|
|
42
42
|
}
|
|
@@ -44,7 +44,7 @@ var ajax = function ajax(url) {
|
|
|
44
44
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
45
45
|
config.headers['content-type'] = 'application/json;charset=UTF-8';
|
|
46
46
|
}
|
|
47
|
-
config.
|
|
47
|
+
config.params = params.params || params;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
if (_util2.default.getStorage('token')) {
|
|
@@ -191,6 +191,7 @@ var base = {
|
|
|
191
191
|
}, headers, format);
|
|
192
192
|
},
|
|
193
193
|
post: function post(url, params, headers, format) {
|
|
194
|
+
console.log(params, 'params');
|
|
194
195
|
if (params.params) {
|
|
195
196
|
params.params.userId = params.params.userId || _util2.default.getStorage('userId');
|
|
196
197
|
} else {
|
package/lib/utils/http.js
CHANGED
|
@@ -9,6 +9,7 @@ var _axios2 = _interopRequireDefault(_axios);
|
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
|
|
11
11
|
var request = function request(options) {
|
|
12
|
+
console.log(options, 'options');
|
|
12
13
|
var fn = void 0;
|
|
13
14
|
switch (options.type) {
|
|
14
15
|
case 'post':
|
package/package.json
CHANGED
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
/>
|
|
260
260
|
</div>
|
|
261
261
|
<!-- 主办 -->
|
|
262
|
-
<div class="item" v-if="isMainSubProcess">
|
|
262
|
+
<div class="item" v-if="isMainSubProcess && isNodeShowProcess">
|
|
263
263
|
<!-- <van-field
|
|
264
264
|
value="主办"
|
|
265
265
|
label="主办"
|
|
@@ -485,6 +485,7 @@ export default {
|
|
|
485
485
|
isOtherUnit: true, //是否是外单位
|
|
486
486
|
isShowNode: false,
|
|
487
487
|
subProcessInfo: '',
|
|
488
|
+
isNodeShowProcess: false, //是否展示主办
|
|
488
489
|
isHiddenOftenOpinion: undefined, //是否隐藏常用意见
|
|
489
490
|
isAddSignList: [{ name: '是', value: '1' }, { name: '否', value: '2' }],
|
|
490
491
|
form: {
|
|
@@ -632,7 +633,7 @@ export default {
|
|
|
632
633
|
},
|
|
633
634
|
computed: {
|
|
634
635
|
subProcessColumns() {
|
|
635
|
-
if (!this.isMainSubProcess) return [];
|
|
636
|
+
if (!this.isMainSubProcess || !this.isNodeShowProcess) return [];
|
|
636
637
|
let data = [];
|
|
637
638
|
let obj = { name: '[部门员工]-' };
|
|
638
639
|
this.nextCurrentOrgObjSelect.map(x => {
|
|
@@ -724,7 +725,8 @@ export default {
|
|
|
724
725
|
Accept: 'application/json,text/plain'
|
|
725
726
|
},
|
|
726
727
|
type: 'post',
|
|
727
|
-
params: formData
|
|
728
|
+
params: formData,
|
|
729
|
+
format:false
|
|
728
730
|
})
|
|
729
731
|
.then(res => {
|
|
730
732
|
const { status, message } = res;
|
|
@@ -892,7 +894,9 @@ export default {
|
|
|
892
894
|
? taskHandleHtmlImg
|
|
893
895
|
: taskHandleHtml,
|
|
894
896
|
type: 'post',
|
|
895
|
-
params: formData
|
|
897
|
+
params: formData,
|
|
898
|
+
format:false
|
|
899
|
+
|
|
896
900
|
}).then(res => {
|
|
897
901
|
this.$toast.clear();
|
|
898
902
|
if (res.status == 'success') {
|
|
@@ -945,6 +949,7 @@ export default {
|
|
|
945
949
|
this.isNextUser = false;
|
|
946
950
|
this.isShowNode = false;
|
|
947
951
|
this.isMainSubProcess = false;
|
|
952
|
+
this.isNodeShowProcess = false;
|
|
948
953
|
this.form.nextNodeId = '';
|
|
949
954
|
this.form.isReturnSubmitter = 0;
|
|
950
955
|
this.form.isUndertakeReply = 0;
|
|
@@ -1406,6 +1411,9 @@ export default {
|
|
|
1406
1411
|
this.countersignaturetypeText = res.data.countersignaturetypeText;
|
|
1407
1412
|
//如果当前为承办节点/会签节点,则展示本单位外单位办理人选择
|
|
1408
1413
|
if (this.nodeType === 1 || this.nodeType === 2) {
|
|
1414
|
+
this.isMainSubProcess === true
|
|
1415
|
+
? (this.isNodeShowProcess = true)
|
|
1416
|
+
: (this.isNodeShowProcess = false);
|
|
1409
1417
|
this.isMainSubProcess === true
|
|
1410
1418
|
? (this.isMainSubProcess = true)
|
|
1411
1419
|
: (this.isMainSubProcess = false);
|
|
@@ -1418,6 +1426,7 @@ export default {
|
|
|
1418
1426
|
this.isHideCurrentOrg = false;
|
|
1419
1427
|
this.isHideOtherOrg = false;
|
|
1420
1428
|
this.isMainSubProcess = false;
|
|
1429
|
+
this.isNodeShowProcess = false
|
|
1421
1430
|
this.isNextUser = true;
|
|
1422
1431
|
// this.isMainSubProcess === true
|
|
1423
1432
|
// ? (this.isMainSubProcess = true)
|
|
@@ -53,13 +53,13 @@ export default {
|
|
|
53
53
|
pendingId: String,
|
|
54
54
|
beforeSubmit: Function,
|
|
55
55
|
baseUrl: String,
|
|
56
|
-
|
|
56
|
+
esign: {
|
|
57
57
|
type: Boolean,
|
|
58
58
|
default: false
|
|
59
59
|
},
|
|
60
|
-
userId:{
|
|
61
|
-
type:String,
|
|
62
|
-
default:''
|
|
60
|
+
userId: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: ''
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
data() {
|
|
@@ -71,9 +71,9 @@ export default {
|
|
|
71
71
|
notificationMsg: undefined, //系统消息
|
|
72
72
|
nextNodeId: undefined,
|
|
73
73
|
loginType: 2, //登录方式
|
|
74
|
-
isImageOpinion:0
|
|
74
|
+
isImageOpinion: 0
|
|
75
75
|
},
|
|
76
|
-
file:'',
|
|
76
|
+
file: '',
|
|
77
77
|
processObj: {
|
|
78
78
|
taskExamine: { nodeName: undefined },
|
|
79
79
|
nodeInfoMap: { nextUserList: [] }
|
|
@@ -114,7 +114,14 @@ export default {
|
|
|
114
114
|
},
|
|
115
115
|
// 提交流程
|
|
116
116
|
onSubmit() {
|
|
117
|
-
if (
|
|
117
|
+
if (
|
|
118
|
+
(!this.form.opinion &&
|
|
119
|
+
this.isBanInputOpinion == 0 &&
|
|
120
|
+
this.form.isImageOpinion == 0) ||
|
|
121
|
+
(!this.file &&
|
|
122
|
+
this.isBanInputOpinion == 0 &&
|
|
123
|
+
this.form.isImageOpinion == 1)
|
|
124
|
+
) {
|
|
118
125
|
this.$toast('请输入审批意见');
|
|
119
126
|
return;
|
|
120
127
|
}
|
|
@@ -134,7 +141,7 @@ export default {
|
|
|
134
141
|
formData.append('file', this.file);
|
|
135
142
|
}
|
|
136
143
|
formData.append('pendingId', this.pendingId);
|
|
137
|
-
this.form.userId = this.userId
|
|
144
|
+
this.form.userId = this.userId;
|
|
138
145
|
for (let key in this.form) {
|
|
139
146
|
if (this.form[key] !== '' && this.form[key] !== undefined) {
|
|
140
147
|
formData.append(key, this.form[key]);
|
|
@@ -151,7 +158,8 @@ export default {
|
|
|
151
158
|
request({
|
|
152
159
|
url: _that.baseUrl ? _that.baseUrl + taskRejectHtml : taskRejectHtml,
|
|
153
160
|
type: 'post',
|
|
154
|
-
params: formData
|
|
161
|
+
params: formData,
|
|
162
|
+
format:false
|
|
155
163
|
}).then(res => {
|
|
156
164
|
if (res.status == 'success') {
|
|
157
165
|
this.$toast('操作成功');
|
|
@@ -309,7 +309,8 @@ export default {
|
|
|
309
309
|
request({
|
|
310
310
|
url: _that.apiBaseUrl ? _that.apiBaseUrl + registerNew : registerNew,
|
|
311
311
|
type: 'post',
|
|
312
|
-
params: formData
|
|
312
|
+
params: formData,
|
|
313
|
+
format:false
|
|
313
314
|
}).then(res => {
|
|
314
315
|
this.$toast.clear();
|
|
315
316
|
if (res.rCode == 0) {
|
package/src/index.js
CHANGED
package/src/utils/axios.js
CHANGED
|
@@ -15,8 +15,8 @@ const ajax = (url, params = {}, headers = {}, format = true, type = 'get') => {
|
|
|
15
15
|
});
|
|
16
16
|
http.interceptors.request.use(
|
|
17
17
|
config => {
|
|
18
|
-
if (type === 'post' && format) {
|
|
19
|
-
config.
|
|
18
|
+
if (type === 'post' && !format) {
|
|
19
|
+
config.params = qs.stringify(params.params || params);
|
|
20
20
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
21
21
|
config.headers['content-type'] =
|
|
22
22
|
'application/x-www-form-urlencoded;charset=UTF-8';
|
|
@@ -25,7 +25,7 @@ const ajax = (url, params = {}, headers = {}, format = true, type = 'get') => {
|
|
|
25
25
|
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
26
26
|
config.headers['content-type'] = 'application/json;charset=UTF-8';
|
|
27
27
|
}
|
|
28
|
-
config.
|
|
28
|
+
config.params = params.params || params;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
if ($.getStorage('token')) {
|
|
@@ -188,6 +188,7 @@ const base = {
|
|
|
188
188
|
);
|
|
189
189
|
},
|
|
190
190
|
post: (url, params, headers, format) => {
|
|
191
|
+
console.log(params, 'params');
|
|
191
192
|
if (params.params) {
|
|
192
193
|
params.params.userId = params.params.userId || $.getStorage('userId');
|
|
193
194
|
} else {
|
package/src/utils/http.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import base from './axios';
|
|
2
2
|
const request = options => {
|
|
3
|
+
console.log(options, 'options');
|
|
3
4
|
let fn;
|
|
4
5
|
switch (options.type) {
|
|
5
6
|
case 'post':
|
|
@@ -19,13 +20,13 @@ const request = options => {
|
|
|
19
20
|
);
|
|
20
21
|
break;
|
|
21
22
|
case 'get':
|
|
22
|
-
fn = base.get(options.url, options.params, options.headers = {});
|
|
23
|
+
fn = base.get(options.url, options.params, (options.headers = {}));
|
|
23
24
|
break;
|
|
24
25
|
case 'GET':
|
|
25
|
-
fn = base.get(options.url, options.params, options.headers = {});
|
|
26
|
+
fn = base.get(options.url, options.params, (options.headers = {}));
|
|
26
27
|
break;
|
|
27
28
|
default:
|
|
28
|
-
fn = base.get(options.url, options.params, options.headers = {});
|
|
29
|
+
fn = base.get(options.url, options.params, (options.headers = {}));
|
|
29
30
|
}
|
|
30
31
|
return fn;
|
|
31
32
|
};
|