Skip to content

Commit

Permalink
Add assets
Browse files Browse the repository at this point in the history
  • Loading branch information
shanyan-wcx committed May 8, 2024
1 parent ab818c3 commit e207380
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const swaggerDocument = YAML.load(yamlFile);
const app = express();
const port = 7814;

// 使用 JSON 解析�间件
// 使用 JSON 解析中间件
app.use(express.urlencoded({ extended: true }));
app.use(express.json({ encoding: 'utf-8' }));

Expand All @@ -37,7 +37,7 @@ app.get('/search', (req, res) => {
var data = [];
var ret = 200;
var msg;
console.log(`开始搜� - 标�:${query};作者:${author}`);
console.log(`开始搜索 - 标题:${query};作者:${author}`);
if (query) {
kw = query;
} else if (author) {
Expand Down Expand Up @@ -81,19 +81,19 @@ app.get('/search', (req, res) => {
genres: [element.category_title],
tags: tags,
series: undefined,
language: element.category_title === "外è??" ? "外è??" : "ä¸?æ–?",
language: element.category_title === "外语" ? "外语" : "中文",
duration: undefined
};
});
console.log(`搜索结果�${books.length}�`);
console.log(`搜索结果:${books.length}`);
console.log(books);
res.status(200).json({ matches: books });
} else {
res.status(200).json({ matches: [] });
}
});

// é”™è??处理
// 错误处理
app.use((err, req, res, next) => {
console.error(err.stack);
res.status(500).send('Something broke!');
Expand Down
File renamed without changes

0 comments on commit e207380

Please sign in to comment.