mirror of
https://github.com/certd/certd.git
synced 2026-04-26 05:37:25 +08:00
chore: user profile
This commit is contained in:
@@ -9,7 +9,7 @@ import { cache, logger, mergeUtils, setGlobalProxy } from '@certd/basic';
|
|||||||
import * as dns from 'node:dns';
|
import * as dns from 'node:dns';
|
||||||
import { BaseService, setAdminMode } from '../../../basic/index.js';
|
import { BaseService, setAdminMode } from '../../../basic/index.js';
|
||||||
import { executorQueue } from '../../basic/service/executor-queue.js';
|
import { executorQueue } from '../../basic/service/executor-queue.js';
|
||||||
import { isComm } from '@certd/plus-core';
|
import { isComm, isPlus } from '@certd/plus-core';
|
||||||
const { merge } = mergeUtils;
|
const { merge } = mergeUtils;
|
||||||
|
|
||||||
let lastSaveEnvVars = {};
|
let lastSaveEnvVars = {};
|
||||||
@@ -155,7 +155,9 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
|
|||||||
|
|
||||||
async reloadPublicSettings() {
|
async reloadPublicSettings() {
|
||||||
const publicSetting = await this.getPublicSettings()
|
const publicSetting = await this.getPublicSettings()
|
||||||
setAdminMode(publicSetting.adminMode)
|
if (isPlus()){
|
||||||
|
setAdminMode(publicSetting.adminMode )
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async reloadPrivateSettings() {
|
async reloadPrivateSettings() {
|
||||||
|
|||||||
@@ -46,8 +46,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-wrap">
|
<div class="flex flex-wrap">
|
||||||
<div class="w-full md:w-1/2 md:pr-2">
|
<div v-if="settingStore.sysPublic.oauthEnabled && settingStore.isPlus" class="w-full md:w-1/2">
|
||||||
<div v-if="settingStore.sysPublic.oauthEnabled && settingStore.isPlus" class="bindings-card md:rounded">
|
<div class="bindings-card md:rounded">
|
||||||
<div class="card-title">
|
<div class="card-title">
|
||||||
<fs-icon icon="ion:link-outline" class="title-icon" />
|
<fs-icon icon="ion:link-outline" class="title-icon" />
|
||||||
<span>第三方账号绑定</span>
|
<span>第三方账号绑定</span>
|
||||||
@@ -80,8 +80,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="w-full md:w-1/2 md:pl-2">
|
<div v-if="settingStore.sysPublic.passkeyEnabled && settingStore.isPlus" class="w-full md:w-1/2">
|
||||||
<div v-if="settingStore.sysPublic.passkeyEnabled && settingStore.isPlus" class="passkey-card md:rounded">
|
<div class="passkey-card md:rounded">
|
||||||
<div class="card-title">
|
<div class="card-title">
|
||||||
<fs-icon icon="ion:finger-print" class="title-icon" />
|
<fs-icon icon="ion:finger-print" class="title-icon" />
|
||||||
<span>Passkey 安全密钥</span>
|
<span>Passkey 安全密钥</span>
|
||||||
@@ -490,16 +490,17 @@ onMounted(async () => {
|
|||||||
.profile-container {
|
.profile-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 20px;
|
gap: 10px;
|
||||||
// max-width: 1000px;
|
// max-width: 1000px;
|
||||||
|
|
||||||
.profile-card,
|
.profile-card,
|
||||||
.bindings-card,
|
.bindings-card,
|
||||||
.passkey-card {
|
.passkey-card {
|
||||||
background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
|
background: #fff;
|
||||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
|
margin: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bindings-card,
|
.bindings-card,
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</template>
|
</template>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane key="passkey" :tab="t('authentication.passkeyTab')">
|
<a-tab-pane v-if="settingStore.sysPublic.passkeyEnabled && settingStore.isPlus" key="passkey" :tab="t('authentication.passkeyTab')">
|
||||||
<template v-if="formState.loginType === 'passkey'">
|
<template v-if="formState.loginType === 'passkey'">
|
||||||
<div v-if="!passkeySupported" class="text-red-500 text-sm mt-2 text-center mb-10">
|
<div v-if="!passkeySupported" class="text-red-500 text-sm mt-2 text-center mb-10">
|
||||||
{{ t("authentication.passkeyNotSupported") }}
|
{{ t("authentication.passkeyNotSupported") }}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
CREATE TABLE `sys_passkey`
|
||||||
|
(
|
||||||
|
`id` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||||
|
`user_id` bigint NOT NULL,
|
||||||
|
`device_name` varchar(100) NOT NULL,
|
||||||
|
`passkey_id` varchar(100) NOT NULL,
|
||||||
|
`public_key` varchar(1024) NOT NULL,
|
||||||
|
`counter` bigint NOT NULL,
|
||||||
|
`transports` varchar(512) NULL,
|
||||||
|
`registered_at` bigint NOT NULL,
|
||||||
|
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
CREATE INDEX `index_passkey_user_id` ON `sys_passkey` (`user_id`);
|
||||||
|
CREATE INDEX `index_passkey_passkey_id` ON `sys_passkey` (`passkey_id`);
|
||||||
|
|
||||||
|
ALTER TABLE `sys_passkey` ENGINE = InnoDB;
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
ALTER TABLE cd_access ADD COLUMN key_id varchar(100) NULL;
|
||||||
|
CREATE INDEX `index_access_key_id` ON `cd_access` (`key_id`);
|
||||||
|
update cd_access set key_id = id where key_id is null;
|
||||||
|
|
||||||
|
ALTER TABLE pi_notification ADD COLUMN key_id varchar(100) NULL;
|
||||||
|
CREATE INDEX `index_notification_key_id` ON `pi_notification` (`key_id`);
|
||||||
|
update pi_notification set key_id = id where key_id is null;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE cd_addon ADD COLUMN key_id varchar(100) NULL;
|
||||||
|
CREATE INDEX `index_addon_key_id` ON `cd_addon` (`key_id`);
|
||||||
|
update cd_addon set key_id = id where key_id is null;
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
CREATE TABLE "sys_passkey"
|
||||||
|
(
|
||||||
|
"id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL,
|
||||||
|
"user_id" bigint NOT NULL,
|
||||||
|
"device_name" varchar(100) NOT NULL,
|
||||||
|
"passkey_id" varchar(100) NOT NULL,
|
||||||
|
"public_key" varchar(1024) NOT NULL,
|
||||||
|
"counter" bigint NOT NULL,
|
||||||
|
"transports" varchar(512) NULL,
|
||||||
|
"registered_at" bigint NOT NULL,
|
||||||
|
"create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||||
|
"update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
CREATE INDEX "index_passkey_user_id" ON "sys_passkey" ("user_id");
|
||||||
|
CREATE INDEX "index_passkey_passkey_id" ON "sys_passkey" ("passkey_id");
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
ALTER TABLE cd_access ADD COLUMN key_id varchar(100) NULL;
|
||||||
|
CREATE INDEX "index_access_key_id" ON "cd_access" ("key_id");
|
||||||
|
update cd_access set key_id = id where key_id is null;
|
||||||
|
|
||||||
|
ALTER TABLE pi_notification ADD COLUMN key_id varchar(100) NULL;
|
||||||
|
CREATE INDEX "index_notification_key_id" ON "pi_notification" ("key_id");
|
||||||
|
update pi_notification set key_id = id where key_id is null;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE cd_addon ADD COLUMN key_id varchar(100) NULL;
|
||||||
|
CREATE INDEX "index_addon_key_id" ON "cd_addon" ("key_id");
|
||||||
|
update cd_addon set key_id = id where key_id is null;
|
||||||
Reference in New Issue
Block a user