mirror of
https://github.com/YFGaia/dify-plus.git
synced 2026-06-12 18:11:42 +08:00
feat: 新增后端模型管理,第三方快捷登录
This commit is contained in:
+3
-1
@@ -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*' },
|
||||
]
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user