给所有请求都加上jwt,隐藏生成jwt的secret(放到.env中),隐藏app-secret(放在pm2运行配置文件中,后续直接读取环境配置即可)
This commit is contained in:
@@ -18,6 +18,7 @@ const REVIEW_TYPE_TO_APP: Record<string, AppModule> = {
|
||||
interface LayoutProps {
|
||||
children: React.ReactNode;
|
||||
userRole?: UserRole;
|
||||
frontendJWT?: string;
|
||||
}
|
||||
|
||||
// 添加一个接口表示路由handle可能包含的属性
|
||||
@@ -32,7 +33,7 @@ interface Match {
|
||||
data: unknown;
|
||||
}
|
||||
|
||||
export function Layout({ children, userRole = 'developer' }: LayoutProps) {
|
||||
export function Layout({ children, userRole = 'developer' as UserRole, frontendJWT = '' }: LayoutProps) {
|
||||
const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
|
||||
const [selectedApp, setSelectedApp] = useState<AppModule>('');
|
||||
const matches = useMatches() as Match[];
|
||||
@@ -108,6 +109,7 @@ export function Layout({ children, userRole = 'developer' }: LayoutProps) {
|
||||
onToggle={toggleSidebar}
|
||||
userRole={userRole}
|
||||
selectedApp={selectedApp}
|
||||
frontendJWT={frontendJWT}
|
||||
/>
|
||||
|
||||
<div className={`main-content ${sidebarCollapsed ? 'sidebar-collapsed' : ''}`}>
|
||||
|
||||
Reference in New Issue
Block a user