From 3aa4897bc56e9c9c321acd5caca8f5f9205675d4 Mon Sep 17 00:00:00 2001 From: sudomarcma <1040211836@qq.com> Date: Wed, 2 Jul 2025 13:43:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20=E6=B7=BB=E5=8A=A0=E5=A4=9A?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E6=94=AF=E6=8C=81=E5=B9=B6=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/hash_passwords.js | 8 +- package-lock.json | 65 ++++ package.json | 1 + src/App.vue | 50 ++- src/components/AttendanceReporting.vue | 320 ++++++------------ src/components/PersonnelManagement.vue | 442 ++++++++----------------- src/components/QrCodeManagement.vue | 116 +++---- src/i18n.js | 20 ++ src/locales/en.json | 184 ++++++++++ src/locales/ms.json | 183 ++++++++++ src/main.js | 5 +- src/views/AttendanceRecordView.vue | 161 ++++----- src/views/ChangePasswordView.vue | 88 ++--- src/views/LoginView.vue | 73 ++-- src/views/ManagerDashboardView.vue | 69 ++-- src/views/WorkerDashboardView.vue | 95 +++--- src/views/WorkerHistoryView.vue | 29 +- 17 files changed, 996 insertions(+), 913 deletions(-) create mode 100644 src/i18n.js create mode 100644 src/locales/en.json create mode 100644 src/locales/ms.json diff --git a/backend/hash_passwords.js b/backend/hash_passwords.js index 10db6f6..7a7b14a 100644 --- a/backend/hash_passwords.js +++ b/backend/hash_passwords.js @@ -2,14 +2,14 @@ import mysql from 'mysql2/promise' import bcrypt from 'bcrypt' import dotenv from 'dotenv' -dotenv.config({ path: '../.env' }) +dotenv.config() async function hashPasswords() { const db = await mysql.createConnection({ host: process.env.DB_HOST, - user: process.env.DB_USER, + user: process.env.DB_USERNAME, password: process.env.DB_PASSWORD, - database: process.env.DB_NAME, + database: process.env.DB_DATABASE, port: process.env.DB_PORT, }) @@ -36,4 +36,4 @@ async function hashPasswords() { } } -hashPasswords() \ No newline at end of file +hashPasswords() diff --git a/package-lock.json b/package-lock.json index ee527ba..156df1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "qrcode": "^1.5.4", "uuid": "^11.1.0", "vue": "^3.5.13", + "vue-i18n": "^11.1.7", "vue-router": "^4.5.0" }, "devDependencies": { @@ -1269,6 +1270,50 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@intlify/core-base": { + "version": "11.1.7", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-11.1.7.tgz", + "integrity": "sha512-gYiGnQeJVp3kNBeXQ73m1uFOak0ry4av8pn+IkEWigyyPWEMGzB+xFeQdmGMFn49V+oox6294oGVff8bYOhtOw==", + "license": "MIT", + "dependencies": { + "@intlify/message-compiler": "11.1.7", + "@intlify/shared": "11.1.7" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, + "node_modules/@intlify/message-compiler": { + "version": "11.1.7", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-11.1.7.tgz", + "integrity": "sha512-0ezkep1AT30NyuKj8QbRlmvMORCCRlOIIu9v8RNU8SwDjjTiFCZzczCORMns2mCH4HZ1nXgrfkKzYUbfjNRmng==", + "license": "MIT", + "dependencies": { + "@intlify/shared": "11.1.7", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, + "node_modules/@intlify/shared": { + "version": "11.1.7", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-11.1.7.tgz", + "integrity": "sha512-4yZeMt2Aa/7n5Ehy4KalUlvt3iRLcg1tq9IBVfOgkyWFArN4oygn6WxgGIFibP3svpaH8DarbNaottq+p0gUZQ==", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, "node_modules/@ionic/cli-framework-output": { "version": "2.2.8", "resolved": "https://registry.npmjs.org/@ionic/cli-framework-output/-/cli-framework-output-2.2.8.tgz", @@ -9479,6 +9524,26 @@ "eslint": "^8.57.0 || ^9.0.0" } }, + "node_modules/vue-i18n": { + "version": "11.1.7", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-11.1.7.tgz", + "integrity": "sha512-CDrU7Cmyh1AxJjerQmipV9nVa//exVBdhTcWGlbfcDCN8bKp/uAe7Le6IoN4//5emIikbsSKe9Uofmf/xXkhOA==", + "license": "MIT", + "dependencies": { + "@intlify/core-base": "11.1.7", + "@intlify/shared": "11.1.7", + "@vue/devtools-api": "^6.5.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + }, + "peerDependencies": { + "vue": "^3.0.0" + } + }, "node_modules/vue-router": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.5.1.tgz", diff --git a/package.json b/package.json index 3837414..2f72148 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "qrcode": "^1.5.4", "uuid": "^11.1.0", "vue": "^3.5.13", + "vue-i18n": "^11.1.7", "vue-router": "^4.5.0" }, "devDependencies": { diff --git a/src/App.vue b/src/App.vue index 329fb42..6451f9b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,24 +1,26 @@