Authored by 李奇

接口请求METHOD POST变更

... ... @@ -22,7 +22,6 @@ const encryptedUid = uid => crypto.encryption(null, uid + '');
*/
exports.saveMessage = (uid, conversationId, content) => {
let params = {
uid,
conversationId,
content,
encryptedUid: encryptedUid(uid)
... ... @@ -45,7 +44,6 @@ exports.fetchImHistory = (uid, endTime, pageSize, startTime) => {
pageSize = pageSize || 10;
let params = {
uid,
pageSize,
encryptedUid: encryptedUid(uid)
};
... ... @@ -54,7 +52,7 @@ exports.fetchImHistory = (uid, endTime, pageSize, startTime) => {
val && (params[key] = val);
});
return ImService.get('/api/conversationMessage/pageList', params)
return ImService.post('/api/conversationMessage/pageList', params)
.then(result => {
return result;
}, () => {
... ... @@ -74,7 +72,6 @@ exports.fetchImHistory = (uid, endTime, pageSize, startTime) => {
*/
exports.fetchOrderList = (uid, createTimeBegin) => {
let params = {
uid,
encryptedUid: encryptedUid(uid),
imgSize: '90x120',
};
... ... @@ -83,7 +80,7 @@ exports.fetchOrderList = (uid, createTimeBegin) => {
val && (params[key] = val);
});
return ImService.get('/api/order/queryLastTenOrder', params);
return ImService.post('/api/order/queryLastTenOrder', params);
};
... ... @@ -97,7 +94,7 @@ exports.fetchOrderList = (uid, createTimeBegin) => {
```
### 请求参数说明
| 名称 | 类型 | 是否必须 | 描述 |
| -------------- | ------ | ---- | --------------- |
| -------------- | ------ | ---- | --------------- |
| conversationId | long | Y | 会话id |
| uid | int | Y | 用户ID |
|encryptedUid | String |Y |加密的用户标识 |
... ... @@ -111,7 +108,6 @@ exports.fetchOrderList = (uid, createTimeBegin) => {
exports.saveEvalute = (uid, conversationId, promoter, stars, reasonMsg) => {
let params = {
conversationId,
uid,
encryptedUid: encryptedUid(uid),
promoter,
stars,
... ... @@ -128,10 +124,10 @@ exports.saveEvalute = (uid, conversationId, promoter, stars, reasonMsg) => {
exports.queryGlobalOrder = uid => {
let params = {
uId: uid
encryptedUid: encryptedUid(uid)
};
return ImService.get('/api/order/queryGlobalOrder', params);
return ImService.post('/api/order/queryGlobalOrder', params);
};
/**
... ...
... ... @@ -20,10 +20,10 @@ const disableBFCache = require('../../doraemon/middleware/disable-BFCache');
// Your controller here
router.get('/im', disableBFCache, chat.appAdapter, authGuard, chat.page);
router.get('/im/fetchHistory', chat.fetchHistory);
router.post('/im/fetchHistory', chat.fetchHistory);
router.get('/getOrders', chat.getOrders);
router.get('/im/global-list', chat.queryGlobalOrder);
router.get('/im/order-list', chat.fetchOrders);
router.post('/im/global-list', chat.queryGlobalOrder);
router.post('/im/order-list', chat.fetchOrders);
router.get('/im/queryReasons', chat.queryReasons);
router.post('/leavemsg/save.json', chat.saveMSG);
router.post('/im/saveEvalute', chat.saveEvalute);
... ...
... ... @@ -67,20 +67,19 @@ let api = {
fetchOrders: function(type) {
let url = `/service/im/${type}-list`;
return $.get(url, {uid});
return $.post(url, {uid});
},
// 获取10条历史记录
msghistory: function(uid, encryptedUid, endTime) {
let url = '/service/im/fetchHistory';
let data = {
uid,
encryptedUid
};
endTime && (data.endTime = endTime);
return $.get(url, data);
return $.post(url, data);
},
saveEvalute: function(data) {
... ...