Skip to content

Commit 95827b2

Browse files
author
pedro
authored
Merge pull request #10 from TaleLin/dev
fix:修复日志的不存在判断问题
2 parents 9cd9f6c + 547b0e6 commit 95827b2

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

app/api/cms/admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ admin.linGet(
153153
v.get("query.page"),
154154
v.get("query.count")
155155
);
156-
if (total < 1) {
156+
if (groups.length < 1) {
157157
throw new NotFound({
158158
msg: "未找到任何权限组"
159159
});

app/api/cms/log.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ log.linGet(
2323
async ctx => {
2424
const v = await new LogFindValidator().validate(ctx);
2525
const { rows, total } = await logDao.getLogs(v);
26-
if (total < 1) {
26+
if (!rows || rows.length < 1) {
2727
throw new NotFound({
2828
msg: "没有找到相关日志"
2929
});
@@ -48,7 +48,7 @@ log.linGet(
4848
const v = await new LogFindValidator().validate(ctx);
4949
const keyword = v.get("query.keyword", false, "");
5050
const { rows, total } = await logDao.searchLogs(v, keyword);
51-
if (total < 1) {
51+
if (!rows || rows.length < 1) {
5252
throw new NotFound({
5353
msg: "没有找到相关日志"
5454
});

0 commit comments

Comments
 (0)