//后台异步路由
router.get('/url', async (ctx, next) => {
const content = await getData();
const p = Immutable.fromJS(content);
ctx.body = p;
await next();
})
//前台异步代码
$.ajax({
url: `${ROOT_URL}/api/vols/content/${id}`,
success: function(e){
console.log(Immutable.fromJS(e));
}
});
我在后台先用Immutable
封装好了数据然后再返回给ajax
但是ajax接收到的却是一个普通的没封装前的obj?