芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/app.optimyar.com/backend/middlewares/dblogs/index.js
module.exports = strapi => { return { initialize() { strapi.app.use(async (ctx, next) => { try { await next(); } catch (error) { if (typeof error === 'string' || error instanceof String) { strapi.services["system-log"].create({ type: "global", message: error }); } else { strapi.services["system-log"].create({ type: "global", stack: error.stack, message: error.message }); } throw error; } }); }, }; };