fix: 移除所有权限身份显示,QR上传布局还原为initial commit样式
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 13s
Test / e2e-test (push) Failing after 1m19s

This commit is contained in:
2026-04-08 19:47:20 +00:00
committed by Hera Zhao
parent c8de1ad229
commit dcf516f2de
3 changed files with 22 additions and 75 deletions

View File

@@ -16,7 +16,6 @@
>
<template v-if="auth.isLoggedIn">
👤 {{ auth.user.display_name || auth.user.username }}
<span style="font-size:10px;background:rgba(255,255,255,0.2);padding:2px 7px;border-radius:8px;margin:0 3px;vertical-align:middle;font-weight:400;letter-spacing:0">{{ roleLabel }}</span>
</template>
<template v-else>
@@ -70,7 +69,7 @@
</template>
<script setup>
import { ref, computed, onMounted, watch } from 'vue'
import { ref, onMounted, watch } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { useAuthStore } from './stores/auth'
import { useOilsStore } from './stores/oils'
@@ -88,11 +87,6 @@ const router = useRouter()
const route = useRoute()
const showUserMenu = ref(false)
const roleLabel = computed(() => {
const map = { admin: '管理员', senior_editor: '高级编辑', editor: '编辑', viewer: '查看者' }
return map[auth.user.role] || '查看者'
})
// Sync ui.currentSection from route on load and navigation
const routeToSection = { '/': 'search', '/manage': 'manage', '/inventory': 'inventory', '/oils': 'oils', '/projects': 'projects', '/mydiary': 'mydiary', '/audit': 'audit', '/bugs': 'bugs', '/users': 'users' }
watch(() => route.path, (path) => {

View File

@@ -2,9 +2,6 @@
<div class="usermenu-overlay" @click.self="$emit('close')">
<div class="usermenu-card">
<div class="usermenu-name">{{ auth.user.display_name || auth.user.username }}</div>
<div class="usermenu-role">
<span class="role-badge">{{ roleLabel }}</span>
</div>
<div class="usermenu-actions">
<button class="usermenu-btn" @click="goMyDiary">
@@ -71,16 +68,6 @@ const bugContent = ref('')
const unreadCount = computed(() => notifications.value.filter(n => !n.is_read).length)
const roleLabel = computed(() => {
const map = {
admin: '管理员',
senior_editor: '高级编辑',
editor: '编辑',
viewer: '查看者',
}
return map[auth.user.role] || auth.user.role
})
function formatTime(d) {
if (!d) return ''
return new Date(d + 'Z').toLocaleString('zh-CN', { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' })
@@ -162,13 +149,7 @@ onMounted(loadNotifications)
z-index: 4001;
}
.usermenu-name { font-size: 16px; font-weight: 600; color: #3e3a44; margin-bottom: 4px; }
.usermenu-role { margin-bottom: 14px; }
.role-badge {
display: inline-block; font-size: 11px; padding: 2px 10px;
border-radius: 8px; background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
color: #4a9d7e; font-weight: 500;
}
.usermenu-name { font-size: 16px; font-weight: 600; color: #3e3a44; margin-bottom: 14px; }
.usermenu-actions { display: flex; flex-direction: column; gap: 4px; }
.usermenu-btn {

View File

@@ -130,14 +130,12 @@
<div class="form-group">
<label>我的二维码图片</label>
<div class="qr-preview">
<div class="upload-area qr-upload-area" @click="triggerUpload('qr')">
<img v-if="brandQrImage" :src="brandQrImage" class="qr-img" />
<span v-else class="upload-hint">📲 点击上传</span>
</div>
<div class="upload-area" @click="triggerUpload('qr')">
<img v-if="brandQrImage" :src="brandQrImage" class="upload-preview qr-upload-preview" />
<span v-else class="upload-hint">📲 点击上传二维码图片</span>
</div>
<input ref="qrInput" type="file" accept="image/*" style="display:none" @change="handleUpload('qr', $event)" />
<div class="field-hint" style="text-align:center">上传后将显示在配方卡片右下角</div>
<div class="field-hint">上传后将显示在配方卡片右下角</div>
</div>
<div class="form-group">
@@ -176,10 +174,6 @@
<div class="form-static">{{ auth.user.username }}</div>
</div>
<div class="form-group">
<label>角色</label>
<div class="role-badge-display">{{ roleLabel }}</div>
</div>
</div>
<div class="section-card">
@@ -218,7 +212,7 @@
</template>
<script setup>
import { ref, computed, onMounted, watch } from 'vue'
import { ref, onMounted, watch } from 'vue'
import { useRouter } from 'vue-router'
import { useAuthStore } from '../stores/auth'
import { useOilsStore } from '../stores/oils'
@@ -258,16 +252,6 @@ const newPassword = ref('')
const confirmPassword = ref('')
const businessReason = ref('')
const roleLabel = computed(() => {
const roles = {
admin: '管理员',
senior_editor: '高级编辑',
editor: '编辑',
viewer: '查看者',
}
return roles[auth.user.role] || auth.user.role
})
onMounted(async () => {
await diaryStore.loadDiary()
displayName.value = auth.user.display_name || ''
@@ -812,28 +796,6 @@ async function applyBusiness() {
color: #6b6375;
}
.role-badge-display {
display: inline-block;
font-size: 12px;
padding: 3px 12px;
border-radius: 8px;
background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
color: #4a9d7e;
font-weight: 500;
}
.qr-preview {
margin-top: 10px;
text-align: center;
}
.qr-img {
width: 120px;
height: 120px;
border-radius: 8px;
border: 1.5px solid #e5e4e7;
}
.upload-area {
width: 100%;
min-height: 80px;
@@ -851,6 +813,18 @@ async function applyBusiness() {
border-color: #7ec6a4;
}
.qr-preview {
margin-top: 10px;
text-align: center;
}
.qr-img {
width: 120px;
height: 120px;
border-radius: 8px;
border: 1.5px solid #e5e4e7;
}
.upload-preview {
max-width: 80px;
max-height: 80px;
@@ -862,11 +836,9 @@ async function applyBusiness() {
max-height: 100px;
}
.qr-upload-area {
width: 120px;
height: 120px;
min-height: unset;
border-radius: 8px;
.qr-upload-preview {
max-width: 120px;
max-height: 120px;
}
.field-hint {