feat: R1 重构对称迁移 + 升级依赖 + 配置文件分离
- 命名重构:tenant → customer(对齐后端 R1 重构) - Tenant → Customer / tenant_id → customerId - tenantStore → customerStore / getTenant/setTenant → getCustomer/setCustomer - cookie key tenant → customer, HTTP header tenantId → customerId - 后端契约更新:AuthResponse 加 sub 字段 - 接口 URL 修复:/auth/oidc/callback → /api/v1/auth/oidc/callback - 依赖升级:vue 3.5 / element-plus 2.8 / vite 5 / typescript 5.6 / sass 1.79 - 删 node-sass / scss / sass-loader / moment / mock/index.ts - 配置文件拆分:.env.development / .env.production / .env.example - 删除冗余 view/auth/auth/callback.vue 副本 - .gitignore 增加 dist / .opencode / tmp - 新增 AGENT.md 与后端风格对齐
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<span class="headerAvatar">
|
||||
<template v-if="picType === 'avatar'">
|
||||
<el-avatar v-if="useTenantStore.tenant.headerImg" :size="30" :src="avatar" />
|
||||
<el-avatar v-if="useCustomerStore.customer.headerImg" :size="30" :src="avatar" />
|
||||
<el-avatar v-else :size="30" :src="noAvatar" />
|
||||
</template>
|
||||
<template v-if="picType === 'img'">
|
||||
<img v-if="useTenantStore.tenant.headerImg" :src="avatar" class="avatar">
|
||||
<img v-if="useCustomerStore.customer.headerImg" :src="avatar" class="avatar">
|
||||
<img v-else :src="noAvatar" class="avatar">
|
||||
</template>
|
||||
<template v-if="picType === 'file'">
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { tenantStore } from '@/store/modules/tenant'
|
||||
import { customerStore } from '@/store/modules/customer'
|
||||
import noAvatarPng from '@/assets/nobody.jpg'
|
||||
|
||||
const props = defineProps({
|
||||
@@ -33,13 +33,13 @@ const props = defineProps({
|
||||
})
|
||||
const path = ref(import.meta.env.VITE_BASE_API + '/')
|
||||
const noAvatar = ref(noAvatarPng)
|
||||
const useTenantStore = tenantStore()
|
||||
const useCustomerStore = customerStore()
|
||||
const avatar = computed(() => {
|
||||
if (props.picSrc === '') {
|
||||
if (useTenantStore.tenant.headerImg !== '' && useTenantStore.tenant.headerImg.slice(0, 4) === 'http') {
|
||||
return useTenantStore.tenant.headerImg
|
||||
if (useCustomerStore.customer.headerImg !== '' && useCustomerStore.customer.headerImg.slice(0, 4) === 'http') {
|
||||
return useCustomerStore.customer.headerImg
|
||||
}
|
||||
return path.value + useTenantStore.tenant.headerImg
|
||||
return path.value + useCustomerStore.customer.headerImg
|
||||
} else {
|
||||
if (props.picSrc !== '' && props.picSrc.slice(0, 4) === 'http') {
|
||||
return props.picSrc
|
||||
@@ -61,7 +61,6 @@ const file = computed(() => {
|
||||
align-items: center;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.file {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
|
||||
Reference in New Issue
Block a user