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:
2026-08-09 00:18:47 +08:00
parent bdafac2857
commit 337eb4f05a
51 changed files with 1395 additions and 1504 deletions
+26 -56
View File
@@ -1,6 +1,6 @@
/**
* 种子数据(由 scripts/generate-seed.mjs 生成,勿手改)。
* 站点初始内容:6 篇动态 + 6 个作品(中英双语)。
* 种子数据(站点初始内容,手维护)。
* 6 篇动态 + 6 个作品(中英双语);图片留空,由后台 CMS 上传配置。
* DB 初始化(migrate)时若对应表为空则自动灌入。
*/
import type { ArticleBlock } from './db'
@@ -91,7 +91,7 @@ export const articlesSeed: ArticleSeed[] = [
"contentEn": [
{
"type": "paragraph",
"text": "In 2026, the design industry is undergoing a profound transformation. From the return of minimalism to the rise of bold typography, from the普及 of 3D elements to the maturity of AI-assisted design, these trends are redefining the boundaries of digital experiences."
"text": "In 2026, the design industry is undergoing a profound transformation. From the return of minimalism to the rise of bold typography, from the proliferation of 3D elements to the maturity of AI-assisted design, these trends are redefining the boundaries of digital experiences."
},
{
"type": "heading",
@@ -99,7 +99,7 @@ export const articlesSeed: ArticleSeed[] = [
},
{
"type": "paragraph",
"text": "In an age of information overload, users increasingly渴望 clean, clear interfaces. 2026's minimalism isn't just 'less is more' — it's about delivering more value in limited space through careful information architecture and visual hierarchy."
"text": "In an age of information overload, users increasingly crave clean, clear interfaces. 2026's minimalism isn't just 'less is more' — it's about delivering more value in limited space through careful information architecture and visual hierarchy."
},
{
"type": "quote",
@@ -122,7 +122,7 @@ export const articlesSeed: ArticleSeed[] = [
"text": "AI tools are shifting from 'replacing designers' to 'empowering designers.' Smart layout suggestions, automated color schemes, and real-time design feedback let designers focus on creativity and strategy rather than repetitive execution."
}
],
"image": "https://picsum.photos/id/1/800/500",
"image": null,
"date": "2026-05-28",
"readTime": 5,
"author": "ArcticNewOne",
@@ -200,10 +200,10 @@ export const articlesSeed: ArticleSeed[] = [
},
{
"type": "paragraph",
"text": "After launch, user停留 time increased by 60%, bounce rate decreased by 35%, and conversion rate improved by 45%."
"text": "After launch, user engagement time increased by 60%, bounce rate decreased by 35%, and conversion rate improved by 45%."
}
],
"image": "https://picsum.photos/id/201/800/500",
"image": null,
"date": "2026-05-15",
"readTime": 3,
"author": "ArcticNewOne",
@@ -284,7 +284,7 @@ export const articlesSeed: ArticleSeed[] = [
"text": "We plan to complete 50+ projects and serve 30+ new clients in the coming year while continuing to explore new possibilities."
}
],
"image": "https://picsum.photos/id/164/800/500",
"image": null,
"date": "2026-05-10",
"readTime": 2,
"author": "ArcticNewOne",
@@ -365,7 +365,7 @@ export const articlesSeed: ArticleSeed[] = [
"text": "AI tools help us analyze user feedback more efficiently. Sentiment analysis, topic clustering, and trend prediction help extract valuable insights from massive data."
}
],
"image": "https://picsum.photos/id/180/800/500",
"image": null,
"date": "2026-04-28",
"readTime": 7,
"author": "ArcticNewOne",
@@ -415,7 +415,7 @@ export const articlesSeed: ArticleSeed[] = [
"contentEn": [
{
"type": "paragraph",
"text": "Bold Moves is an interactive website showcasing innovative architectural designs. This article provides an in-depth look at the design思路, technical implementation, and final results."
"text": "Bold Moves is an interactive website showcasing innovative architectural designs. This article provides an in-depth look at the design approach, technical implementation, and final results."
},
{
"type": "heading",
@@ -443,10 +443,10 @@ export const articlesSeed: ArticleSeed[] = [
},
{
"type": "paragraph",
"text": "The project received widespread acclaim and won multiple design awards. Average user停留 time exceeded 5 minutes, well above industry average."
"text": "The project received widespread acclaim and won multiple design awards. Average user engagement time exceeded 5 minutes, well above industry average."
}
],
"image": "https://picsum.photos/id/119/800/500",
"image": null,
"date": "2026-04-20",
"readTime": 6,
"author": "ArcticNewOne",
@@ -504,7 +504,7 @@ export const articlesSeed: ArticleSeed[] = [
},
{
"type": "paragraph",
"text": "We've引入 the latest design collaboration platform supporting real-time multi-person editing, version management, and design system integration."
"text": "We've introduced the latest design collaboration platform supporting real-time multi-person editing, version management, and design system integration."
},
{
"type": "quote",
@@ -527,7 +527,7 @@ export const articlesSeed: ArticleSeed[] = [
"text": "We upgraded our project management platform with new Kanban views, time tracking, and resource allocation features for better project oversight."
}
],
"image": "https://picsum.photos/id/326/800/500",
"image": null,
"date": "2026-04-12",
"readTime": 4,
"author": "ArcticNewOne",
@@ -559,13 +559,8 @@ export const worksSeed: WorkSeed[] = [
"E-commerce",
"React"
],
"image": "https://picsum.photos/id/201/1200/800",
"gallery": [
"https://picsum.photos/id/201/800/600",
"https://picsum.photos/id/202/800/600",
"https://picsum.photos/id/203/800/600",
"https://picsum.photos/id/204/800/600"
],
"image": null,
"gallery": [],
"url": null,
"published": 1
},
@@ -592,13 +587,8 @@ export const worksSeed: WorkSeed[] = [
"Marketing",
"UI/UX"
],
"image": "https://picsum.photos/id/180/1200/800",
"gallery": [
"https://picsum.photos/id/180/800/600",
"https://picsum.photos/id/181/800/600",
"https://picsum.photos/id/182/800/600",
"https://picsum.photos/id/183/800/600"
],
"image": null,
"gallery": [],
"url": null,
"published": 1
},
@@ -625,13 +615,8 @@ export const worksSeed: WorkSeed[] = [
"Vue.js",
"Node.js"
],
"image": "https://picsum.photos/id/119/1200/800",
"gallery": [
"https://picsum.photos/id/119/800/600",
"https://picsum.photos/id/120/800/600",
"https://picsum.photos/id/121/800/600",
"https://picsum.photos/id/122/800/600"
],
"image": null,
"gallery": [],
"url": null,
"published": 1
},
@@ -658,13 +643,8 @@ export const worksSeed: WorkSeed[] = [
"3D",
"Three.js"
],
"image": "https://picsum.photos/id/164/1200/800",
"gallery": [
"https://picsum.photos/id/164/800/600",
"https://picsum.photos/id/165/800/600",
"https://picsum.photos/id/166/800/600",
"https://picsum.photos/id/167/800/600"
],
"image": null,
"gallery": [],
"url": null,
"published": 1
},
@@ -691,13 +671,8 @@ export const worksSeed: WorkSeed[] = [
"Visual Identity",
"Corporate"
],
"image": "https://picsum.photos/id/101/1200/800",
"gallery": [
"https://picsum.photos/id/101/800/600",
"https://picsum.photos/id/102/800/600",
"https://picsum.photos/id/103/800/600",
"https://picsum.photos/id/104/800/600"
],
"image": null,
"gallery": [],
"url": null,
"published": 1
},
@@ -724,13 +699,8 @@ export const worksSeed: WorkSeed[] = [
"API",
"Python"
],
"image": "https://picsum.photos/id/326/1200/800",
"gallery": [
"https://picsum.photos/id/326/800/600",
"https://picsum.photos/id/327/800/600",
"https://picsum.photos/id/328/800/600",
"https://picsum.photos/id/329/800/600"
],
"image": null,
"gallery": [],
"url": null,
"published": 1
}