feat: 增加充值功能

This commit is contained in:
archer
2023-03-21 23:14:28 +08:00
parent 129f3a2a30
commit d065539707
24 changed files with 389 additions and 35 deletions

View File

@@ -22,8 +22,12 @@ export const generateToken = (userId: string) => {
};
/* 校验 token */
export const authToken = (token: string): Promise<string> => {
export const authToken = (token?: string): Promise<string> => {
return new Promise((resolve, reject) => {
if (!token) {
reject('缺少登录凭证');
return;
}
const key = process.env.TOKEN_KEY as string;
jwt.verify(token, key, function (err, decoded: any) {