新增 LinuxDo Oauth2 登录

This commit is contained in:
eoao
2025-11-08 21:33:00 +08:00
parent 3cf347ad7a
commit 8c6cdd0279
19 changed files with 451 additions and 36 deletions

View File

@@ -16,6 +16,8 @@ import saltHashUtils from '../utils/crypto-utils';
import constant from '../const/constant';
import { t } from '../i18n/i18n'
import reqUtils from '../utils/req-utils';
import {oauth} from "../entity/oauth";
import oauthService from "./oauth-service";
const userService = {
@@ -94,6 +96,7 @@ const userService = {
async physicsDelete(c, params) {
const { userId } = params
await accountService.physicsDeleteByUserIds(c, [userId])
await oauthService.deleteByUserId(c, userId);
await orm(c).delete(user).where(eq(user.userId, userId)).run();
await c.env.kv.delete(kvConst.AUTH_INFO + userId);
},
@@ -130,7 +133,13 @@ const userService = {
}
const query = orm(c).select().from(user)
const query = orm(c).select({
...user,
username: oauth.username,
trustLevel: oauth.trustLevel,
avatar: oauth.avatar,
name: oauth.name
}).from(user).leftJoin(oauth, eq(oauth.userId, user.userId))
.where(and(...conditions));