|
@@ -216,7 +216,10 @@ function register(app, ctx) {
|
|
|
port: Number(body.pgPort) || current.port || 5432,
|
|
port: Number(body.pgPort) || current.port || 5432,
|
|
|
database: String(body.pgDatabase !== undefined ? body.pgDatabase : (current.database || '')).trim(),
|
|
database: String(body.pgDatabase !== undefined ? body.pgDatabase : (current.database || '')).trim(),
|
|
|
user: String(body.pgUser !== undefined ? body.pgUser : (current.user || '')).trim(),
|
|
user: String(body.pgUser !== undefined ? body.pgUser : (current.user || '')).trim(),
|
|
|
- password: (pw !== undefined && pw !== null && !String(pw).includes('••')) ? String(pw) : (current.password || ''),
|
|
|
|
|
|
|
+ // 留空 = 沿用已保存密码(否则空串会覆盖密码,触发 SASL 'password must be a string')
|
|
|
|
|
+ password: (pw !== undefined && pw !== null && String(pw).trim() !== '' && !String(pw).includes('••'))
|
|
|
|
|
+ ? String(pw)
|
|
|
|
|
+ : (current.password || ''),
|
|
|
ssl: body.pgSsl !== undefined ? !!body.pgSsl : !!current.ssl,
|
|
ssl: body.pgSsl !== undefined ? !!body.pgSsl : !!current.ssl,
|
|
|
schema: String(body.pgSchema || current.schema || 'public'),
|
|
schema: String(body.pgSchema || current.schema || 'public'),
|
|
|
max: current.max || 5,
|
|
max: current.max || 5,
|