feat: retrun JSON data for pkg
This commit is contained in:
parent
8b99be4e5f
commit
2aa847c71c
|
|
@ -61,8 +61,12 @@ module.exports = async (ctx, next) => {
|
|||
atomlink: ctx.request.href,
|
||||
...ctx.state.data,
|
||||
};
|
||||
if (template) {
|
||||
ctx.body = art(template, data);
|
||||
if (config.isPackage) {
|
||||
ctx.body = data;
|
||||
} else {
|
||||
if (template) {
|
||||
ctx.body = art(template, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,8 +24,9 @@ module.exports = {
|
|||
},
|
||||
{
|
||||
setHeader: () => {},
|
||||
removeHeader: () => {},
|
||||
end: (data) => {
|
||||
resolve(data);
|
||||
resolve(JSON.parse(data));
|
||||
},
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue