v0.3.7: 全面代码审计修复 - 20项Bug/安全/稳定性改进

This commit is contained in:
thzxx
2026-06-15 15:02:38 +08:00
parent c0e16f2885
commit dd78ff15a9
20 changed files with 158 additions and 67 deletions
@@ -35,6 +35,8 @@ export class ErrorBoundary extends Component<Props, State> {
return this.props.fallback
}
const isDev = (typeof import.meta !== 'undefined' && (import.meta as { env?: { DEV?: boolean } }).env?.DEV) ?? false
return (
<div
style={{
@@ -51,19 +53,21 @@ export class ErrorBoundary extends Component<Props, State> {
<h2 style={{ marginBottom: '1rem', color: '#e74c3c' }}>
</h2>
<pre
style={{
padding: '1rem',
backgroundColor: '#f8f9fa',
borderRadius: '8px',
maxWidth: '600px',
overflow: 'auto',
fontSize: '0.875rem',
color: '#666',
}}
>
{this.state.error?.message}
</pre>
{isDev && (
<pre
style={{
padding: '1rem',
backgroundColor: '#f8f9fa',
borderRadius: '8px',
maxWidth: '600px',
overflow: 'auto',
fontSize: '0.875rem',
color: '#666',
}}
>
{this.state.error?.message}
</pre>
)}
<button
onClick={this.handleReset}
style={{