mirror of
https://github.com/certd/certd.git
synced 2026-05-16 05:07:32 +08:00
chore: oauth-second
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity('cd_oauth_bind')
|
||||
export class OauthBindEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column({ name: 'user_id', comment: '用户id' })
|
||||
userId: number;
|
||||
|
||||
@Column({ name: 'type', comment: '第三方类型' })
|
||||
type: string; // oidc, wechat, github, gitee , qq , alipay
|
||||
|
||||
@Column({ name: 'open_id', comment: '第三方openid' })
|
||||
openId: string;
|
||||
|
||||
@Column({ name: 'create_time',comment: '创建时间', default: () => 'CURRENT_TIMESTAMP',})
|
||||
createTime: Date;
|
||||
|
||||
@Column({ name: 'update_time', comment: '修改时间',default: () => 'CURRENT_TIMESTAMP',})
|
||||
updateTime: Date;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { SysSettingsService, SysInstallInfo } from "@certd/lib-server";
|
||||
import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
||||
import { SiteInfo ,ISiteInfoGetter} from "@certd/plugin-lib";
|
||||
|
||||
@Provide("siteInfoGetter")
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
export class SiteInfoGetter implements ISiteInfoGetter{
|
||||
@Inject()
|
||||
sysSettingsService: SysSettingsService;
|
||||
|
||||
|
||||
async getSiteInfo(): Promise<SiteInfo> {
|
||||
|
||||
const installInfo = await this.sysSettingsService.getSetting<SysInstallInfo>(SysInstallInfo);
|
||||
|
||||
return {
|
||||
siteUrl: installInfo?.bindUrl || "",
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user