add: 用户鉴权和查询所有用户接口

This commit is contained in:
cancerai committed 2026-10-11 18:01:11 +08:00
commit 861a689759
10 files changed
+349

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
import type { SQL } from "bun";
export async function checkUser(
db: SQL,
name: String,
passwd: String
) {
interface userDTO {
name: String,
}
const rows: userDTO[] = await db`select name from user where name = ${name} and passwd = ${passwd}`
return rows.length == 0 ? false : true
}