Commit 627d0175 by luyt

other:1.cors注释2.list接口添加total

1 parent cd686904
......@@ -42,10 +42,12 @@ class TrackService extends Service {
limit: +params.pageSize || 10,
offset: +params.page || 1,
});
const blogListAndCount = await app.model.Track.findAndCountAll();
return {
code: 200,
message: '查询成功',
data: blogPageList || [],
total: blogListAndCount,
};
}
}
......
......@@ -20,10 +20,10 @@ module.exports = appInfo => {
},
domainWhiteList: [ '*' ],
};
config.cors = {
origin: '*',
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS',
};
// config.cors = {
// origin: '*',
// allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS',
// };
config.sequelize = {
dialect: 'mysql', // support: mysql, mariadb, postgres, mssql
......
......@@ -7,10 +7,10 @@ module.exports = {
// enable: true,
// }
// 跨域配置
cors: {
enable: true,
package: 'egg-cors',
},
// cors: {
// enable: true,
// package: 'egg-cors',
// },
sequelize: {
enable: true,
package: 'egg-sequelize',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!