feat: 登录改为 Casdoor 统一身份认证(SSO),重建用户体系
- 移除内置密码注册/登录/改密/删号/头像,统一走 Casdoor OIDC 授权码 - 服务端 casdoor-nodejs-sdk:code 换 token + 证书公钥验签 + get-account 补齐资料 - 用户表重建为 provider+provider_id(Casdoor sub 为准),邮箱不再唯一 - 管理员由 Casdoor token 的 isAdmin/IsAdmin 字段或 admin 角色判定,删除角色切换接口 - 前端登录弹窗改为申统认证跳转,注册去 Casdoor;后台用户列表只读角色 - 会话沿用 an_session httpOnly Cookie,requireUser/requireAdmin 守卫保留 - 配置注入 deploy.sh/.env.example;新增 casdoor 单测,删除 password 单测
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<section ref="rootRef" class="relative bg-black text-white min-h-screen flex items-center justify-center overflow-hidden">
|
||||
<section v-if="achievements.length" ref="rootRef" class="relative bg-black text-white min-h-screen flex items-center justify-center overflow-hidden">
|
||||
<!-- 背景粒子 -->
|
||||
<canvas ref="canvasRef" class="absolute inset-0 w-full h-full opacity-30"></canvas>
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
<!-- 描述 -->
|
||||
<div class="flex-1">
|
||||
<h3 class="text-2xl md:text-3xl font-bold mb-3">
|
||||
{{ t(`home.achievements.items.${achievement.id}.title`) }}
|
||||
{{ achievement.title }}
|
||||
</h3>
|
||||
<p class="text-gray-400 text-base md:text-lg leading-relaxed">
|
||||
{{ t(`home.achievements.items.${achievement.id}.description`) }}
|
||||
{{ achievement.description }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,14 +45,16 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import { ref, onMounted, onUnmounted, nextTick, computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import gsap from 'gsap'
|
||||
import { ScrollTrigger } from 'gsap/ScrollTrigger'
|
||||
import { useSiteSettings } from '~/composables/useSiteSettings'
|
||||
|
||||
gsap.registerPlugin(ScrollTrigger)
|
||||
|
||||
const { t } = useI18n()
|
||||
const { locale } = useI18n()
|
||||
const { settings } = useSiteSettings()
|
||||
|
||||
const rootRef = ref<HTMLElement | null>(null)
|
||||
const canvasRef = ref<HTMLCanvasElement | null>(null)
|
||||
@@ -69,37 +71,28 @@ const setNumberRef = (el: any, index: number) => {
|
||||
if (el) numberElements.value[index] = el
|
||||
}
|
||||
|
||||
const achievements = [
|
||||
{
|
||||
id: 'projects',
|
||||
number: 150,
|
||||
suffix: '+',
|
||||
color: 'text-blue-400',
|
||||
bgColor: 'bg-blue-500'
|
||||
},
|
||||
{
|
||||
id: 'clients',
|
||||
number: 85,
|
||||
suffix: '+',
|
||||
color: 'text-purple-400',
|
||||
bgColor: 'bg-purple-500'
|
||||
},
|
||||
{
|
||||
id: 'experience',
|
||||
number: 12,
|
||||
suffix: '+',
|
||||
color: 'text-green-400',
|
||||
bgColor: 'bg-green-500'
|
||||
},
|
||||
{
|
||||
id: 'satisfaction',
|
||||
number: 98,
|
||||
suffix: '%',
|
||||
color: 'text-orange-400',
|
||||
bgColor: 'bg-orange-500'
|
||||
}
|
||||
// 颜色预设按序号循环,后台无需逐条选色
|
||||
const ACHIEVEMENT_STYLES = [
|
||||
{ color: 'text-blue-400', bgColor: 'bg-blue-500' },
|
||||
{ color: 'text-purple-400', bgColor: 'bg-purple-500' },
|
||||
{ color: 'text-green-400', bgColor: 'bg-green-500' },
|
||||
{ color: 'text-orange-400', bgColor: 'bg-orange-500' },
|
||||
]
|
||||
|
||||
const locStr = (zh: string, en: string) => (locale.value === 'zh' ? zh : en)
|
||||
|
||||
// 成就数据来自后台配置(/admin/settings 首页成就数据),空则不渲染该板块
|
||||
const achievements = computed(() =>
|
||||
(settings.value?.achievements ?? []).map((a, i) => ({
|
||||
id: a.id,
|
||||
number: Number(a.number) || 0,
|
||||
suffix: a.suffix,
|
||||
title: locStr(a.titleZh, a.titleEn),
|
||||
description: locStr(a.descriptionZh, a.descriptionEn),
|
||||
...ACHIEVEMENT_STYLES[i % ACHIEVEMENT_STYLES.length],
|
||||
})),
|
||||
)
|
||||
|
||||
// 粒子动画
|
||||
const initParticles = () => {
|
||||
const canvas = canvasRef.value
|
||||
|
||||
@@ -1,18 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onBeforeUnmount, ref } from 'vue'
|
||||
import { onMounted, onBeforeUnmount, ref, computed } from 'vue'
|
||||
import { useNuxtApp } from '#app'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import gsap from 'gsap'
|
||||
import AnimatedButton from '~/components/common/AnimatedButton.vue'
|
||||
import { useSiteSettings } from '~/composables/useSiteSettings'
|
||||
|
||||
const { t } = useI18n()
|
||||
const { settings } = useSiteSettings()
|
||||
|
||||
// 定义背景画廊与主视图绑定的总滚动距离(像素),数值越大,用户向下滚动时 Hero 面板缩放的过程就越长
|
||||
const heroPinDistance = 1200
|
||||
const heroGalleryColumns = [
|
||||
{ side: 'left', images: ['1018', '1015', '1024', '1039'].map(id => `https://picsum.photos/id/${id}/900/1200`) },
|
||||
{ side: 'right', images: ['1043', '1050', '1067', '1074'].map(id => `https://picsum.photos/id/${id}/900/1200`) },
|
||||
] as const
|
||||
// 背景画廊:由后台「首页 Hero 画廊」配置,图片均分到左右两列;为空时显示品牌纯色兜底
|
||||
const heroGalleryColumns = computed(() => {
|
||||
const gallery = settings.value?.hero?.gallery ?? []
|
||||
const left = gallery.filter((_, i) => i % 2 === 0)
|
||||
const right = gallery.filter((_, i) => i % 2 === 1)
|
||||
const columns: { side: 'left' | 'right'; images: string[] }[] = []
|
||||
if (left.length) columns.push({ side: 'left', images: left })
|
||||
if (right.length) columns.push({ side: 'right', images: right })
|
||||
return columns
|
||||
})
|
||||
|
||||
const heroStageRef = ref<HTMLElement | null>(null)
|
||||
const heroRef = ref<HTMLElement | null>(null)
|
||||
@@ -202,14 +210,16 @@ defineExpose({ play })
|
||||
class="relative bg-black"
|
||||
:style="{ height: `calc(100svh + ${heroPinDistance}px)` }"
|
||||
>
|
||||
<section ref="heroRef" class="sticky top-0 h-[100svh] overflow-hidden bg-[#111]" v-once>
|
||||
<section ref="heroRef" class="sticky top-0 h-[100svh] overflow-hidden bg-[#111]">
|
||||
<div class="absolute inset-0 overflow-hidden bg-black" aria-hidden="true">
|
||||
<div
|
||||
v-for="column in heroGalleryColumns"
|
||||
:key="column.side"
|
||||
class="absolute -bottom-10 -top-10 w-[49vw] overflow-hidden"
|
||||
:class="column.side === 'left' ? 'left-0' : 'right-0'"
|
||||
>
|
||||
<!-- 有后台画廊配置时渲染图片列;否则显示品牌纯色兜底 -->
|
||||
<template v-if="heroGalleryColumns.length">
|
||||
<div
|
||||
v-for="column in heroGalleryColumns"
|
||||
:key="column.side"
|
||||
class="absolute -bottom-10 -top-10 w-[49vw] overflow-hidden"
|
||||
:class="column.side === 'left' ? 'left-0' : 'right-0'"
|
||||
>
|
||||
<!-- 复制两份图片组,配合 translateY(-50%) 做无缝循环。 -->
|
||||
<div
|
||||
class="hero-gallery-track will-change-transform"
|
||||
@@ -228,6 +238,11 @@ defineExpose({ play })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<!-- 兜底:无后台画廊配置时的品牌背景 -->
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-neutral-800 via-neutral-900 to-black"></div>
|
||||
</template>
|
||||
</div>
|
||||
<div ref="heroPanelRef" class="absolute inset-0 flex flex-col justify-between items-center bg-white text-black will-change-transform pt-24 pb-8 md:pt-36 md:pb-12 overflow-hidden">
|
||||
<div class="flex flex-col justify-between w-page-container max-w-[calc(100%-2rem)] mx-auto px-4 h-full">
|
||||
|
||||
@@ -3,10 +3,12 @@ import { onMounted, onUnmounted, ref, computed, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import gsap from 'gsap'
|
||||
import { ScrollTrigger } from 'gsap/ScrollTrigger'
|
||||
import { useSiteSettings } from '~/composables/useSiteSettings'
|
||||
|
||||
gsap.registerPlugin(ScrollTrigger)
|
||||
|
||||
const { t, locale } = useI18n()
|
||||
const { settings } = useSiteSettings()
|
||||
|
||||
interface WorkItem {
|
||||
slug: string
|
||||
@@ -26,40 +28,8 @@ const rootRef = ref<HTMLElement | null>(null)
|
||||
const workSectionRef = ref<HTMLElement | null>(null)
|
||||
const workPinRef = ref<HTMLElement | null>(null)
|
||||
|
||||
const partners = [
|
||||
{
|
||||
id: 'p1',
|
||||
svg: '<svg viewBox="0 0 64 64" width="34" height="34" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 44V20h12c7 0 12 4 12 10s-5 10-12 10h-6v4H20Z" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><path d="M34 40l10 12" stroke="currentColor" stroke-width="3" stroke-linecap="round"/></svg>',
|
||||
},
|
||||
{
|
||||
id: 'p2',
|
||||
svg: '<svg viewBox="0 0 64 64" width="34" height="34" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 32c0-9.94 8.06-18 18-18s18 8.06 18 18-8.06 18-18 18-18-8.06-18-18Z" stroke="currentColor" stroke-width="3"/><path d="M24 32c0-4.42 3.58-8 8-8s8 3.58 8 8-3.58 8-8 8-8-3.58-8-8Z" stroke="currentColor" stroke-width="3"/></svg>',
|
||||
},
|
||||
{
|
||||
id: 'p3',
|
||||
svg: '<svg viewBox="0 0 64 64" width="34" height="34" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M32 14v10M32 40v10M14 32h10M40 32h10" stroke="currentColor" stroke-width="3" stroke-linecap="round"/><path d="M32 22c5.52 0 10 4.48 10 10s-4.48 10-10 10-10-4.48-10-10 4.48-10 10-10Z" stroke="currentColor" stroke-width="3"/></svg>',
|
||||
},
|
||||
{
|
||||
id: 'p4',
|
||||
svg: '<svg viewBox="0 0 64 64" width="34" height="34" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 44c10-2 12-14 18-18s10-1 18-6" stroke="currentColor" stroke-width="3" stroke-linecap="round"/><path d="M16 34c8-2 10 8 18 6s10-18 18-18" stroke="currentColor" stroke-width="3" stroke-linecap="round"/></svg>',
|
||||
},
|
||||
{
|
||||
id: 'p5',
|
||||
svg: '<svg viewBox="0 0 64 64" width="34" height="34" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 38c0-9 6-18 14-18s14 9 14 18" stroke="currentColor" stroke-width="3" stroke-linecap="round"/><path d="M22 42h20" stroke="currentColor" stroke-width="3" stroke-linecap="round"/></svg>',
|
||||
},
|
||||
{
|
||||
id: 'p6',
|
||||
svg: '<svg viewBox="0 0 64 64" width="34" height="34" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 20v24M30 20v24M42 20v24" stroke="currentColor" stroke-width="3" stroke-linecap="round"/><path d="M14 20h36M14 44h36" stroke="currentColor" stroke-width="3" stroke-linecap="round"/></svg>',
|
||||
},
|
||||
{
|
||||
id: 'p7',
|
||||
svg: '<svg viewBox="0 0 64 64" width="34" height="34" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 44V20h10c9 0 18 7 18 12s-9 12-18 12H18Z" stroke="currentColor" stroke-width="3" stroke-linejoin="round"/></svg>',
|
||||
},
|
||||
{
|
||||
id: 'p8',
|
||||
svg: '<svg viewBox="0 0 64 64" width="34" height="34" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16 34c8-14 18-14 32-4" stroke="currentColor" stroke-width="3" stroke-linecap="round"/><path d="M18 44c10-10 20-10 30-2" stroke="currentColor" stroke-width="3" stroke-linecap="round"/></svg>',
|
||||
},
|
||||
]
|
||||
// 合作伙伴来自后台配置(/admin/settings 合作伙伴),空则隐藏该排展示
|
||||
const partners = computed(() => settings.value?.partners ?? [])
|
||||
|
||||
let st: ScrollTrigger | null = null
|
||||
let madeTweens: gsap.core.Animation[] = []
|
||||
@@ -191,23 +161,39 @@ onUnmounted(() => {
|
||||
<template>
|
||||
<section ref="rootRef" class="bg-[#F5F5F5]">
|
||||
<div class="w-page-container max-w-[calc(100%-2rem)] mx-auto px-6 md:px-10 lg:px-14 pt-24 pb-20">
|
||||
<div class="grid grid-cols-[1fr_auto_1fr] items-center">
|
||||
<p class="justify-self-start text-xs font-semibold tracking-tight text-black">( {{ t('home.partners.label') }} )</p>
|
||||
<div class="flex items-center justify-self-center gap-8 text-xs font-semibold tracking-tight text-black">
|
||||
<span class="h-1 w-1 rounded-full bg-black" />
|
||||
<span>{{ t('home.partners.years') }}</span>
|
||||
<!-- 合作伙伴(后台配置;空则不展示该排) -->
|
||||
<template v-if="partners.length">
|
||||
<div class="grid grid-cols-[1fr_auto_1fr] items-center">
|
||||
<p class="justify-self-start text-xs font-semibold tracking-tight text-black">( {{ t('home.partners.label') }} )</p>
|
||||
<div class="flex items-center justify-self-center gap-8 text-xs font-semibold tracking-tight text-black">
|
||||
<span class="h-1 w-1 rounded-full bg-black" />
|
||||
<span>{{ t('home.partners.years') }}</span>
|
||||
</div>
|
||||
<span class="justify-self-end h-1 w-1 rounded-full bg-black" />
|
||||
</div>
|
||||
<span class="justify-self-end h-1 w-1 rounded-full bg-black" />
|
||||
</div>
|
||||
|
||||
<div class="mt-12 grid grid-cols-2 sm:grid-cols-4 gap-5">
|
||||
<div
|
||||
v-for="item in partners"
|
||||
:key="item.id"
|
||||
class="h-[152px] rounded-[20px] bg-white flex items-center justify-center text-black border-0 shadow-none outline-none ring-0"
|
||||
v-html="item.svg"
|
||||
/>
|
||||
</div>
|
||||
<div class="mt-12 grid grid-cols-2 sm:grid-cols-4 gap-5">
|
||||
<template v-for="item in partners" :key="item.id">
|
||||
<a
|
||||
v-if="item.url"
|
||||
:href="item.url"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="h-[152px] rounded-[20px] bg-white flex items-center justify-center border-0 shadow-none outline-none ring-0 group"
|
||||
>
|
||||
<img v-if="item.logo" :src="item.logo" :alt="item.name" class="max-h-[72px] max-w-[80%] object-contain" />
|
||||
<span v-else class="text-lg font-bold text-gray-400 group-hover:text-black transition-colors">{{ item.name }}</span>
|
||||
</a>
|
||||
<div
|
||||
v-else
|
||||
class="h-[152px] rounded-[20px] bg-white flex items-center justify-center border-0 shadow-none outline-none ring-0"
|
||||
>
|
||||
<img v-if="item.logo" :src="item.logo" :alt="item.name" class="max-h-[72px] max-w-[80%] object-contain" />
|
||||
<span v-else class="text-lg font-bold text-gray-400">{{ item.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<section id="work" ref="workSectionRef" class="bg-white">
|
||||
@@ -244,12 +230,11 @@ onUnmounted(() => {
|
||||
:to="`/work/${item.slug}`"
|
||||
class="will-change-transform relative block"
|
||||
>
|
||||
<img
|
||||
class="h-full w-full object-cover"
|
||||
:src="item.image || ''"
|
||||
<CoverImage
|
||||
:src="item.image"
|
||||
:alt="locText(item.titleZh, item.titleEn)"
|
||||
loading="eager"
|
||||
decoding="async"
|
||||
:title="locText(item.titleZh, item.titleEn)"
|
||||
class="h-full w-full object-cover"
|
||||
@load="refresh"
|
||||
/>
|
||||
<div class="absolute left-6 top-6 flex items-baseline gap-3">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<section ref="rootRef" class="relative bg-gradient-to-b from-gray-50 to-white min-h-screen flex flex-col items-center justify-center overflow-hidden py-20">
|
||||
<section v-if="testimonials.length" ref="rootRef" class="relative bg-gradient-to-b from-gray-50 to-white min-h-screen flex flex-col items-center justify-center overflow-hidden py-20">
|
||||
<div class="w-full max-w-[1400px] mx-auto px-6 md:px-10">
|
||||
<!-- 标题 -->
|
||||
<div ref="headerRef" class="text-center mb-16 md:mb-20">
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
<!-- 评价内容 -->
|
||||
<p class="text-gray-700 text-base md:text-lg leading-relaxed mb-8 italic">
|
||||
"{{ t(`home.testimonials.items.${item.id}.content`) }}"
|
||||
"{{ item.content }}"
|
||||
</p>
|
||||
|
||||
<!-- 客户信息 -->
|
||||
@@ -45,10 +45,10 @@
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="text-lg md:text-xl font-bold text-black">
|
||||
{{ t(`home.testimonials.items.${item.id}.name`) }}
|
||||
{{ item.name }}
|
||||
</h4>
|
||||
<p class="text-sm md:text-base text-gray-500">
|
||||
{{ t(`home.testimonials.items.${item.id}.role`) }}
|
||||
{{ item.role }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -69,10 +69,12 @@ import { ref, onMounted, onUnmounted, nextTick, computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import gsap from 'gsap'
|
||||
import { ScrollTrigger } from 'gsap/ScrollTrigger'
|
||||
import { useSiteSettings } from '~/composables/useSiteSettings'
|
||||
|
||||
gsap.registerPlugin(ScrollTrigger)
|
||||
|
||||
const { t } = useI18n()
|
||||
const { t, locale } = useI18n()
|
||||
const { settings } = useSiteSettings()
|
||||
|
||||
const rootRef = ref<HTMLElement | null>(null)
|
||||
const headerRef = ref<HTMLElement | null>(null)
|
||||
@@ -80,16 +82,31 @@ const trackRef = ref<HTMLElement | null>(null)
|
||||
let ctx: gsap.Context | null = null
|
||||
let animFrameId: number | null = null
|
||||
|
||||
const testimonials = [
|
||||
{ id: 'client1', initial: 'A', avatarGradient: 'from-blue-500 to-cyan-500' },
|
||||
{ id: 'client2', initial: 'B', avatarGradient: 'from-purple-500 to-pink-500' },
|
||||
{ id: 'client3', initial: 'C', avatarGradient: 'from-orange-500 to-red-500' },
|
||||
{ id: 'client4', initial: 'D', avatarGradient: 'from-green-500 to-emerald-500' },
|
||||
{ id: 'client5', initial: 'E', avatarGradient: 'from-indigo-500 to-purple-500' },
|
||||
// 头像渐变预设按序号循环,后台无需逐条选色
|
||||
const AVATAR_STYLES = [
|
||||
'from-blue-500 to-cyan-500',
|
||||
'from-purple-500 to-pink-500',
|
||||
'from-orange-500 to-red-500',
|
||||
'from-green-500 to-emerald-500',
|
||||
'from-indigo-500 to-purple-500',
|
||||
]
|
||||
|
||||
const locStr = (zh: string, en: string) => (locale.value === 'zh' ? zh : en)
|
||||
|
||||
// 客户评价来自后台配置(/admin/settings 客户评价),空则不渲染该板块
|
||||
const testimonials = computed(() =>
|
||||
(settings.value?.testimonials ?? []).map((t, i) => ({
|
||||
id: t.id,
|
||||
name: t.name,
|
||||
role: locStr(t.roleZh, t.roleEn),
|
||||
content: locStr(t.contentZh, t.contentEn),
|
||||
initial: (t.name || '?').trim().charAt(0).toUpperCase(),
|
||||
avatarGradient: AVATAR_STYLES[i % AVATAR_STYLES.length],
|
||||
})),
|
||||
)
|
||||
|
||||
// 复制一份用于无缝循环
|
||||
const allTestimonials = computed(() => [...testimonials, ...testimonials])
|
||||
const allTestimonials = computed(() => [...testimonials.value, ...testimonials.value])
|
||||
|
||||
// 自动滚动状态
|
||||
const offset = ref(0)
|
||||
@@ -98,7 +115,7 @@ let isPaused = false
|
||||
const cardWidth = 400 + 32 // 卡片宽度 + gap
|
||||
|
||||
const startAutoplay = () => {
|
||||
const totalWidth = testimonials.length * cardWidth
|
||||
const totalWidth = testimonials.value.length * cardWidth
|
||||
|
||||
const animate = () => {
|
||||
if (!isPaused) {
|
||||
|
||||
Reference in New Issue
Block a user