接口更新没有变化时,不记录日志,避免cron多次导入swagger的接口时,导致动态里展示一大堆的无意义日志。

This commit is contained in:
youbl 2018-11-15 19:08:27 +08:00
parent e425cbd7d1
commit 01c3e9a869

View File

@ -628,6 +628,10 @@ class interfaceController extends baseController {
};
this.catModel.get(interfaceData.catid).then(cate => {
let diffView2 = showDiffMsg(jsondiffpatch, formattersHtml, logData);
if (diffView2.length <= 0) {
return; // 没有变化时,不写日志
}
yapi.commons.saveLog({
content: `<a href="/user/profile/${this.getUid()}">${username}</a>
更新了分类 <a href="/project/${cate.project_id}/interface/api/cat_${