diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..14c0a87 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index e503661..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,31 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* - -node_modules -.DS_Store -dist -dist-ssr -coverage -*.local - -/cypress/videos/ -/cypress/screenshots/ - -# Editor directories and files -.vscode/* -!.vscode/extensions.json -.idea -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? - -*.tsbuildinfo -pnpm-lock.yaml diff --git a/README.md b/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/Server/nodemon.json b/Server/nodemon.json deleted file mode 100644 index b038b30..0000000 --- a/Server/nodemon.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "watch": ["*.ts"], - "execMap": { - "ts": "ts-node" - }, - "ignore": ["*.test.ts"], - "ext": "ts" -} diff --git a/Server/package.json b/Server/package.json deleted file mode 100644 index 2cd75b7..0000000 --- a/Server/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "server", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "start": "tsc && node dist/index.js" - }, - "keywords": [], - "author": "", - "license": "ISC", - "devDependencies": { - "@types/ali-oss": "^6.16.11", - "@types/cors": "^2.8.17", - "@types/express": "^4.17.21", - "@types/jsonwebtoken": "^9.0.6", - "@types/node": "^20.12.12", - "@types/pg": "^8.11.11", - "ali-oss": "^6.21.0", - "jsonwebtoken": "^9.0.2", - "typescript": "^5.4.5" - }, - "dependencies": { - "@types/node-fetch": "^2.6.11", - "axios": "^1.7.5", - "cors": "^2.8.5", - "express": "^4.19.2", - "pg": "^8.13.3" - } -} diff --git a/Server/pnpm-lock.yaml b/Server/pnpm-lock.yaml deleted file mode 100644 index 04e1088..0000000 --- a/Server/pnpm-lock.yaml +++ /dev/null @@ -1,1257 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -dependencies: - '@types/node-fetch': - specifier: ^2.6.11 - version: 2.6.11 - axios: - specifier: ^1.7.5 - version: 1.7.5 - cors: - specifier: ^2.8.5 - version: 2.8.5 - express: - specifier: ^4.19.2 - version: 4.19.2 - ioredis: - specifier: ^5.4.1 - version: 5.4.1 - mysql2: - specifier: ^3.9.7 - version: 3.9.7 - sharp: - specifier: ^0.33.5 - version: 0.33.5 - -devDependencies: - '@types/cors': - specifier: ^2.8.17 - version: 2.8.17 - '@types/express': - specifier: ^4.17.21 - version: 4.17.21 - '@types/jsonwebtoken': - specifier: ^9.0.6 - version: 9.0.6 - '@types/node': - specifier: ^20.12.12 - version: 20.12.12 - jsonwebtoken: - specifier: ^9.0.2 - version: 9.0.2 - ts-node: - specifier: ^10.9.2 - version: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) - typescript: - specifier: ^5.4.5 - version: 5.4.5 - -packages: - - /@cspotcode/source-map-support@0.8.1: - resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} - engines: {node: '>=12'} - dependencies: - '@jridgewell/trace-mapping': 0.3.9 - dev: true - - /@emnapi/runtime@1.2.0: - resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} - requiresBuild: true - dependencies: - tslib: 2.7.0 - dev: false - optional: true - - /@img/sharp-darwin-arm64@0.33.5: - resolution: {integrity: sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [darwin] - requiresBuild: true - optionalDependencies: - '@img/sharp-libvips-darwin-arm64': 1.0.4 - dev: false - optional: true - - /@img/sharp-darwin-x64@0.33.5: - resolution: {integrity: sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] - os: [darwin] - requiresBuild: true - optionalDependencies: - '@img/sharp-libvips-darwin-x64': 1.0.4 - dev: false - optional: true - - /@img/sharp-libvips-darwin-arm64@1.0.4: - resolution: {integrity: sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /@img/sharp-libvips-darwin-x64@1.0.4: - resolution: {integrity: sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /@img/sharp-libvips-linux-arm64@1.0.4: - resolution: {integrity: sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==} - cpu: [arm64] - os: [linux] - libc: [glibc] - requiresBuild: true - dev: false - optional: true - - /@img/sharp-libvips-linux-arm@1.0.5: - resolution: {integrity: sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==} - cpu: [arm] - os: [linux] - libc: [glibc] - requiresBuild: true - dev: false - optional: true - - /@img/sharp-libvips-linux-s390x@1.0.4: - resolution: {integrity: sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==} - cpu: [s390x] - os: [linux] - libc: [glibc] - requiresBuild: true - dev: false - optional: true - - /@img/sharp-libvips-linux-x64@1.0.4: - resolution: {integrity: sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==} - cpu: [x64] - os: [linux] - libc: [glibc] - requiresBuild: true - dev: false - optional: true - - /@img/sharp-libvips-linuxmusl-arm64@1.0.4: - resolution: {integrity: sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==} - cpu: [arm64] - os: [linux] - libc: [musl] - requiresBuild: true - dev: false - optional: true - - /@img/sharp-libvips-linuxmusl-x64@1.0.4: - resolution: {integrity: sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==} - cpu: [x64] - os: [linux] - libc: [musl] - requiresBuild: true - dev: false - optional: true - - /@img/sharp-linux-arm64@0.33.5: - resolution: {integrity: sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [linux] - libc: [glibc] - requiresBuild: true - optionalDependencies: - '@img/sharp-libvips-linux-arm64': 1.0.4 - dev: false - optional: true - - /@img/sharp-linux-arm@0.33.5: - resolution: {integrity: sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm] - os: [linux] - libc: [glibc] - requiresBuild: true - optionalDependencies: - '@img/sharp-libvips-linux-arm': 1.0.5 - dev: false - optional: true - - /@img/sharp-linux-s390x@0.33.5: - resolution: {integrity: sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [s390x] - os: [linux] - libc: [glibc] - requiresBuild: true - optionalDependencies: - '@img/sharp-libvips-linux-s390x': 1.0.4 - dev: false - optional: true - - /@img/sharp-linux-x64@0.33.5: - resolution: {integrity: sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] - os: [linux] - libc: [glibc] - requiresBuild: true - optionalDependencies: - '@img/sharp-libvips-linux-x64': 1.0.4 - dev: false - optional: true - - /@img/sharp-linuxmusl-arm64@0.33.5: - resolution: {integrity: sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [arm64] - os: [linux] - libc: [musl] - requiresBuild: true - optionalDependencies: - '@img/sharp-libvips-linuxmusl-arm64': 1.0.4 - dev: false - optional: true - - /@img/sharp-linuxmusl-x64@0.33.5: - resolution: {integrity: sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] - os: [linux] - libc: [musl] - requiresBuild: true - optionalDependencies: - '@img/sharp-libvips-linuxmusl-x64': 1.0.4 - dev: false - optional: true - - /@img/sharp-wasm32@0.33.5: - resolution: {integrity: sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [wasm32] - requiresBuild: true - dependencies: - '@emnapi/runtime': 1.2.0 - dev: false - optional: true - - /@img/sharp-win32-ia32@0.33.5: - resolution: {integrity: sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: false - optional: true - - /@img/sharp-win32-x64@0.33.5: - resolution: {integrity: sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: false - optional: true - - /@ioredis/commands@1.2.0: - resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} - dev: false - - /@jridgewell/resolve-uri@3.1.2: - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} - engines: {node: '>=6.0.0'} - dev: true - - /@jridgewell/sourcemap-codec@1.4.15: - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} - dev: true - - /@jridgewell/trace-mapping@0.3.9: - resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - - /@tsconfig/node10@1.0.11: - resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} - dev: true - - /@tsconfig/node12@1.0.11: - resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} - dev: true - - /@tsconfig/node14@1.0.3: - resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} - dev: true - - /@tsconfig/node16@1.0.4: - resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} - dev: true - - /@types/body-parser@1.19.5: - resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} - dependencies: - '@types/connect': 3.4.38 - '@types/node': 20.12.12 - dev: true - - /@types/connect@3.4.38: - resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} - dependencies: - '@types/node': 20.12.12 - dev: true - - /@types/cors@2.8.17: - resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} - dependencies: - '@types/node': 20.12.12 - dev: true - - /@types/express-serve-static-core@4.19.5: - resolution: {integrity: sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==} - dependencies: - '@types/node': 20.12.12 - '@types/qs': 6.9.15 - '@types/range-parser': 1.2.7 - '@types/send': 0.17.4 - dev: true - - /@types/express@4.17.21: - resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==} - dependencies: - '@types/body-parser': 1.19.5 - '@types/express-serve-static-core': 4.19.5 - '@types/qs': 6.9.15 - '@types/serve-static': 1.15.7 - dev: true - - /@types/http-errors@2.0.4: - resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} - dev: true - - /@types/jsonwebtoken@9.0.6: - resolution: {integrity: sha512-/5hndP5dCjloafCXns6SZyESp3Ldq7YjH3zwzwczYnjxIT0Fqzk5ROSYVGfFyczIue7IUEj8hkvLbPoLQ18vQw==} - dependencies: - '@types/node': 20.12.12 - dev: true - - /@types/mime@1.3.5: - resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==} - dev: true - - /@types/node-fetch@2.6.11: - resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} - dependencies: - '@types/node': 20.12.12 - form-data: 4.0.0 - dev: false - - /@types/node@20.12.12: - resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} - dependencies: - undici-types: 5.26.5 - - /@types/qs@6.9.15: - resolution: {integrity: sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==} - dev: true - - /@types/range-parser@1.2.7: - resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} - dev: true - - /@types/send@0.17.4: - resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} - dependencies: - '@types/mime': 1.3.5 - '@types/node': 20.12.12 - dev: true - - /@types/serve-static@1.15.7: - resolution: {integrity: sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==} - dependencies: - '@types/http-errors': 2.0.4 - '@types/node': 20.12.12 - '@types/send': 0.17.4 - dev: true - - /accepts@1.3.8: - resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} - engines: {node: '>= 0.6'} - dependencies: - mime-types: 2.1.35 - negotiator: 0.6.3 - dev: false - - /acorn-walk@8.3.2: - resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} - engines: {node: '>=0.4.0'} - dev: true - - /acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: true - - /arg@4.1.3: - resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} - dev: true - - /array-flatten@1.1.1: - resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} - dev: false - - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: false - - /axios@1.7.5: - resolution: {integrity: sha512-fZu86yCo+svH3uqJ/yTdQ0QHpQu5oL+/QE+QPSv6BZSkDAoky9vytxp7u5qk83OJFS3kEBcesWni9WTZAv3tSw==} - dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: false - - /body-parser@1.20.2: - resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} - engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - dependencies: - bytes: 3.1.2 - content-type: 1.0.5 - debug: 2.6.9 - depd: 2.0.0 - destroy: 1.2.0 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - on-finished: 2.4.1 - qs: 6.11.0 - raw-body: 2.5.2 - type-is: 1.6.18 - unpipe: 1.0.0 - transitivePeerDependencies: - - supports-color - dev: false - - /buffer-equal-constant-time@1.0.1: - resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} - dev: true - - /bytes@3.1.2: - resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} - engines: {node: '>= 0.8'} - dev: false - - /call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - dev: false - - /cluster-key-slot@1.1.2: - resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} - engines: {node: '>=0.10.0'} - dev: false - - /color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - dependencies: - color-name: 1.1.4 - dev: false - - /color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - dev: false - - /color-string@1.9.1: - resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==} - dependencies: - color-name: 1.1.4 - simple-swizzle: 0.2.2 - dev: false - - /color@4.2.3: - resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} - engines: {node: '>=12.5.0'} - dependencies: - color-convert: 2.0.1 - color-string: 1.9.1 - dev: false - - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: false - - /content-disposition@0.5.4: - resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} - engines: {node: '>= 0.6'} - dependencies: - safe-buffer: 5.2.1 - dev: false - - /content-type@1.0.5: - resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} - engines: {node: '>= 0.6'} - dev: false - - /cookie-signature@1.0.6: - resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} - dev: false - - /cookie@0.6.0: - resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} - engines: {node: '>= 0.6'} - dev: false - - /cors@2.8.5: - resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} - engines: {node: '>= 0.10'} - dependencies: - object-assign: 4.1.1 - vary: 1.1.2 - dev: false - - /create-require@1.1.1: - resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - dev: true - - /debug@2.6.9: - resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.0.0 - dev: false - - /debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - dev: false - - /define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - dev: false - - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: false - - /denque@2.1.0: - resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==} - engines: {node: '>=0.10'} - dev: false - - /depd@2.0.0: - resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} - engines: {node: '>= 0.8'} - dev: false - - /destroy@1.2.0: - resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} - engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - dev: false - - /detect-libc@2.0.3: - resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} - engines: {node: '>=8'} - dev: false - - /diff@4.0.2: - resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} - engines: {node: '>=0.3.1'} - dev: true - - /ecdsa-sig-formatter@1.0.11: - resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==} - dependencies: - safe-buffer: 5.2.1 - dev: true - - /ee-first@1.1.1: - resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - dev: false - - /encodeurl@1.0.2: - resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} - engines: {node: '>= 0.8'} - dev: false - - /es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.4 - dev: false - - /es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - dev: false - - /escape-html@1.0.3: - resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} - dev: false - - /etag@1.8.1: - resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} - engines: {node: '>= 0.6'} - dev: false - - /express@4.19.2: - resolution: {integrity: sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==} - engines: {node: '>= 0.10.0'} - dependencies: - accepts: 1.3.8 - array-flatten: 1.1.1 - body-parser: 1.20.2 - content-disposition: 0.5.4 - content-type: 1.0.5 - cookie: 0.6.0 - cookie-signature: 1.0.6 - debug: 2.6.9 - depd: 2.0.0 - encodeurl: 1.0.2 - escape-html: 1.0.3 - etag: 1.8.1 - finalhandler: 1.2.0 - fresh: 0.5.2 - http-errors: 2.0.0 - merge-descriptors: 1.0.1 - methods: 1.1.2 - on-finished: 2.4.1 - parseurl: 1.3.3 - path-to-regexp: 0.1.7 - proxy-addr: 2.0.7 - qs: 6.11.0 - range-parser: 1.2.1 - safe-buffer: 5.2.1 - send: 0.18.0 - serve-static: 1.15.0 - setprototypeof: 1.2.0 - statuses: 2.0.1 - type-is: 1.6.18 - utils-merge: 1.0.1 - vary: 1.1.2 - transitivePeerDependencies: - - supports-color - dev: false - - /finalhandler@1.2.0: - resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} - engines: {node: '>= 0.8'} - dependencies: - debug: 2.6.9 - encodeurl: 1.0.2 - escape-html: 1.0.3 - on-finished: 2.4.1 - parseurl: 1.3.3 - statuses: 2.0.1 - unpipe: 1.0.0 - transitivePeerDependencies: - - supports-color - dev: false - - /follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: false - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: false - - /forwarded@0.2.0: - resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} - engines: {node: '>= 0.6'} - dev: false - - /fresh@0.5.2: - resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} - engines: {node: '>= 0.6'} - dev: false - - /function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - dev: false - - /generate-function@2.3.1: - resolution: {integrity: sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==} - dependencies: - is-property: 1.0.2 - dev: false - - /get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - dev: false - - /gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - dependencies: - get-intrinsic: 1.2.4 - dev: false - - /has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - dependencies: - es-define-property: 1.0.0 - dev: false - - /has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - dev: false - - /has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - dev: false - - /hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - dependencies: - function-bind: 1.1.2 - dev: false - - /http-errors@2.0.0: - resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} - engines: {node: '>= 0.8'} - dependencies: - depd: 2.0.0 - inherits: 2.0.4 - setprototypeof: 1.2.0 - statuses: 2.0.1 - toidentifier: 1.0.1 - dev: false - - /iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - dependencies: - safer-buffer: 2.1.2 - dev: false - - /iconv-lite@0.6.3: - resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} - engines: {node: '>=0.10.0'} - dependencies: - safer-buffer: 2.1.2 - dev: false - - /inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: false - - /ioredis@5.4.1: - resolution: {integrity: sha512-2YZsvl7jopIa1gaePkeMtd9rAcSjOOjPtpcLlOeusyO+XH2SK5ZcT+UCrElPP+WVIInh2TzeI4XW9ENaSLVVHA==} - engines: {node: '>=12.22.0'} - dependencies: - '@ioredis/commands': 1.2.0 - cluster-key-slot: 1.1.2 - debug: 4.3.4 - denque: 2.1.0 - lodash.defaults: 4.2.0 - lodash.isarguments: 3.1.0 - redis-errors: 1.2.0 - redis-parser: 3.0.0 - standard-as-callback: 2.1.0 - transitivePeerDependencies: - - supports-color - dev: false - - /ipaddr.js@1.9.1: - resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} - engines: {node: '>= 0.10'} - dev: false - - /is-arrayish@0.3.2: - resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} - dev: false - - /is-property@1.0.2: - resolution: {integrity: sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==} - dev: false - - /jsonwebtoken@9.0.2: - resolution: {integrity: sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==} - engines: {node: '>=12', npm: '>=6'} - dependencies: - jws: 3.2.2 - lodash.includes: 4.3.0 - lodash.isboolean: 3.0.3 - lodash.isinteger: 4.0.4 - lodash.isnumber: 3.0.3 - lodash.isplainobject: 4.0.6 - lodash.isstring: 4.0.1 - lodash.once: 4.1.1 - ms: 2.1.3 - semver: 7.6.3 - dev: true - - /jwa@1.4.1: - resolution: {integrity: sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==} - dependencies: - buffer-equal-constant-time: 1.0.1 - ecdsa-sig-formatter: 1.0.11 - safe-buffer: 5.2.1 - dev: true - - /jws@3.2.2: - resolution: {integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==} - dependencies: - jwa: 1.4.1 - safe-buffer: 5.2.1 - dev: true - - /lodash.defaults@4.2.0: - resolution: {integrity: sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==} - dev: false - - /lodash.includes@4.3.0: - resolution: {integrity: sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==} - dev: true - - /lodash.isarguments@3.1.0: - resolution: {integrity: sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==} - dev: false - - /lodash.isboolean@3.0.3: - resolution: {integrity: sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==} - dev: true - - /lodash.isinteger@4.0.4: - resolution: {integrity: sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==} - dev: true - - /lodash.isnumber@3.0.3: - resolution: {integrity: sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==} - dev: true - - /lodash.isplainobject@4.0.6: - resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} - dev: true - - /lodash.isstring@4.0.1: - resolution: {integrity: sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==} - dev: true - - /lodash.once@4.1.1: - resolution: {integrity: sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==} - dev: true - - /long@5.2.3: - resolution: {integrity: sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==} - dev: false - - /lru-cache@7.18.3: - resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} - engines: {node: '>=12'} - dev: false - - /lru-cache@8.0.5: - resolution: {integrity: sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==} - engines: {node: '>=16.14'} - dev: false - - /make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - dev: true - - /media-typer@0.3.0: - resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} - engines: {node: '>= 0.6'} - dev: false - - /merge-descriptors@1.0.1: - resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} - dev: false - - /methods@1.1.2: - resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} - engines: {node: '>= 0.6'} - dev: false - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: false - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: false - - /mime@1.6.0: - resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} - engines: {node: '>=4'} - hasBin: true - dev: false - - /ms@2.0.0: - resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} - dev: false - - /ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: false - - /ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - /mysql2@3.9.7: - resolution: {integrity: sha512-KnJT8vYRcNAZv73uf9zpXqNbvBG7DJrs+1nACsjZP1HMJ1TgXEy8wnNilXAn/5i57JizXKtrUtwDB7HxT9DDpw==} - engines: {node: '>= 8.0'} - dependencies: - denque: 2.1.0 - generate-function: 2.3.1 - iconv-lite: 0.6.3 - long: 5.2.3 - lru-cache: 8.0.5 - named-placeholders: 1.1.3 - seq-queue: 0.0.5 - sqlstring: 2.3.3 - dev: false - - /named-placeholders@1.1.3: - resolution: {integrity: sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==} - engines: {node: '>=12.0.0'} - dependencies: - lru-cache: 7.18.3 - dev: false - - /negotiator@0.6.3: - resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} - engines: {node: '>= 0.6'} - dev: false - - /object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - dev: false - - /object-inspect@1.13.1: - resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} - dev: false - - /on-finished@2.4.1: - resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} - engines: {node: '>= 0.8'} - dependencies: - ee-first: 1.1.1 - dev: false - - /parseurl@1.3.3: - resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} - engines: {node: '>= 0.8'} - dev: false - - /path-to-regexp@0.1.7: - resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} - dev: false - - /proxy-addr@2.0.7: - resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} - engines: {node: '>= 0.10'} - dependencies: - forwarded: 0.2.0 - ipaddr.js: 1.9.1 - dev: false - - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: false - - /qs@6.11.0: - resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} - engines: {node: '>=0.6'} - dependencies: - side-channel: 1.0.6 - dev: false - - /range-parser@1.2.1: - resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} - engines: {node: '>= 0.6'} - dev: false - - /raw-body@2.5.2: - resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} - engines: {node: '>= 0.8'} - dependencies: - bytes: 3.1.2 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - unpipe: 1.0.0 - dev: false - - /redis-errors@1.2.0: - resolution: {integrity: sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==} - engines: {node: '>=4'} - dev: false - - /redis-parser@3.0.0: - resolution: {integrity: sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==} - engines: {node: '>=4'} - dependencies: - redis-errors: 1.2.0 - dev: false - - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - /safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - dev: false - - /semver@7.6.3: - resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} - engines: {node: '>=10'} - hasBin: true - - /send@0.18.0: - resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} - engines: {node: '>= 0.8.0'} - dependencies: - debug: 2.6.9 - depd: 2.0.0 - destroy: 1.2.0 - encodeurl: 1.0.2 - escape-html: 1.0.3 - etag: 1.8.1 - fresh: 0.5.2 - http-errors: 2.0.0 - mime: 1.6.0 - ms: 2.1.3 - on-finished: 2.4.1 - range-parser: 1.2.1 - statuses: 2.0.1 - transitivePeerDependencies: - - supports-color - dev: false - - /seq-queue@0.0.5: - resolution: {integrity: sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==} - dev: false - - /serve-static@1.15.0: - resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} - engines: {node: '>= 0.8.0'} - dependencies: - encodeurl: 1.0.2 - escape-html: 1.0.3 - parseurl: 1.3.3 - send: 0.18.0 - transitivePeerDependencies: - - supports-color - dev: false - - /set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - dependencies: - define-data-property: 1.1.4 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - gopd: 1.0.1 - has-property-descriptors: 1.0.2 - dev: false - - /setprototypeof@1.2.0: - resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} - dev: false - - /sharp@0.33.5: - resolution: {integrity: sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==} - engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} - requiresBuild: true - dependencies: - color: 4.2.3 - detect-libc: 2.0.3 - semver: 7.6.3 - optionalDependencies: - '@img/sharp-darwin-arm64': 0.33.5 - '@img/sharp-darwin-x64': 0.33.5 - '@img/sharp-libvips-darwin-arm64': 1.0.4 - '@img/sharp-libvips-darwin-x64': 1.0.4 - '@img/sharp-libvips-linux-arm': 1.0.5 - '@img/sharp-libvips-linux-arm64': 1.0.4 - '@img/sharp-libvips-linux-s390x': 1.0.4 - '@img/sharp-libvips-linux-x64': 1.0.4 - '@img/sharp-libvips-linuxmusl-arm64': 1.0.4 - '@img/sharp-libvips-linuxmusl-x64': 1.0.4 - '@img/sharp-linux-arm': 0.33.5 - '@img/sharp-linux-arm64': 0.33.5 - '@img/sharp-linux-s390x': 0.33.5 - '@img/sharp-linux-x64': 0.33.5 - '@img/sharp-linuxmusl-arm64': 0.33.5 - '@img/sharp-linuxmusl-x64': 0.33.5 - '@img/sharp-wasm32': 0.33.5 - '@img/sharp-win32-ia32': 0.33.5 - '@img/sharp-win32-x64': 0.33.5 - dev: false - - /side-channel@1.0.6: - resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 - object-inspect: 1.13.1 - dev: false - - /simple-swizzle@0.2.2: - resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} - dependencies: - is-arrayish: 0.3.2 - dev: false - - /sqlstring@2.3.3: - resolution: {integrity: sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==} - engines: {node: '>= 0.6'} - dev: false - - /standard-as-callback@2.1.0: - resolution: {integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==} - dev: false - - /statuses@2.0.1: - resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} - engines: {node: '>= 0.8'} - dev: false - - /toidentifier@1.0.1: - resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} - engines: {node: '>=0.6'} - dev: false - - /ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5): - resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.11 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 20.12.12 - acorn: 8.11.3 - acorn-walk: 8.3.2 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.4.5 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - dev: true - - /tslib@2.7.0: - resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} - requiresBuild: true - dev: false - optional: true - - /type-is@1.6.18: - resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} - engines: {node: '>= 0.6'} - dependencies: - media-typer: 0.3.0 - mime-types: 2.1.35 - dev: false - - /typescript@5.4.5: - resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} - engines: {node: '>=14.17'} - hasBin: true - dev: true - - /undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - - /unpipe@1.0.0: - resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} - engines: {node: '>= 0.8'} - dev: false - - /utils-merge@1.0.1: - resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} - engines: {node: '>= 0.4.0'} - dev: false - - /v8-compile-cache-lib@3.0.1: - resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - dev: true - - /vary@1.1.2: - resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} - engines: {node: '>= 0.8'} - dev: false - - /yn@3.1.1: - resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} - engines: {node: '>=6'} - dev: true diff --git a/Server/src/APIs/BlogComment.ts b/Server/src/APIs/BlogComment.ts deleted file mode 100644 index 50ddbc6..0000000 --- a/Server/src/APIs/BlogComment.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { API } from "../Plugs/API/API"; -import ServerStdResponse from "../ServerStdResponse"; -import Database from '../Plugs/Database' -import MountUserAgent from "../Plugs/Middleware/MountUserAgent"; -import axios from "axios"; -import MountIP from "../Plugs/Middleware/MountIP"; -import { BlogComment as BlogCommentType } from "@/Types/Schema" - -// 提交博客评论 -class BlogComment extends API { - constructor() { - super('POST', '/blogComment', MountUserAgent, MountIP); - } - - public async onRequset(data: any, res: any) { - let { bloguuid, content, name, _userAgent, _ip } = data; - if (!bloguuid || bloguuid.length != 32 || typeof content != 'string' || typeof name != 'string' - || content.trim() == '' || name.trim() == '') { - return res.json(ServerStdResponse.INVALID_PARAMS); - } - - // 处理数据 - content = content.trim(); - name = name.trim(); - _ip = (_ip as string).replace('::ffff:', ''); - // 获取IPAddress - let ip_address = '未知' - try { - let ipAddressRes = await axios.get(`https://mesh.if.iqiyi.com/aid/ip/info?version=1.1.1&ip=` + _ip); - if (ipAddressRes.data && ipAddressRes.data.msg == 'success') { - - ip_address = ipAddressRes.data.data.countryCN == '中国' ? ipAddressRes.data.data.provinceCN : ipAddressRes.data.data.countryCN; - } - } catch (error) { - this.logger.warn('获取IP属地失败', error); - } - - let blogLikeRes = await Database.query('INSERT INTO blog_comment (uuid, content, name, ip, ip_address, user_agent, display, created_at) VALUES ($1,$2,$3,$4,$5,$6,true,$7)', [bloguuid, content.trim(), name.trim(), _ip, ip_address, _userAgent, new Date()]); - if (!blogLikeRes) { - this.logger.error('发布博客评论时,数据库发生错误'); - return res.json(ServerStdResponse.SERVER_ERROR); - } - return res.json(ServerStdResponse.OK); - } -} - -export default BlogComment; \ No newline at end of file diff --git a/Server/src/APIs/BlogLike.ts b/Server/src/APIs/BlogLike.ts deleted file mode 100644 index 9df219e..0000000 --- a/Server/src/APIs/BlogLike.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { API } from "../Plugs/API/API"; -import ServerStdResponse from "../ServerStdResponse"; -import Database from '../Plugs/Database' -import { Buffer } from 'buffer'; -import axios from "axios"; -import { Blog } from "@/Types/Schema"; - - -// 点赞 -class BlogLike extends API { - constructor() { - super('POST', '/blogLike'); - } - private defaultAccessLevel = 6; - - public async onRequset(data: any, res: any) { - let { bloguuid } = data; - if (!bloguuid || bloguuid.length != 32) { - return res.json(ServerStdResponse.INVALID_PARAMS); - } - - let blogLikeRes = await Database.query('UPDATE blog SET like_count = like_count + 1 WHERE access_level > $1 AND uuid = $2 ', [this.defaultAccessLevel, bloguuid]); - if (!blogLikeRes) { - this.logger.error('点赞博客时,数据库发生错误'); - return res.json(ServerStdResponse.SERVER_ERROR); - } - return res.json(ServerStdResponse.OK); - } -} - -export default BlogLike; \ No newline at end of file diff --git a/Server/src/APIs/Console/DelBlog.ts b/Server/src/APIs/Console/DelBlog.ts deleted file mode 100644 index e73d6cf..0000000 --- a/Server/src/APIs/Console/DelBlog.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { API } from "../../Plugs/API/API"; -import ServerStdResponse from "../../ServerStdResponse"; -import Database from '../../Plugs/Database' -import Auth from "../../Plugs/Middleware/Auth"; - -// 删除博客 -class DelBlog extends API { - constructor() { - super('DELETE', '/console/blog', Auth); - } - - public async onRequset(data: any, res: any) { - let { uuid } = data; - if (!uuid) { - return res.json(ServerStdResponse.PARAMS_MISSING); - } - let execRes = await Database.query('DELETE FROM blog WHERE uuid = $1', [uuid]); - - if (!execRes) { - return res.json(ServerStdResponse.SERVER_ERROR); - } - return res.json({ ...ServerStdResponse.OK }); - } -} - -export default DelBlog; \ No newline at end of file diff --git a/Server/src/APIs/Console/DelResource.ts b/Server/src/APIs/Console/DelResource.ts deleted file mode 100644 index 3850cf8..0000000 --- a/Server/src/APIs/Console/DelResource.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { API } from "../../Plugs/API/API"; -import ServerStdResponse from "../../ServerStdResponse"; -import Database from '../../Plugs/Database' -import Auth from "../../Plugs/Middleware/Auth"; - -// 删除资源 -class DelResource extends API { - constructor() { - super('DELETE', '/console/resource', Auth); - } - - public async onRequset(data: any, res: any) { - let { uuid } = data; - if (!uuid) { - return res.json(ServerStdResponse.PARAMS_MISSING); - } - let execRes = await Database.query('DELETE FROM resource WHERE uuid = $1', [uuid]); - - if (!execRes) { - return res.json(ServerStdResponse.SERVER_ERROR); - } - return res.json({ ...ServerStdResponse.OK }); - } -} - -export default DelResource; \ No newline at end of file diff --git a/Server/src/APIs/Console/GetBlogs.ts b/Server/src/APIs/Console/GetBlogs.ts deleted file mode 100644 index 8f17a59..0000000 --- a/Server/src/APIs/Console/GetBlogs.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { API } from "../../Plugs/API/API"; -import ServerStdResponse from "../../ServerStdResponse"; -import Database from '../../Plugs/Database' -import Auth from "../../Plugs/Middleware/Auth"; -import { Blog } from "@/Types/Schema"; - -// 获取博客列表 -class GetBlogs extends API { - constructor() { - super('GET', '/console/blogs', Auth); - } - - public async onRequset(data: any, res: any) { - let resourcesRes = await Database.query("SELECT * FROM blog ORDER BY created_at DESC"); - if (!resourcesRes) { - return res.json(ServerStdResponse.SERVER_ERROR); - } - return res.json({ ...ServerStdResponse.OK, data: resourcesRes }); - } -} - -export default GetBlogs; \ No newline at end of file diff --git a/Server/src/APIs/Console/GetLoginStatus.ts b/Server/src/APIs/Console/GetLoginStatus.ts deleted file mode 100644 index 5bcaed9..0000000 --- a/Server/src/APIs/Console/GetLoginStatus.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { API, RequestData } from "../../Plugs/API/API"; -import ServerStdResponse from "../../ServerStdResponse"; -import Database from '../../Plugs/Database' -import Auth from "../../Plugs/Middleware/Auth"; -import jwt from "jsonwebtoken"; -import config from "../../config"; - -// 获取登录状态 -class GetLoginStatus extends API { - constructor() { - super('GET', '/console/loginStatus', Auth); - } - - public async onRequset(data: RequestData, res: any) { - const { uuid } = data._jwt; - const jwtPayload = { - uuid, - loginTime: Date.now() - } - - const token = jwt.sign(jwtPayload, config.jwt.secret, { expiresIn: config.jwt.expiresIn }); - return res.json({ - ...ServerStdResponse.OK, - data: { - token - } - }); - } -} - -export default GetLoginStatus; \ No newline at end of file diff --git a/Server/src/APIs/Console/GetOSSToken.ts b/Server/src/APIs/Console/GetOSSToken.ts deleted file mode 100644 index 61f989e..0000000 --- a/Server/src/APIs/Console/GetOSSToken.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { API } from "../../Plugs/API/API"; -import ServerStdResponse from "../../ServerStdResponse"; -import { STS } from 'ali-oss' -import Auth from "../../Plugs/Middleware/Auth"; -import config from "../../config"; - -// 获取OSS Token -class GetOSSToken extends API { - constructor() { - super('GET', '/console/ossToken', Auth); - } - - public async onRequset(data: any, res: any) { - // 进行OSS_Upload_STS_Token获取 - let sts = new STS({ - accessKeyId: config.oss.accessKeyId, - accessKeySecret: config.oss.accessKeySecret - }); - let policy = { - "Version": "1", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - // "oss:GetObject", - // "oss:PutObject", - // "oss:ListObject" - "oss:*" - ], - "Resource": [ - // `acs:oss:*:*:tone-personal/${config.oss.dir}/*`.toString() - "*" - // `acs:oss:*:tone-personal/*`.toString() - ] - } - ] - }; - try { - let sts_res = await sts.assumeRole(config.oss.roleArn, policy, config.oss.stsExpirationSec); - let sts_token: any = { - AccessKeyId: sts_res.credentials.AccessKeyId, - AccessKeySecret: sts_res.credentials.AccessKeySecret, - SecurityToken: sts_res.credentials.SecurityToken, - OSSRegion: config.oss.region, - Bucket: config.oss.bucket, - ExpirationSec: config.oss.stsExpirationSec, - } - this.logger.info('STS AssumeRol 成功'); - res.json({ ...ServerStdResponse.OK, data: sts_token }); - return; - } catch (error: any) { - this.logger.error('STS AssumeRole 获取时发生错误', error.message); - res.json(ServerStdResponse.SERVER_ERROR); - return; - } - } -} - -export default GetOSSToken; \ No newline at end of file diff --git a/Server/src/APIs/Console/GetResources.ts b/Server/src/APIs/Console/GetResources.ts deleted file mode 100644 index 026cbb9..0000000 --- a/Server/src/APIs/Console/GetResources.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { API } from "../../Plugs/API/API"; -import ServerStdResponse from "../../ServerStdResponse"; -import Database from '../../Plugs/Database' -import Auth from "../../Plugs/Middleware/Auth"; -import { Resource } from "@/Types/Schema"; - -// 获取资源列表 -class GetResources extends API { - constructor() { - super('GET', '/console/resources', Auth); - } - - public async onRequset(data: any, res: any) { - // const { uuid } = data._jwt; - let resourcesRes = await Database.query("SELECT * FROM resource ORDER BY type, recommand, created_at DESC"); - if (!resourcesRes) { - return res.json(ServerStdResponse.SERVER_ERROR); - } - return res.json({ ...ServerStdResponse.OK, data: resourcesRes }); - } -} - -export default GetResources; \ No newline at end of file diff --git a/Server/src/APIs/Console/Login.ts b/Server/src/APIs/Console/Login.ts deleted file mode 100644 index 3bc4445..0000000 --- a/Server/src/APIs/Console/Login.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { API } from "../../Plugs/API/API"; -import ServerStdResponse from "../../ServerStdResponse"; -import Database from '../../Plugs/Database' -import MountUserAgent from "../../Plugs/Middleware/MountUserAgent"; -import MountIP from "../../Plugs/Middleware/MountIP"; -import config from "../../config"; -import jwt from 'jsonwebtoken' -import crypto from 'crypto' -import { User } from "@/Types/Schema"; - -// 登录 -class Login extends API { - constructor() { - super('POST', '/console/login', MountUserAgent, MountIP); - } - - public async onRequset(data: any, res: any) { - let { username, password, _ip, _userAgent } = data; - if (!username || !password) { - return res.json(ServerStdResponse.PARAMS_MISSING); - } - - // 检查用户是否存在 - let userInfoRes = await Database.query('SELECT * FROM "user" WHERE username = $1', [username]); - if (!userInfoRes) { - return res.json(ServerStdResponse.SERVER_ERROR); - } - if (userInfoRes.length != 1) { - return res.json(ServerStdResponse.USER.NOTFOUND); - } - const UserInfo = userInfoRes[0]; - // 检查密码是否正确 - if (crypto.createHash('sha256').update(`${UserInfo.salt}${password}`).digest('hex') != UserInfo.password) { - return res.json(ServerStdResponse.USER.PASSWORD_ERROR); - } - - // 准备jwtToken - const jwtPayload = { - uuid: UserInfo.uuid, - loginTime: Date.now() - } - let jwtToken = jwt.sign(jwtPayload, config.jwt.secret, { expiresIn: config.jwt.expiresIn }); - - // 写入登录日志 - Database.query('INSERT INTO user_login_log (user_uuid, ip, user_agent, time) VALUES ($1,$2,$3,$4)', [UserInfo.uuid, _ip, _userAgent, Date.now()]); - return res.json({ ...ServerStdResponse.OK, data: { token: jwtToken } }); - } -} - -export default Login; \ No newline at end of file diff --git a/Server/src/APIs/Console/SaveBlog.ts b/Server/src/APIs/Console/SaveBlog.ts deleted file mode 100644 index 2f69832..0000000 --- a/Server/src/APIs/Console/SaveBlog.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { API } from "../../Plugs/API/API"; -import ServerStdResponse from "../../ServerStdResponse"; -import Database from '../../Plugs/Database' -import Auth from "../../Plugs/Middleware/Auth"; -import crypto from 'crypto' -import { Blog } from "@/Types/Schema"; - -// 保存博客 -class SaveBlog extends API { - constructor() { - super('POST', '/console/saveBlog', Auth); - } - - public async onRequset(data: any, res: any) { - let { uuid, title, description, created_at, src, access_level } = data; - if (!title || !description || !created_at || !src || !access_level) { - return res.json(ServerStdResponse.PARAMS_MISSING); - } - let execRes: any; - if (uuid) { - // 保存 - execRes = await Database.query('UPDATE blog SET title = $1, description = $2, created_at = $3, src = $4, access_level = $5 WHERE uuid = $6', [title, description, created_at, src, access_level, uuid]); - } else { - // 新建 - const uuid = crypto.createHash('md5').update(`${Math.random()}${Date.now()}`).digest('hex'); - execRes = await Database.query('INSERT INTO blog (uuid, title, description, src, created_at, access_level, visit_count, like_count) VALUES ($1,$2,$3,$4,$5,$6,$7,$8)', [uuid, title, description, src, created_at, access_level, 0, 0]); - } - - if (!execRes) { - return res.json(ServerStdResponse.SERVER_ERROR); - } - return res.json({ ...ServerStdResponse.OK }); - } -} - -export default SaveBlog; \ No newline at end of file diff --git a/Server/src/APIs/Console/SaveResource.ts b/Server/src/APIs/Console/SaveResource.ts deleted file mode 100644 index 12e5c2b..0000000 --- a/Server/src/APIs/Console/SaveResource.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { API } from "../../Plugs/API/API"; -import ServerStdResponse from "../../ServerStdResponse"; -import Database from '../../Plugs/Database' -import Auth from "../../Plugs/Middleware/Auth"; -import { Resource } from "@/Types/Schema"; -import Crypto from 'crypto' - -// 保存资源 -class SaveResource extends API { - constructor() { - super('POST', '/console/saveResource', Auth); - } - - public async onRequset(data: any, res: any) { - let { uuid, type, recommand, title, describe, icon_src, addition, src } = data; - if (!type || !recommand || !title || !describe || !icon_src || !addition || !src) { - return res.json(ServerStdResponse.PARAMS_MISSING); - } - let execRes: any; - if (uuid) { - // 保存 - execRes = await Database.query('UPDATE resource SET "type" = $1, "recommand" = $2, "title" = $3, "describe" = $4, "addition" = $5, "icon_src" = $6, "src" = $7 WHERE "uuid" = $8', [type, recommand, title, describe, addition, icon_src, src, uuid]); - } else { - // 新建 - uuid = Crypto.createHash('md5').update(`${Math.random()}${Date.now()}`).digest('hex'); - execRes = await Database.query('INSERT INTO resource ("uuid","type", "recommand", "title", "describe", "addition", "icon_src", "src", "created_at") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9)', [uuid, type, recommand, title, describe, addition, icon_src, src, new Date()]); - } - - if (!execRes) { - return res.json(ServerStdResponse.SERVER_ERROR); - } - return res.json({ ...ServerStdResponse.OK }); - } -} - -export default SaveResource; \ No newline at end of file diff --git a/Server/src/APIs/Console/SetBlogPasswd.ts b/Server/src/APIs/Console/SetBlogPasswd.ts deleted file mode 100644 index c34e993..0000000 --- a/Server/src/APIs/Console/SetBlogPasswd.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { API } from "../../Plugs/API/API"; -import ServerStdResponse from "../../ServerStdResponse"; -import Database from '../../Plugs/Database' -import Auth from "../../Plugs/Middleware/Auth"; -import crypto from 'crypto' -import { Blog } from "@/Types/Schema"; - -// 设置博客密码 -class SetBlogPasswd extends API { - constructor() { - super('POST', '/console/setBlogPasswd', Auth); - } - - public async onRequset(data: any, res: any) { - let { uuid, passwd } = data; - if (!uuid || !passwd) { - return res.json(ServerStdResponse.PARAMS_MISSING); - } - const encrypt_p = crypto.createHash('sha256').update(passwd).digest('hex'); - Database.query('UPDATE blog SET encrypt_p = $1 WHERE uuid = $2', [encrypt_p, uuid]); - return res.json({ ...ServerStdResponse.OK }); - } -} - -export default SetBlogPasswd; \ No newline at end of file diff --git a/Server/src/APIs/GetBlogComment.ts b/Server/src/APIs/GetBlogComment.ts deleted file mode 100644 index aee59f8..0000000 --- a/Server/src/APIs/GetBlogComment.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { API } from "../Plugs/API/API"; -import ServerStdResponse from "../ServerStdResponse"; -import Database from '../Plugs/Database' -import { BlogComment } from "@/Types/Schema"; - -// 获取博客评论 -class GetBlogComment extends API { - constructor() { - super('GET', '/blogComment'); - } - - private pageSize = 100; - - public async onRequset(data: any, res: any) { - let { bloguuid, page = 1 } = data; - if (!bloguuid || bloguuid.length != 32 || page < 1) { - return res.json(ServerStdResponse.INVALID_PARAMS); - } - - let blogCommentRes = await Database.query('SELECT content, name, ip_address, created_at FROM blog_comment WHERE uuid = $1 AND display = true ORDER BY created_at DESC LIMIT $2 OFFSET $3;', [bloguuid, this.pageSize, (page - 1) * this.pageSize]); - if (!blogCommentRes) { - this.logger.error('获取博客评论时,数据库发生错误'); - return res.json(ServerStdResponse.SERVER_ERROR); - } - return res.json({ ...ServerStdResponse.OK, data: blogCommentRes }); - } -} - -export default GetBlogComment; \ No newline at end of file diff --git a/Server/src/APIs/GetBlogContent.ts b/Server/src/APIs/GetBlogContent.ts deleted file mode 100644 index 3c94ff7..0000000 --- a/Server/src/APIs/GetBlogContent.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { API } from "../Plugs/API/API"; -import ServerStdResponse from "../ServerStdResponse"; -import Database from '../Plugs/Database' -import { Buffer } from 'buffer'; -import axios from "axios"; -import crypto from 'crypto' -import MountIP from "../Plugs/Middleware/MountIP"; -import { Blog } from "@/Types/Schema"; - -// 获取博客内容 -class GetBlogContent extends API { - constructor() { - super('GET', '/blogContent', MountIP); - } - private AccessLevelRule = { - allow: [8, 10], - encrypt_allow: [7, 9] - }; - - public async onRequset(data: any, res: any) { - let { bloguuid, passwd } = data; - if (!bloguuid || bloguuid.length != 32) { - return res.json(ServerStdResponse.INVALID_PARAMS); - } - - let blogContentRes = await Database.query(`SELECT * from blog WHERE access_level in (${this.AccessLevelRule.allow.join(',')}) AND uuid = $1 `, [bloguuid]); - if (!blogContentRes) { - this.logger.error('查询时数据库发生错误'); - return res.json(ServerStdResponse.SERVER_ERROR); - } - if (blogContentRes.length == 0) { - // 公开范围不可见,查询允许无连接加密查看的数据 - blogContentRes = await Database.query(`SELECT * from blog WHERE access_level in (${this.AccessLevelRule.encrypt_allow.join(',')}) AND uuid = $1 `, [bloguuid]); - if (!blogContentRes) { - this.logger.error('查询时数据库发生错误'); - return res.json(ServerStdResponse.SERVER_ERROR); - } - if (blogContentRes.length != 1) { - this.logger.warn('查询的博客不存在或不可见', bloguuid); - return res.json(ServerStdResponse.BLOG.NOTFOUND); - } - - // 验证密码是否存在和正确 - if (!passwd) { - this.logger.warn(`客户端[${data._ip}]尝试访问受限制的博客,但并未提供密码`) - return res.json(ServerStdResponse.BLOG.PROTECT_FLAG) - } - if (crypto.createHash('sha256').update(passwd).digest('hex') != blogContentRes[0].encrypt_p){ - this.logger.warn(`客户端[${data._ip}]尝试访问受限制的博客,并提供了错误的密码:${passwd}`) - return res.json(ServerStdResponse.BLOG.PASSWD_ERROR) - } - this.logger.info(`客户端[${data._ip}]访问了受限制的博客`) - } - // 返回处理后的数据 - try { - const markdownUrl = blogContentRes[0].src; - const response = await axios.get(markdownUrl); - const base64Content = Buffer.from(response.data, 'utf-8').toString('base64'); - - // 访问次数+1 - Database.query('UPDATE blog SET visit_count = visit_count + 1 WHERE uuid = $1', [bloguuid]); - return res.json({ - ...ServerStdResponse.OK, data: { - data: base64Content, - info: { - title: blogContentRes[0].title, - description: blogContentRes[0].description, - created_at: blogContentRes[0].created_at, - visit_count: blogContentRes[0].visit_count, - like_count: blogContentRes[0].like_count - } - } - }); - } catch (error) { - this.logger.error('获取博客文章内容时发生错误', error) - return res.json(ServerStdResponse.SERVER_ERROR); - } - } -} - -export default GetBlogContent; \ No newline at end of file diff --git a/Server/src/APIs/GetBlogList.ts b/Server/src/APIs/GetBlogList.ts deleted file mode 100644 index 68c8b9b..0000000 --- a/Server/src/APIs/GetBlogList.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { API } from "../Plugs/API/API"; -import ServerStdResponse from "../ServerStdResponse"; -import Database from '../Plugs/Database' -import { Blog } from "@/Types/Schema"; - -// 获取博客列表 -class GetBlogList extends API { - constructor() { - super('GET', '/blogList'); - } - private defaultAccessLevel = 9; - - public async onRequset(data: any, res: any) { - let blogListRes = await Database.query('SELECT uuid, title, description, created_at, access_level, visit_count, like_count from blog WHERE access_level >= $1 ORDER BY created_at DESC', [this.defaultAccessLevel]); - if (!blogListRes) { - this.logger.error('查询时数据库发生错误'); - return res.json(ServerStdResponse.SERVER_ERROR); - } - return res.json({ ...ServerStdResponse.OK, data: blogListRes }); - } -} - -export default GetBlogList; \ No newline at end of file diff --git a/Server/src/APIs/GetResourceList.ts b/Server/src/APIs/GetResourceList.ts deleted file mode 100644 index 9ded8de..0000000 --- a/Server/src/APIs/GetResourceList.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { API } from "../Plugs/API/API"; -import ServerStdResponse from "../ServerStdResponse"; -import Database from '../Plugs/Database' -import { Resource } from "@/Types/Schema"; - -// 获取资源列表 -class GetResourceList extends API { - constructor() { - super('GET', '/resourceList'); - } - private typeList = ['resource', 'download'] - - public async onRequset(data: any, res: any) { - let { type } = data; - if (!type) { - return res.json(ServerStdResponse.PARAMS_MISSING); - } - if (!this.typeList.includes(type)) { - return res.json(ServerStdResponse.INVALID_PARAMS); - } - let resourceListRes = await Database.query('SELECT * from resource WHERE type = $1 ORDER BY recommand ASC', [type]); - if (!resourceListRes) { - this.logger.error('查询时数据库发生错误'); - return res.json(ServerStdResponse.SERVER_ERROR); - } - return res.json({ ...ServerStdResponse.OK, data: resourceListRes }); - } -} - -export default GetResourceList; \ No newline at end of file diff --git a/Server/src/APIs/GetTest.ts b/Server/src/APIs/GetTest.ts deleted file mode 100644 index 264d55e..0000000 --- a/Server/src/APIs/GetTest.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { API } from "../Plugs/API/API"; -import ServerStdResponse from "../ServerStdResponse"; - -// 测试接口 -class GetTest extends API { - constructor() { - super('GET', '/test'); - } - - public async onRequset(data: any, res: any) { - res.json(ServerStdResponse.OK); - } -} - -export default GetTest; \ No newline at end of file diff --git a/Server/src/Plugs/API/API.ts b/Server/src/Plugs/API/API.ts deleted file mode 100644 index ef31192..0000000 --- a/Server/src/Plugs/API/API.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Request, Response, NextFunction } from "express"; -import Logger from "../Logger"; -import jwt from 'jsonwebtoken' - -interface MiddlewareFunction { - (req: Request, res: Response, next: NextFunction): void; -} - -interface RequestData { - [key: string | number | symbol] : any; - _jwt?: any; - _ip?: string; -} - -abstract class API { - - protected logger: Logger; - public middlewareFunc: Function[] = []; - - /** - * @param method API方法 - * @param path API路由Path - * @param func API中间件函数 - */ - constructor(public method: string, public path: string, ...func: MiddlewareFunction[]) { - this.logger = new Logger('API][' + method + '][' + path); - this.middlewareFunc.push(...func); - } - - // to override - public abstract onRequset(data: RequestData, res: any): void; -} - -export { API }; -export type { RequestData } \ No newline at end of file diff --git a/Server/src/Plugs/API/APILoader.ts b/Server/src/Plugs/API/APILoader.ts deleted file mode 100644 index b64ab56..0000000 --- a/Server/src/Plugs/API/APILoader.ts +++ /dev/null @@ -1,53 +0,0 @@ -import express, { NextFunction, Request, Response } from "express"; -import cors from "cors"; -import Logger from "../Logger"; -import { API } from "./API"; -import ServerStdResponse from "../../ServerStdResponse"; -class APILoader { - private app = express(); - private logger = new Logger('APILoader'); - constructor(private port?: number) { - this.logger.info('API服务加载中...'); - this.app.use(express.json({ limit: '50mb' })); - this.app.use(express.urlencoded({ extended: true })); - this.app.use(cors({ - origin: ['http://localhost:5173', 'http://www.tonesc.cn', 'https://www.tonesc.cn', 'http://tonesc.cn', 'https://tonesc.cn'], - methods: ['GET', 'POST', 'DELETE'], - allowedHeaders: ['Content-Type', 'Authorization', 'Access-Control-Allow-Origin', ''], - })); - } - - add(api: { new(): API }) { - const instance = new api(); - for (let func of instance.middlewareFunc) { - this.app[instance.method.toLowerCase() as keyof express.Application](instance.path, (req: Request, res: Response, next: NextFunction) => { - func(req, res, next); - }); - this.logger.info(`[${instance.method}][${instance.path}] 已启用中间件[${func.name}]`); - } - - this.app[instance.method.toLowerCase() as keyof express.Application](instance.path, (req: Request, res: Response) => { - let ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress || req.ip; - this.logger.info(`[${instance.method}][${instance.path}] 被请求[${(ip as string).replace('::ffff:', '')}]`); - const data = Object.assign({}, req.query, req.body); - instance.onRequset(data, res); - }); - this.logger.info(`[${instance.method}][${instance.path}] 加载成功`); - } - - start(port?: number) { - if (this.port == undefined && port == undefined) - throw new Error('未指定API端口') - this.app.use((req: Request, res: Response) => { - this.logger.info(`[${req.method}][${req.url.split('?')[0]}] 该API不存在`); - res.json(ServerStdResponse.API_NOT_FOUND) - }) - this.app.listen(port || this.port, () => { - this.logger.info(`已全部加载完成,API服务开放在端口:${port || this.port}`); - }); - } -} - -export { - APILoader, -} \ No newline at end of file diff --git a/Server/src/Plugs/Database.ts b/Server/src/Plugs/Database.ts deleted file mode 100644 index 6368696..0000000 --- a/Server/src/Plugs/Database.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @file Database.ts - * @version 1.0.0 - * @description PostgreSQL数据库连接池 - */ -import pg from 'pg'; -import Logger from "./Logger"; -import config from "../config"; - -class DatabasePool { - private pool: pg.Pool; - private logger = new Logger('Database'); - - constructor() { - this.pool = this.createConnectPool(); - this.logger.info("数据库连接池已创建") - - this.pool.on('error', (err) => { - this.logger.error(`数据库连接池发生错误:${err}`); - }); - - this.testConnection(); - } - - private createConnectPool() { - return new pg.Pool({ - host: config.pg.host, - database: config.pg.database, - user: config.pg.user, - password: config.pg.password, - connectionTimeoutMillis: 5000, // 连接超时时间 - max: 20, // 最大连接数 - idleTimeoutMillis: 30000, // 空闲连接超时时间 - allowExitOnIdle: true // 允许空闲时退出 - }) - } - - private async testConnection() { - let res = await this.query<{ result: number }>("SELECT 1 + 1 As result"); - if (!res) { - this.logger.error("数据库连接测试失败"); - return; - } - if (res[0].result == 2) - return; - this.logger.error("数据库连接测试失败?"); - } - - /** - * 执行SQL查询 - * @param sql SQL语句 - * @param values 可选的查询参数列表 - * @param database 可选的数据库 - * @returns Promise 查询结果 - */ - public async query(sql: string, values?: any[]): Promise { - let connection; - try { - connection = await this.pool.connect(); - const res = await connection.query(sql, values); - return res.rows; - } catch (error) { - if (!connection) { - this.logger.error(`数据库连接失败:${error}`); - } else { - this.logger.error(`数据库查询发生错误:${error}`); - } - return undefined; - } finally { - if (connection) { - connection.release(); - } - } - } -} - -const Database = new DatabasePool(); -export default Database; \ No newline at end of file diff --git a/Server/src/Plugs/Logger.ts b/Server/src/Plugs/Logger.ts deleted file mode 100644 index f0f883d..0000000 --- a/Server/src/Plugs/Logger.ts +++ /dev/null @@ -1,40 +0,0 @@ -class Logger { - constructor(private namespace: string) { - } - - private getTime(): string { - return new Date().toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' }); - } - - public info(info: string, ...args: any): void { - args = args.map((arg: any) => { - if (typeof arg === 'object') { - return JSON.stringify(arg); - } - return arg; - }) - console.log(`\x1b[32m[${this.getTime()}][INFO][${this.namespace}]${info[0] == '[' ? '' : ' '}${info} ` + args.join(' ') + '\x1b[0m'); - } - - public warn(info: string, ...args: any): void { - args = args.map((arg: any) => { - if (typeof arg === 'object') { - return JSON.stringify(arg); - } - return arg; - }) - console.log(`\x1b[33m[${this.getTime()}][WARN][${this.namespace}]${info[0] == '[' ? '' : ' '}${info} ` + args.join(' ') + '\x1b[0m'); - } - - public error(info: string, ...args: any): void { - args = args.map((arg: any) => { - if (typeof arg === 'object') { - return JSON.stringify(arg); - } - return arg; - }) - console.log(`\x1b[31m[${this.getTime()}][ERROR][${this.namespace}]${info[0] == '[' ? '' : ' '}${info} ` + args.join(' ') + '\x1b[0m'); - } -} - -export default Logger; \ No newline at end of file diff --git a/Server/src/Plugs/Middleware/Auth.ts b/Server/src/Plugs/Middleware/Auth.ts deleted file mode 100644 index b7134fa..0000000 --- a/Server/src/Plugs/Middleware/Auth.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Request, Response, NextFunction } from "express"; -import config from "../../config"; -import ServerStdResponse from "../../ServerStdResponse"; -import Logger from "../Logger"; -import jwt from 'jsonwebtoken' -const logger = new Logger("Auth"); -const Auth = (req: Request, res: Response, next: NextFunction) => { - let token = req.headers.authorization; - try { - if (!token) { - throw new Error('空Token') - } - if(typeof token != 'string' || token.indexOf('Bearer ') == -1){ - throw new Error('格式错误的Token') - } - req.body._jwt = jwt.verify(token.replace('Bearer ',''), config.jwt.secret); - next() - } catch (error) { - let ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress || req.ip; - logger.info(`API[${req.method}][${req.url.split('?')[0]}] 请求鉴权不通过[${token}][${ip}] ${error}`); - res.json(ServerStdResponse.AUTH_ERROR); - } -} - -export default Auth; \ No newline at end of file diff --git a/Server/src/Plugs/Middleware/MountIP.ts b/Server/src/Plugs/Middleware/MountIP.ts deleted file mode 100644 index 838d488..0000000 --- a/Server/src/Plugs/Middleware/MountIP.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Request, Response, NextFunction } from "express" -import Logger from "../Logger"; -const logger = new Logger('MountIP') - -let MountIP = (req: Request, res: Response, next: NextFunction) => { - req.body._ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress || req.ip; - // logger.info(`[${req.method}][${req.url.split('?')[0]}] IP解析成功:${req.body._ip}`); - next(); -} - -export default MountIP; \ No newline at end of file diff --git a/Server/src/Plugs/Middleware/MountUserAgent.ts b/Server/src/Plugs/Middleware/MountUserAgent.ts deleted file mode 100644 index 3507e41..0000000 --- a/Server/src/Plugs/Middleware/MountUserAgent.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Request, Response, NextFunction } from "express" -import Logger from "../Logger"; -const logger = new Logger('MountUserAgent') - -let MountUserAgent = (req: Request, res: Response, next: NextFunction) => { - req.body._userAgent = req.headers['user-agent']; - logger.info(`[${req.method}][${req.url.split('?')[0]}] 用户代理解析成功:${req.body._userAgent}`); - next(); -} - -export default MountUserAgent; \ No newline at end of file diff --git a/Server/src/Plugs/Middleware/Unbind.ts b/Server/src/Plugs/Middleware/Unbind.ts deleted file mode 100644 index 1ed8d03..0000000 --- a/Server/src/Plugs/Middleware/Unbind.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Request, Response, NextFunction } from "express"; -import Logger from "../Logger"; -const logger = new Logger("Unbind"); -const Unbind = (req: Request, res: Response, next: NextFunction) => { - let ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress || req.ip; - logger.info(`API[${req.method}][${req.url.split('?')[0]}] 请求了未绑定的接口[${ip}]`); -} - -export default Unbind; \ No newline at end of file diff --git a/Server/src/Server/Server.ts b/Server/src/Server/Server.ts deleted file mode 100644 index ccec2b2..0000000 --- a/Server/src/Server/Server.ts +++ /dev/null @@ -1,62 +0,0 @@ -import Logger from "../Plugs/Logger"; -import { APILoader } from "../Plugs/API/APILoader"; -import config from "../config"; - -// 加载API -import GetTest from "../APIs/GetTest"; -import GetResourceList from "../APIs/GetResourceList"; -import GetBlogList from "../APIs/GetBlogList"; -import GetBlogContent from "../APIs/GetBlogContent"; -import BlogLike from "../APIs/BlogLike"; -import BlogComment from "../APIs/BlogComment"; -import GetBlogComment from "../APIs/GetBlogComment"; - -import Login from "../APIs/Console/Login"; -import GetResources from "../APIs/Console/GetResources"; -import GetBlogs from '../APIs/Console/GetBlogs' -import SetBlogPasswd from "../APIs/Console/SetBlogPasswd"; -import SaveResource from '../APIs/Console/SaveResource' -import DelResource from '../APIs/Console/DelResource' -import SaveBlog from '../APIs/Console/SaveBlog' -import DelBlog from '../APIs/Console/DelBlog' -import GetOSSToken from "../APIs/Console/GetOSSToken"; -import GetLoginStatus from "../APIs/Console/GetLoginStatus"; - -class Server { - private logger = new Logger('Server'); - public static instance: Server; - private apiLoader = new APILoader(); - - constructor() { - Server.instance = this; - } - - public async start() { - // 加载API - this.apiLoader.add(GetTest); - this.apiLoader.add(GetResourceList); - this.apiLoader.add(GetBlogList); - this.apiLoader.add(GetBlogContent); - this.apiLoader.add(BlogLike); - this.apiLoader.add(BlogComment); - this.apiLoader.add(GetBlogComment); - - this.apiLoader.add(Login); - this.apiLoader.add(GetResources); - this.apiLoader.add(SaveResource); - this.apiLoader.add(DelResource); - this.apiLoader.add(GetBlogs) - this.apiLoader.add(SaveBlog); - this.apiLoader.add(SetBlogPasswd); - this.apiLoader.add(DelBlog); - this.apiLoader.add(GetOSSToken); - this.apiLoader.add(GetLoginStatus); - - this.apiLoader.start(config.apiPort); - } -} - -let _Server = new Server(); -export { - _Server as server, -} \ No newline at end of file diff --git a/Server/src/ServerStdResponse.ts b/Server/src/ServerStdResponse.ts deleted file mode 100644 index af478b4..0000000 --- a/Server/src/ServerStdResponse.ts +++ /dev/null @@ -1,66 +0,0 @@ -const ServerStdResponse = { - OK: { - code: 0, - message: 'OK' - }, - PARAMS_MISSING: { - code: -1, - message: 'Parameters missing' - }, - INVALID_PARAMS: { - code: -2, - message: 'Invalid parameters' - }, - SERVER_ERROR: { - code: -3, - message: 'Server error' - }, - API_NOT_FOUND: { - code: -4, - message: 'API not found' - }, - AUTH_ERROR: { - code: -5, - message: 'Authentication error' - }, - BLOG: { - NOTFOUND: { - code: -4001, - message: 'Blog not found' - }, - PROTECT_FLAG: { - code: -4002, - message: 'Blog is protected, need password' - }, - PASSWD_ERROR: { - code: -4003, - message: 'Blog is protected, and password is not right' - } - }, - CAPTCHA: { - NOTFOUND: { - code: -5000, - message: 'captcha session not found' - }, - MAX_TRY_COUNT: { - code: -5001, - message: 'captcha session try max count' - }, - NOTRIGHT: { - code: -5002, - message: 'captcha is not right, please try again' - } - }, - USER: { - NOTFOUND: { - code: -6000, - message: 'user is not found' - }, - PASSWORD_ERROR: { - code: -6001, - message: 'user password is error' - } - } -} as const; - -export default ServerStdResponse; \ No newline at end of file diff --git a/Server/src/Types/Schema.ts b/Server/src/Types/Schema.ts deleted file mode 100644 index 89c8b7f..0000000 --- a/Server/src/Types/Schema.ts +++ /dev/null @@ -1,101 +0,0 @@ -/** 博客文章 */ -export type Blog = { - /** 博客uuid */ - uuid: string; - /** 标题 */ - title: string; - /** 描述 */ - description: string; - /** 文章md链接 */ - src: string; - /** 访问级别 */ - access_level: number; - /** 访问数 */ - visit_count: number; - /** 点赞数 */ - like_count: number; - /** 文章加密密码 */ - encrypt_p?: string; - /** 发布时间 */ - created_at: Date; -}; - -/** 博客评论 */ -export type BlogComment = { - /** 评论id */ - id: number; - /** 文章uuid */ - uuid: string; - /** 评论内容 */ - content: string; - /** 昵称 */ - name: string; - /** ip地址 */ - ip: string; - /** ip属地 */ - ip_address: string; - /** 用户代理 */ - user_agent: string; - /** 是否显示 */ - display: boolean; - /** 评论时间 */ - time: Date; -}; - -/** 资源信息 */ -export type Resource = { - /** 资源ID */ - uuid: string; - /** 资源类型 */ - type: 'download' | 'resource'; - /** 推荐程度,越小越推荐 */ - recommand?: number; - /** 标题 */ - title: string; - /** 描述 */ - describe: string; - /** 附加信息 */ - addition: any; - /** 图片url */ - icon_src: string; - /** 资源src */ - src: string; - /** 创建时间 */ - created_at: Date; -}; - -/** 用户信息 */ -export type User = { - /** 用户uuid */ - uuid: string; - /** 用户名 */ - username: string; - /** 密码salt */ - salt: string; - /** 密码hashed */ - password: string; - /** 手机号 */ - phone: string; - /** 权限列表 */ - permission: any; - /** 邮箱 */ - email?: string; - /** 创建时间 */ - created_at: Date; - /** 更新信息时间 */ - updated_at?: Date; -}; - -/** 用户登录日志 */ -export type UserLoginLog = { - /** 登陆记录id */ - id: number; - /** 用户uuid */ - user_uuid: string; - /** 登陆ip */ - ip: string; - /** 用户代理 */ - user_agent: string; - /** 登陆时间 */ - time: Date; -}; \ No newline at end of file diff --git a/Server/src/config.ts b/Server/src/config.ts deleted file mode 100644 index 71d0f73..0000000 --- a/Server/src/config.ts +++ /dev/null @@ -1,27 +0,0 @@ -const config = { - pg: { - host: 'localhost', - // host:'server.tonesc.cn', - database: 'tonecn', - user: 'tone', - password: 'Shi15023847146'// localhost - // password: '245565' // server - }, - jwt: { - secret: '17e50223f4a545ec9e36ebf08e2f71bb', - expiresIn: '1d', - }, - oss: { - accessKeyId: 'LTAI5t6ceNJqmMzPkjETgTzg', - accessKeySecret: 'Eak6jFN0koDQ0yOg5KdxubjMbQ00Tk', - roleArn: 'acs:ram::1283668906130262:role/ctbu-co-oss-role', - bucket: 'tone-personal', - region: 'oss-cn-chengdu', - callbackUrl: '', - dir: 'personal-web', - stsExpirationSec: 3600 - }, - apiPort: 23500, -} as const; - -export default config; \ No newline at end of file diff --git a/Server/src/index.ts b/Server/src/index.ts deleted file mode 100644 index 376f75c..0000000 --- a/Server/src/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import Logger from "./Plugs/Logger"; -let logger = new Logger("Server"); -logger.info('服务正启动...'); -import { server } from "./Server/Server"; -async function main() { - server.start(); -} - -main().catch((err) => { - logger.error(err); -}); \ No newline at end of file diff --git a/Server/tsconfig.json b/Server/tsconfig.json deleted file mode 100644 index 3cc2032..0000000 --- a/Server/tsconfig.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ - "baseUrl": "./src", /* Specify the base directory to resolve non-relative module names. */ - "paths": { - "@/*": ["./*"] - }, - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ - // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */ - // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ - // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ - // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./dist/", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } -} diff --git a/tonecn/src/assets/logo.jpg b/logo.jpg similarity index 100% rename from tonecn/src/assets/logo.jpg rename to logo.jpg diff --git a/tonecn/.vscode/extensions.json b/tonecn/.vscode/extensions.json deleted file mode 100644 index a7cea0b..0000000 --- a/tonecn/.vscode/extensions.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "recommendations": ["Vue.volar"] -} diff --git a/tonecn/README.md b/tonecn/README.md deleted file mode 100644 index 9dc4289..0000000 --- a/tonecn/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# tonecn - -This template should help get you started developing with Vue 3 in Vite. - -## Recommended IDE Setup - -[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). - -## Type Support for `.vue` Imports in TS - -TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. - -## Customize configuration - -See [Vite Configuration Reference](https://vitejs.dev/config/). - -## Project Setup - -```sh -npm install -``` - -### Compile and Hot-Reload for Development - -```sh -npm run dev -``` - -### Type-Check, Compile and Minify for Production - -```sh -npm run build -``` diff --git a/tonecn/auto-imports.d.ts b/tonecn/auto-imports.d.ts deleted file mode 100644 index d7d6df6..0000000 --- a/tonecn/auto-imports.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* eslint-disable */ -/* prettier-ignore */ -// @ts-nocheck -// noinspection JSUnusedGlobalSymbols -// Generated by unplugin-auto-import -export {} -declare global { - const ElMessage: typeof import('element-plus/es')['ElMessage'] - const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] -} diff --git a/tonecn/components.d.ts b/tonecn/components.d.ts deleted file mode 100644 index 6a224d7..0000000 --- a/tonecn/components.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* eslint-disable */ -// @ts-nocheck -// Generated by unplugin-vue-components -// Read more: https://github.com/vuejs/core/pull/3399 -export {} - -/* prettier-ignore */ -declare module 'vue' { - export interface GlobalComponents { - Agreement: typeof import('./src/components/Common/Agreement.vue')['default'] - BlogComment: typeof import('./src/components/Blog/BlogComment.vue')['default'] - BlogContentToolBar: typeof import('./src/components/Blog/BlogContentToolBar.vue')['default'] - Blogs: typeof import('./src/components/Console/Blogs.vue')['default'] - ElButton: typeof import('element-plus/es')['ElButton'] - ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] - ElCol: typeof import('element-plus/es')['ElCol'] - ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] - ElDialog: typeof import('element-plus/es')['ElDialog'] - ElDivider: typeof import('element-plus/es')['ElDivider'] - ElDropdown: typeof import('element-plus/es')['ElDropdown'] - ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] - ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] - ElEmpty: typeof import('element-plus/es')['ElEmpty'] - ElForm: typeof import('element-plus/es')['ElForm'] - ElFormItem: typeof import('element-plus/es')['ElFormItem'] - ElIcon: typeof import('element-plus/es')['ElIcon'] - ElImage: typeof import('element-plus/es')['ElImage'] - ElInput: typeof import('element-plus/es')['ElInput'] - ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] - ElMenu: typeof import('element-plus/es')['ElMenu'] - ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] - ElOption: typeof import('element-plus/es')['ElOption'] - ElPopover: typeof import('element-plus/es')['ElPopover'] - ElRow: typeof import('element-plus/es')['ElRow'] - ElSelect: typeof import('element-plus/es')['ElSelect'] - ElTable: typeof import('element-plus/es')['ElTable'] - ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] - ElText: typeof import('element-plus/es')['ElText'] - ElTooltip: typeof import('element-plus/es')['ElTooltip'] - ElUpload: typeof import('element-plus/es')['ElUpload'] - FileOnline: typeof import('./src/components/Console/FileOnline.vue')['default'] - Footer: typeof import('./src/components/Common/Footer.vue')['default'] - Header: typeof import('./src/components/Common/Header.vue')['default'] - Resources: typeof import('./src/components/Console/Resources.vue')['default'] - RotationVerification: typeof import('./src/components/Common/RotationVerification.vue')['default'] - RouterLink: typeof import('vue-router')['RouterLink'] - RouterView: typeof import('vue-router')['RouterView'] - Utils: typeof import('./src/components/Console/Utils.vue')['default'] - } -} diff --git a/tonecn/env.d.ts b/tonecn/env.d.ts deleted file mode 100644 index 11f02fe..0000000 --- a/tonecn/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/tonecn/index.html b/tonecn/index.html deleted file mode 100644 index 83222a1..0000000 --- a/tonecn/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - Vite App - - -
- - - - diff --git a/tonecn/package.json b/tonecn/package.json deleted file mode 100644 index 2352960..0000000 --- a/tonecn/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "tonecn", - "version": "0.0.0", - "private": true, - "type": "module", - "scripts": { - "dev": "vite", - "build": "run-p type-check \"build-only {@}\" --", - "preview": "vite preview", - "build-only": "vite build", - "type-check": "vue-tsc --build --force" - }, - "dependencies": { - "@element-plus/icons-vue": "^2.3.1", - "ace-builds": "^1.36.2", - "axios": "^1.6.8", - "highlight.js": "^11.10.0", - "marked": "^14.1.0", - "marked-highlight": "^2.1.4", - "md5": "^2.3.0", - "vue": "^3.4.21", - "vue-router": "^4.3.0", - "vue3-ace-editor": "^2.2.4" - }, - "devDependencies": { - "@tsconfig/node20": "^20.1.4", - "@types/ali-oss": "^6.16.11", - "@types/md5": "^2.3.5", - "@types/node": "^20.12.5", - "@vitejs/plugin-vue": "^5.0.4", - "@vue/tsconfig": "^0.5.1", - "ali-oss": "^6.21.0", - "autoprefixer": "^10.4.20", - "element-plus": "^2.7.3", - "npm": "^10.8.3", - "npm-run-all2": "^6.1.2", - "postcss": "^8.4.47", - "tailwindcss": "^3.4.13", - "typescript": "~5.4.0", - "unplugin-auto-import": "^0.17.6", - "unplugin-vue-components": "^0.27.0", - "vite": "^5.2.8", - "vue-tsc": "^2.0.11" - } -} diff --git a/tonecn/postcss.config.js b/tonecn/postcss.config.js deleted file mode 100644 index 2e7af2b..0000000 --- a/tonecn/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -export default { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} diff --git a/tonecn/public/favicon.ico b/tonecn/public/favicon.ico deleted file mode 100644 index df36fcf..0000000 Binary files a/tonecn/public/favicon.ico and /dev/null differ diff --git a/tonecn/shims-vue.d.ts b/tonecn/shims-vue.d.ts deleted file mode 100644 index e98bce1..0000000 --- a/tonecn/shims-vue.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare module '*.vue' { - import { DefineComponent } from 'vue'; - const component: DefineComponent<{}, {}, any>; - export default component; -} \ No newline at end of file diff --git a/tonecn/src/App.vue b/tonecn/src/App.vue deleted file mode 100644 index 7b47a39..0000000 --- a/tonecn/src/App.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/tonecn/src/assets/main.css b/tonecn/src/assets/main.css deleted file mode 100644 index 3f0eeb8..0000000 --- a/tonecn/src/assets/main.css +++ /dev/null @@ -1,15 +0,0 @@ -body{ - margin: 0 0; - padding: 0 0; - font-family: Arial, Helvetica, sans-serif; -} - -#app { - margin: 0 0; - padding: 0 0; -} - -a { - text-decoration: none; - color: #000; -} diff --git a/tonecn/src/assets/tailwind.css b/tonecn/src/assets/tailwind.css deleted file mode 100644 index bd6213e..0000000 --- a/tonecn/src/assets/tailwind.css +++ /dev/null @@ -1,3 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; \ No newline at end of file diff --git a/tonecn/src/components/Blog/BlogComment.vue b/tonecn/src/components/Blog/BlogComment.vue deleted file mode 100644 index bc7badb..0000000 --- a/tonecn/src/components/Blog/BlogComment.vue +++ /dev/null @@ -1,64 +0,0 @@ - - \ No newline at end of file diff --git a/tonecn/src/components/Blog/BlogContentToolBar.vue b/tonecn/src/components/Blog/BlogContentToolBar.vue deleted file mode 100644 index 6f6c69b..0000000 --- a/tonecn/src/components/Blog/BlogContentToolBar.vue +++ /dev/null @@ -1,99 +0,0 @@ - - diff --git a/tonecn/src/components/Common/Agreement.vue b/tonecn/src/components/Common/Agreement.vue deleted file mode 100644 index f9c575f..0000000 --- a/tonecn/src/components/Common/Agreement.vue +++ /dev/null @@ -1,30 +0,0 @@ - - \ No newline at end of file diff --git a/tonecn/src/components/Common/Footer.vue b/tonecn/src/components/Common/Footer.vue deleted file mode 100644 index 2d673b3..0000000 --- a/tonecn/src/components/Common/Footer.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - \ No newline at end of file diff --git a/tonecn/src/components/Common/Header.vue b/tonecn/src/components/Common/Header.vue deleted file mode 100644 index 6e38917..0000000 --- a/tonecn/src/components/Common/Header.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - \ No newline at end of file diff --git a/tonecn/src/components/Console/Blogs.vue b/tonecn/src/components/Console/Blogs.vue deleted file mode 100644 index ee17b52..0000000 --- a/tonecn/src/components/Console/Blogs.vue +++ /dev/null @@ -1,229 +0,0 @@ - - - \ No newline at end of file diff --git a/tonecn/src/components/Console/FileOnline.vue b/tonecn/src/components/Console/FileOnline.vue deleted file mode 100644 index 731cc62..0000000 --- a/tonecn/src/components/Console/FileOnline.vue +++ /dev/null @@ -1,476 +0,0 @@ - - \ No newline at end of file diff --git a/tonecn/src/components/Console/Resources.vue b/tonecn/src/components/Console/Resources.vue deleted file mode 100644 index 48d100b..0000000 --- a/tonecn/src/components/Console/Resources.vue +++ /dev/null @@ -1,198 +0,0 @@ - - - \ No newline at end of file diff --git a/tonecn/src/components/Console/Utils.vue b/tonecn/src/components/Console/Utils.vue deleted file mode 100644 index daa7616..0000000 --- a/tonecn/src/components/Console/Utils.vue +++ /dev/null @@ -1,44 +0,0 @@ - - \ No newline at end of file diff --git a/tonecn/src/lib/copyText.ts b/tonecn/src/lib/copyText.ts deleted file mode 100644 index 548e1ad..0000000 --- a/tonecn/src/lib/copyText.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * - * @param textToCopy 需要被复制的文本 - * @returns 成功返回 true, 不成功返回 false - */ -const copyText = (textToCopy: string): boolean => { - // 创建一个