提交 bbf95155 authored 作者: 王鹏飞's avatar 王鹏飞

优化消息页面

上级 3c7d2035
const util = require('../utils/util.js') const util = require('../utils/util.js')
/** /**
* 本API中全部用于 消息 相关接口 * 本API中全部用于 消息 相关接口
*/ */
/* 获取我的消息信息 */ /* 获取我的消息信息 */
...@@ -8,7 +8,8 @@ const getMyMsg = (callback) => { ...@@ -8,7 +8,8 @@ const getMyMsg = (callback) => {
util.requestApi({ util.requestApi({
url: util.config.URL_PATH1 + '/v2/education/message/my', url: util.config.URL_PATH1 + '/v2/education/message/my',
callback: function (res) { callback: function (res) {
let json = res.data.list.map(function (_, i) { let list = Array.isArray(res.data) ? res.data : res.data.list || []
let json = list.map(function (_, i) {
return { return {
isRead: false, isRead: false,
id: _.id, id: _.id,
...@@ -23,4 +24,4 @@ const getMyMsg = (callback) => { ...@@ -23,4 +24,4 @@ const getMyMsg = (callback) => {
} }
module.exports = { module.exports = {
getMyMsg: getMyMsg getMyMsg: getMyMsg
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论