fix(auth): 重构登录认证,并支持跳转到关联服务如图纸标注
This commit is contained in:
1 parent
ce1fd59f61
commit
affe139bf9
51 files changed
+1939
-132
No files matched your search
@@ -1,6 +1,8 @@
|
||||
/**
|
||||
* features/chat/components/ChatMobileHeader.vue
|
||||
* 移动端顶栏:Agent 名称、学习之窗与 Agent 切换弹层。
|
||||
* 移动端顶栏:Agent 名称、学习之窗、关联服务入口与 Agent 切换弹层。
|
||||
* 依赖:AgentCategoryList、ExternalSystemLinks。
|
||||
* 逻辑:关联服务 compact 按钮与右侧 Agent/历史按钮同为 h-9 圆形图标。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
@@ -77,7 +79,12 @@ onBeforeUnmount(() => {
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex items-center gap-1">
|
||||
<ExternalSystemLinks compact :show-label="false" />
|
||||
<ExternalSystemLinks
|
||||
compact
|
||||
:show-label="false"
|
||||
button-class="flex h-9 w-9 items-center justify-center rounded-full text-muted transition-colors hover-surface-soft"
|
||||
icon-class="h-4 w-4 shrink-0"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-9 w-9 items-center justify-center rounded-full text-muted transition-colors hover-surface-soft"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* 依赖:lucide-vue-next、LocaleToggleButton、ExternalSystemLinks、AgentCategoryList、chat.types。
|
||||
* 逻辑:由聊天页面传入当前 Agent、历史记录与用户可用 Agent;通过事件把新会话、切换 Agent、反馈、进入管理控制台等操作回传给页面。
|
||||
* 管理员通过底部右侧工具图标进入管理控制台;用户下拉菜单仅保留退出登录。
|
||||
* 关联服务入口与主题/语言等底栏图标统一为同尺寸 inline icon 按钮,避免错位。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
@@ -129,7 +130,12 @@ const userInitial = (fallback: string) => {
|
||||
</button>
|
||||
|
||||
<div class="mt-auto flex flex-col items-center gap-6 pb-2 text-muted">
|
||||
<ExternalSystemLinks compact :show-label="false" />
|
||||
<ExternalSystemLinks
|
||||
compact
|
||||
:show-label="false"
|
||||
button-class="inline-flex items-center justify-center transition-colors hover:text-secondary"
|
||||
icon-class="h-5 w-5 shrink-0"
|
||||
/>
|
||||
<button type="button" class="transition-colors hover:text-secondary"><Sparkles class="h-5 w-5" /></button>
|
||||
<div class="flex h-8 w-8 items-center justify-center rounded-full bg-brand-600 text-sm font-bold text-white shadow-sm shadow-brand-500/20">
|
||||
{{ userInitial('I') }}
|
||||
@@ -302,11 +308,16 @@ const userInitial = (fallback: string) => {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-3">
|
||||
<ExternalSystemLinks compact :show-label="false" />
|
||||
<div class="flex items-center gap-3">
|
||||
<ExternalSystemLinks
|
||||
compact
|
||||
:show-label="false"
|
||||
button-class="inline-flex items-center justify-center transition-colors hover:text-secondary"
|
||||
icon-class="h-4 w-4 shrink-0"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
class="transition-colors hover:text-secondary"
|
||||
class="inline-flex items-center justify-center transition-colors hover:text-secondary"
|
||||
:title="appliedTheme === 'dark' ? ($t('theme.switchToLight') || 'Switch to light mode') : ($t('theme.switchToDark') || 'Switch to dark mode')"
|
||||
@click="emit('toggle-theme')"
|
||||
>
|
||||
@@ -314,16 +325,16 @@ const userInitial = (fallback: string) => {
|
||||
<Moon v-else class="h-4 w-4" />
|
||||
</button>
|
||||
<LocaleToggleButton variant="sidebar" />
|
||||
<button type="button" class="transition-colors hover:text-secondary" :title="$t('chat.generalFeedback')" @click="emit('open-feedback')">
|
||||
<button type="button" class="inline-flex items-center justify-center transition-colors hover:text-secondary" :title="$t('chat.generalFeedback')" @click="emit('open-feedback')">
|
||||
<MessageSquareText class="h-4 w-4" />
|
||||
</button>
|
||||
<button type="button" class="transition-colors hover:text-secondary" :title="$t('workspace.title')" @click="emit('go-workspace')">
|
||||
<button type="button" class="inline-flex items-center justify-center transition-colors hover:text-secondary" :title="$t('workspace.title')" @click="emit('go-workspace')">
|
||||
<Briefcase class="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
v-if="currentUser?.role === 'admin'"
|
||||
type="button"
|
||||
class="transition-colors hover:text-secondary"
|
||||
class="inline-flex items-center justify-center transition-colors hover:text-secondary"
|
||||
:title="$t('admin.title')"
|
||||
@click="onGoAdmin"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user