新增 LinuxDo Oauth2 登录
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user