Skip to content

Commit

Permalink
fix: 不能用 require
Browse files Browse the repository at this point in the history
  • Loading branch information
SALTWOOD committed Nov 1, 2024
1 parent 99e73af commit a253f26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import { CloudFlare } from './certificate-manager/CloudFlare.js';
import { DNSPod } from './certificate-manager/DNSPod.js';
import { ACME } from './certificate-manager/ACME.js';
import { ApiFactory } from './routes/ApiFactory.js';
require("express-async-errors");

//@ts-ignore
await import("express-async-errors")

type Indexable<T> = {
[key: string]: T;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/ApiAdmin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class ApiAdmin {
const id = Number(req.body.id)
const targetUser = inst.db.getEntity<UserEntity>(UserEntity, id);
if (!targetUser) {
res.status(404).send(); // 用户不存在
res.status(404).send();
return;
}
if ((user.isSuperUser <= targetUser.isSuperUser) && user.id !== targetUser.id) {
Expand Down

0 comments on commit a253f26

Please sign in to comment.