feat: 新增后端模型管理,第三方快捷登录

This commit is contained in:
npc0-hue
2026-02-11 17:41:59 +08:00
parent 7947b7976b
commit 9226a3d795
49 changed files with 2724 additions and 99 deletions
+3 -1
View File
@@ -63,12 +63,14 @@ const nextConfig: NextConfig = {
},
]
},
// dev 时把 /console/api 和 /api 代理到 5001
// dev 时把 /console/api 和 /api 代理到 5001/admin 代理到 8888
...(isDev && {
async rewrites() {
return [
{ source: '/console/api/:path*', destination: 'http://localhost:5001/console/api/:path*' },
{ source: '/api/:path*', destination: 'http://localhost:5001/api/:path*' },
{ source: '/admin', destination: 'http://localhost:8888/' },
{ source: '/admin/:path*', destination: 'http://localhost:8888/:path*' },
]
},
}),
+3 -1
View File
@@ -1,9 +1,11 @@
import Cookies from 'js-cookie'
import { CSRF_COOKIE_NAME } from '@/config'
import Toast from '@/app/components/base/toast'
// Admin server 使用独立的 JWT 认证,需要从 admin_token 获取
const getAdminToken = () => {
// 优先使用 admin_token,如果没有则尝试使用 console_token
return localStorage.getItem('admin_token') || localStorage.getItem('console_token')
return Cookies.get(CSRF_COOKIE_NAME())
}
type batchProcessing = {