Summary: - Implement PKB Dashboard and Workspace pages based on V3 prototype - Add single-layer header with integrated Tab navigation - Implement 3 work modes: Full Text, Deep Read, Batch Processing - Integrate Ant Design X Chat component for AI conversations - Create BatchModeComplete with template selection and document processing - Add compact work mode selector with dropdown design Backend: - Migrate PKB controllers and services to /modules/pkb structure - Register v2 API routes at /api/v2/pkb/knowledge - Maintain dual API routes for backward compatibility Technical details: - Use Zustand for state management - Handle SSE streaming responses for AI chat - Support document selection for Deep Read mode - Implement batch processing with progress tracking Known issues: - Batch processing API integration pending - Knowledge assets page navigation needs optimization Status: Frontend functional, pending refinement
56 lines
1.5 KiB
PHP
56 lines
1.5 KiB
PHP
<?php
|
||
/**
|
||
* REDCap密码哈希生成脚本
|
||
* 直接在数据库中更新Admin密码
|
||
*/
|
||
|
||
// REDCap密码哈希算法(SHA-512 + Salt)
|
||
$username = 'Admin';
|
||
$new_password = 'Admin123!';
|
||
|
||
// 生成新的salt(REDCap使用100字符的随机salt)
|
||
$salt = '';
|
||
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]{}|;:,.<>?~';
|
||
for ($i = 0; $i < 100; $i++) {
|
||
$salt .= $characters[random_int(0, strlen($characters) - 1)];
|
||
}
|
||
|
||
// 生成密码哈希(SHA-512(password + salt))
|
||
$password_hash = hash('sha512', $new_password . $salt);
|
||
|
||
// 数据库连接信息
|
||
$db_host = getenv('REDCAP_DB_HOST') ?: 'redcap-mysql';
|
||
$db_name = getenv('REDCAP_DB_NAME') ?: 'redcap';
|
||
$db_user = getenv('REDCAP_DB_USER') ?: 'redcap_user';
|
||
$db_pass = getenv('REDCAP_DB_PASS') ?: 'redcap_pass_dev_456';
|
||
|
||
try {
|
||
$pdo = new PDO("mysql:host=$db_host;dbname=$db_name", $db_user, $db_pass);
|
||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||
|
||
// 更新密码
|
||
$stmt = $pdo->prepare("UPDATE redcap_auth SET password = ?, password_salt = ? WHERE username = ?");
|
||
$result = $stmt->execute([$password_hash, $salt, $username]);
|
||
|
||
if ($result) {
|
||
echo "✅ Password updated successfully!\n\n";
|
||
echo "Username: $username\n";
|
||
echo "New Password: $new_password\n\n";
|
||
echo "You can now login at: http://localhost:8080/\n";
|
||
} else {
|
||
echo "❌ Failed to update password\n";
|
||
}
|
||
|
||
} catch (PDOException $e) {
|
||
echo "❌ Database error: " . $e->getMessage() . "\n";
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|