Authored by 李奇

接口签名添加

... ... @@ -44,8 +44,21 @@ const domains = (req, res) => {
res.json(common.domains);
};
/**
* 消息记录
*/
const history = (req, res, next) => {
let encryptedUid = aes.encryptionUid(req.user.uid);
clientService.getHistory(encryptedUid)
.then(result => {
res.json(result);
}).catch(next);
};
module.exports = {
index,
domains
domains,
history
};
... ...
... ... @@ -30,8 +30,7 @@ let urls = {
* @return { Object } 最近10条订单
*/
const getLastTenOrders = (encryptedUid) => {
return api.get(urls.lastTen, {
method: '',
return api.post(urls.lastTen, {
encryptedUid
});
};
... ... @@ -42,9 +41,7 @@ const getLastTenOrders = (encryptedUid) => {
* @return { Object } 问答列表
*/
const getQas = () => {
return api.get(urls.qas, {
method: ''
});
return api.post(urls.qas, {});
};
/**
... ... @@ -54,7 +51,6 @@ const getQas = () => {
*/
const getCsSetting = (type) => {
return api.get(urls.csSetting, {
method: '',
type
});
};
... ... @@ -66,9 +62,8 @@ const getCsSetting = (type) => {
* @return { Array } 历史聊天记录
*/
const getMsgHistory = (encryptedUid) => {
return api.get(urls.msgHistory, {
encryptedUid,
method: ''
return api.post(urls.msgHistory, {
encryptedUid
});
};
... ...
... ... @@ -68,6 +68,15 @@ const getClientData = (type, encryptedUid) => {
});
};
/**
* 获取最近7天聊天记录
* @param { string } encryptedUid
*/
const getHistory = (encryptedUid) => {
return clientAPI.getMsgHistory(encryptedUid);
};
module.exports = {
getClientData
getClientData,
getHistory
};
... ...
... ... @@ -13,7 +13,8 @@ const cRoot = './controllers';
const client = require(`${cRoot}/client`);
// 在线客服
router.get('/client', auth, client.index); // 在线客服
router.get('/client', auth, client.index); // 在线客服
router.get('/domains', auth, client.domains); // 域名配置
router.post('/history', auth, client.history);// 7天记录
module.exports = router;
... ...
... ... @@ -786,8 +786,8 @@ function pageInit() {
data.endTime = endTime;
}
$.ajax({
type: 'GET',
url: urls.msgHistory,
type: 'POST',
url: '/service/history',
data: data,
success: function(res) {
if (res && res.code === 200) {
... ...