fix(server): 更新数据库环境变量命名以保持一致性
fix(WorkerDashboardView): 调整扫描器延迟并简化错误处理
This commit is contained in:
+5
-5
@@ -14,11 +14,11 @@ async function startServer() {
|
|||||||
|
|
||||||
// --- Database Connection ---
|
// --- Database Connection ---
|
||||||
const db = mysql.createPool({
|
const db = mysql.createPool({
|
||||||
host: process.env.DB_HOST,
|
host: process.env.DBHOST,
|
||||||
user: process.env.DB_USER,
|
user: process.env.DBUSER,
|
||||||
password: process.env.DB_PASSWORD,
|
password: process.env.DBPASSWORD,
|
||||||
database: process.env.DB_NAME,
|
database: process.env.DBNAME,
|
||||||
port: process.env.DB_PORT || 3306,
|
port: process.env.DBPORT,
|
||||||
waitForConnections: true,
|
waitForConnections: true,
|
||||||
connectionLimit: 10,
|
connectionLimit: 10,
|
||||||
queueLimit: 0,
|
queueLimit: 0,
|
||||||
|
|||||||
@@ -115,8 +115,9 @@ const startScanner = () => {
|
|||||||
errorMessage.value = `Unable to start camera. Try uploading an image instead.`
|
errorMessage.value = `Unable to start camera. Try uploading an image instead.`
|
||||||
isScannerActive.value = false
|
isScannerActive.value = false
|
||||||
})
|
})
|
||||||
}, 100)
|
}, 2000)
|
||||||
}
|
}
|
||||||
|
|
||||||
const stopScanner = () => {
|
const stopScanner = () => {
|
||||||
if (html5QrCode && html5QrCode.isScanning) {
|
if (html5QrCode && html5QrCode.isScanning) {
|
||||||
html5QrCode.stop().catch((err) => console.error('Failed to stop scanner', err))
|
html5QrCode.stop().catch((err) => console.error('Failed to stop scanner', err))
|
||||||
@@ -150,9 +151,8 @@ const onScanSuccess = (decodedText) => {
|
|||||||
(errorMessage.value = 'Unable to retrieve your location. Please enable location services.'),
|
(errorMessage.value = 'Unable to retrieve your location. Please enable location services.'),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
const onScanFailure = (error) => {
|
const onScanFailure = () => {
|
||||||
errorMessage.value = error
|
errorMessage.value = 'Please Try Again'
|
||||||
isScannerActive.value = false
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user