chore: Token.ts 單獨成類

This commit is contained in:
CrescentLeaf
2025-09-08 23:16:17 +08:00
parent 4ca3bd44da
commit 3cb9bcc148
2 changed files with 8 additions and 8 deletions

6
server/api/Token.ts Normal file
View File

@@ -0,0 +1,6 @@
export default interface Token {
author: string
auth: string
made_time: number
expired_time: number
}

View File

@@ -1,14 +1,8 @@
import { Buffer } from "node:buffer";
import { Buffer } from "node:buffer"
import config from "../config.ts"
import User from "../data/User.ts"
import crypto from 'node:crypto'
interface Token {
author: string
auth: string
made_time: number
expired_time: number
}
import Token from "./Token.ts"
function normalizeKey(key: string, keyLength = 32) {
const hash = crypto.createHash('sha256')