From acd11f1ba29c385486ab93038f8f04290e9c9a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E7=94=B0=E5=BC=98?= <1240092443@qq.com> Date: Wed, 8 Jan 2025 09:59:42 +0800 Subject: [PATCH] add login --- frontend/package.json | 2 + frontend/pnpm-lock.yaml | 231 +++++++ frontend/public/ref/clientid.js | 101 ++++ frontend/public/ref/config.js | 167 ++++++ frontend/public/ref/ding.html | 111 ++++ .../src/components/desktop/LockDesktop.vue | 566 ++++++++++++------ frontend/src/stores/login.ts | 5 +- frontend/src/system/index.ts | 2 +- frontend/src/system/router.ts | 2 +- frontend/src/util/thirdlogin.ts | 0 10 files changed, 1001 insertions(+), 186 deletions(-) create mode 100644 frontend/public/ref/clientid.js create mode 100644 frontend/public/ref/config.js create mode 100644 frontend/public/ref/ding.html create mode 100644 frontend/src/util/thirdlogin.ts diff --git a/frontend/package.json b/frontend/package.json index c941648..f4c9f29 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,6 +14,7 @@ "@onlyoffice/document-editor-vue": "^1.4.0", "cherry-markdown": "^0.8.52", "dexie": "^4.0.8", + "dingtalk-jsapi": "^3.0.42", "element-plus": "^2.7.7", "file-saver": "^2.0.5", "js-md5": "^0.8.3", @@ -22,6 +23,7 @@ "moment": "^2.30.1", "pinia": "^2.1.7", "pinia-plugin-persist": "^1.0.0", + "qrcode": "^1.5.4", "swiper": "^11.1.15", "vant": "^4.9.15", "vue": "^3.4.31", diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index bea3482..7e5742a 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: dexie: specifier: ^4.0.8 version: 4.0.8 + dingtalk-jsapi: + specifier: ^3.0.42 + version: 3.0.42 element-plus: specifier: ^2.7.7 version: 2.8.6(vue@3.5.12(typescript@5.6.3)) @@ -47,6 +50,9 @@ importers: pinia-plugin-persist: specifier: ^1.0.0 version: 1.0.0(pinia@2.2.4(typescript@5.6.3)(vue@3.5.12(typescript@5.6.3)))(vue@3.5.12(typescript@5.6.3)) + qrcode: + specifier: ^1.5.4 + version: 1.5.4 swiper: specifier: ^11.1.15 version: 11.2.0 @@ -631,6 +637,14 @@ packages: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -665,6 +679,10 @@ packages: buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + cherry-markdown@0.8.52: resolution: {integrity: sha512-Bo9TN/ajPWPVbfF0wCKS2z9ILcaT50khZ0eJ4fYTD/hbNqjg7wCM9FqVZCcOWa0Rb34G6AqfIbHTjEUSIhNWoQ==} engines: {node: '>=14'} @@ -677,6 +695,16 @@ packages: resolution: {integrity: sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==} engines: {node: '>= 14.16.0'} + cliui@6.0.0: + resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -879,6 +907,10 @@ packages: supports-color: optional: true + decamelize@1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + decimal.js@10.4.3: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} @@ -897,6 +929,12 @@ packages: dexie@4.0.8: resolution: {integrity: sha512-1G6cJevS17KMDK847V3OHvK2zei899GwpDiqfEXHP1ASvme6eWJmAp9AU4s1son2TeGkWmC0g3y8ezOBPnalgQ==} + dijkstrajs@1.0.3: + resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} + + dingtalk-jsapi@3.0.42: + resolution: {integrity: sha512-cIJ+3HUnSRVAanCip5yT1rEoLPrj97BxjYKpB33sgwUDStmfPgyEzG8Hux/Sq2zYJNH6riEA9PflsDnevr1f/g==} + domexception@4.0.0: resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==} engines: {node: '>=12'} @@ -913,6 +951,9 @@ packages: elkjs@0.8.2: resolution: {integrity: sha512-L6uRgvZTH+4OF5NE/MBbzQx/WYpru1xCBE9respNj6qznEewGUIfhzmm7horWWxbNO2M0WckQypGctR8lH79xQ==} + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} @@ -970,6 +1011,10 @@ packages: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} + find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + form-data@4.0.1: resolution: {integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==} engines: {node: '>= 6'} @@ -979,6 +1024,10 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1024,6 +1073,10 @@ packages: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -1076,6 +1129,10 @@ packages: resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} engines: {node: '>=14'} + locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + lodash-es@4.17.21: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} @@ -1154,12 +1211,28 @@ packages: nwsapi@2.2.13: resolution: {integrity: sha512-cTGB9ptp9dY9A5VbMSe7fQBcl/tt22Vcqdq8+eN93rblOuE0aCFu4aZ2vMwct/2t+lFnosm8RkQW1I0Omb1UtQ==} + p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + + p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + + p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + pako@1.0.11: resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} parse5@6.0.1: resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==} + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} @@ -1195,6 +1268,10 @@ packages: pkg-types@1.2.1: resolution: {integrity: sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==} + pngjs@5.0.0: + resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} + engines: {node: '>=10.13.0'} + postcss@8.4.47: resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==} engines: {node: ^10 || ^12 || >=14} @@ -1202,6 +1279,9 @@ packages: process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + promise-polyfill@7.1.2: + resolution: {integrity: sha512-FuEc12/eKqqoRYIGBrUptCBRhobL19PS2U31vMNTfyck1FxPyMfgsXyW4Mav85y/ZN1hop3hOwRlUDok23oYfQ==} + psl@1.13.0: resolution: {integrity: sha512-BFwmFXiJoFqlUpZ5Qssolv15DMyc84gTBds1BjsV1BfXEo1UyyD7GsmN67n7J77uRhoSNW1AXtXKPLcBFQn9Aw==} @@ -1209,6 +1289,11 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + qrcode@1.5.4: + resolution: {integrity: sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==} + engines: {node: '>=10.13.0'} + hasBin: true + querystringify@2.2.0: resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} @@ -1226,6 +1311,13 @@ packages: resolution: {integrity: sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==} engines: {node: '>= 14.16.0'} + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + require-main-filename@2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} @@ -1272,6 +1364,9 @@ packages: sdp@2.12.0: resolution: {integrity: sha512-jhXqQAQVM+8Xj5EjJGVweuEzgtGWb3tmEEpl3CLP3cStInSbVHSg0QWOGQzNq8pSID4JkpeV2mPqlMDLrm0/Vw==} + set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + setimmediate@1.0.5: resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} @@ -1286,9 +1381,17 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + string_decoder@1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + strip-literal@2.1.0: resolution: {integrity: sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==} @@ -1522,6 +1625,13 @@ packages: resolution: {integrity: sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==} engines: {node: '>=12'} + which-module@2.0.1: + resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} + + wrap-ansi@6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} + ws@8.18.0: resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} engines: {node: '>=10.0.0'} @@ -1541,6 +1651,17 @@ packages: xmlchars@2.2.0: resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + y18n@4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + + yargs-parser@18.1.3: + resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} + engines: {node: '>=6'} + + yargs@15.4.1: + resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} + engines: {node: '>=8'} + snapshots: '@antfu/utils@0.7.10': {} @@ -1958,6 +2079,12 @@ snapshots: transitivePeerDependencies: - supports-color + ansi-regex@5.0.1: {} + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + anymatch@3.1.3: dependencies: normalize-path: 3.0.0 @@ -1985,6 +2112,8 @@ snapshots: buffer-from@1.1.2: {} + camelcase@5.3.1: {} + cherry-markdown@0.8.52: dependencies: '@types/codemirror': 0.0.108 @@ -2014,6 +2143,18 @@ snapshots: dependencies: readdirp: 4.0.2 + cliui@6.0.0: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.4: {} + combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 @@ -2269,6 +2410,8 @@ snapshots: dependencies: ms: 2.1.3 + decamelize@1.2.0: {} + decimal.js@10.4.3: {} delaunator@5.0.1: @@ -2282,6 +2425,12 @@ snapshots: dexie@4.0.8: {} + dijkstrajs@1.0.3: {} + + dingtalk-jsapi@3.0.42: + dependencies: + promise-polyfill: 7.1.2 + domexception@4.0.0: dependencies: webidl-conversions: 7.0.0 @@ -2313,6 +2462,8 @@ snapshots: elkjs@0.8.2: optional: true + emoji-regex@8.0.0: {} + entities@4.5.0: {} esbuild@0.21.5: @@ -2385,6 +2536,11 @@ snapshots: dependencies: to-regex-range: 5.0.1 + find-up@4.1.0: + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + form-data@4.0.1: dependencies: asynckit: 0.4.0 @@ -2394,6 +2550,8 @@ snapshots: fsevents@2.3.3: optional: true + get-caller-file@2.0.5: {} + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -2441,6 +2599,8 @@ snapshots: is-extglob@2.1.1: {} + is-fullwidth-code-point@3.0.0: {} + is-glob@4.0.3: dependencies: is-extglob: 2.1.1 @@ -2516,6 +2676,10 @@ snapshots: mlly: 1.7.2 pkg-types: 1.2.1 + locate-path@5.0.0: + dependencies: + p-locate: 4.1.0 + lodash-es@4.17.21: {} lodash-unified@1.0.3(@types/lodash-es@4.17.12)(lodash-es@4.17.21)(lodash@4.17.21): @@ -2597,10 +2761,22 @@ snapshots: nwsapi@2.2.13: {} + p-limit@2.3.0: + dependencies: + p-try: 2.2.0 + + p-locate@4.1.0: + dependencies: + p-limit: 2.3.0 + + p-try@2.2.0: {} + pako@1.0.11: {} parse5@6.0.1: {} + path-exists@4.0.0: {} + pathe@1.1.2: {} picocolors@1.1.1: {} @@ -2627,6 +2803,8 @@ snapshots: mlly: 1.7.2 pathe: 1.1.2 + pngjs@5.0.0: {} + postcss@8.4.47: dependencies: nanoid: 3.3.7 @@ -2635,12 +2813,20 @@ snapshots: process-nextick-args@2.0.1: {} + promise-polyfill@7.1.2: {} + psl@1.13.0: dependencies: punycode: 2.3.1 punycode@2.3.1: {} + qrcode@1.5.4: + dependencies: + dijkstrajs: 1.0.3 + pngjs: 5.0.0 + yargs: 15.4.1 + querystringify@2.2.0: {} queue-microtask@1.2.3: {} @@ -2661,6 +2847,10 @@ snapshots: readdirp@4.0.2: {} + require-directory@2.1.1: {} + + require-main-filename@2.0.0: {} + requires-port@1.0.0: {} reusify@1.0.4: {} @@ -2720,6 +2910,8 @@ snapshots: sdp@2.12.0: {} + set-blocking@2.0.0: {} + setimmediate@1.0.5: {} source-map-js@1.2.1: {} @@ -2731,10 +2923,20 @@ snapshots: source-map@0.6.1: {} + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + string_decoder@1.1.1: dependencies: safe-buffer: 5.1.2 + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + strip-literal@2.1.0: dependencies: js-tokens: 9.0.0 @@ -2957,8 +3159,37 @@ snapshots: tr46: 3.0.0 webidl-conversions: 7.0.0 + which-module@2.0.1: {} + + wrap-ansi@6.2.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + ws@8.18.0: {} xml-name-validator@4.0.0: {} xmlchars@2.2.0: {} + + y18n@4.0.3: {} + + yargs-parser@18.1.3: + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + + yargs@15.4.1: + dependencies: + cliui: 6.0.0 + decamelize: 1.2.0 + find-up: 4.1.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 4.2.3 + which-module: 2.0.1 + y18n: 4.0.3 + yargs-parser: 18.1.3 diff --git a/frontend/public/ref/clientid.js b/frontend/public/ref/clientid.js new file mode 100644 index 0000000..4213fe5 --- /dev/null +++ b/frontend/public/ref/clientid.js @@ -0,0 +1,101 @@ +function getOSInfo() { + const userAgent = navigator.userAgent; + if (/windows phone/i.test(userAgent)) { + return 'Windows Phone'; + } + if (/win/i.test(userAgent)) { + return 'Windows'; + } + if (/mac/i.test(userAgent)) { + return 'Mac'; + } + if (/x11/i.test(userAgent)) { + return 'UNIX'; + } + if (/android/i.test(userAgent)) { + return 'Android'; + } + if (/iphone|ipad|ipod/i.test(userAgent)) { + return 'iOS'; + } + return 'Unknown'; +} + +function bin2hex(s) { + s = encodeURI(s); // 只会有0-127的ascii不转化 + let m = s.match(/%[\dA-F]{2}/g), a = s.split(/%[\dA-F]{2}/), i, j, n, t; + m.push(""); + for (i in a) { + if (a[i] === "") { a[i] = m[i]; continue; } + n = ""; + for (j in a[i]) { + t = a[i][j].charCodeAt().toString(16).toUpperCase(); + if (t.length === 1) t = "0" + t; + n += "%" + t; + } + a[i] = n + m[i]; + } + return a.join("").split("%").join(""); +} + +function getBrowserFingerprint() { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); // 移除类型声明 + const txt = window.location.hostname; + ctx.textBaseline = 'top'; + ctx.font = '14px \'Arial\''; + ctx.textBaseline = 'alphabetic'; + ctx.fillStyle = '#f60'; + ctx.fillRect(125, 1, 62, 20); + ctx.fillStyle = '#069'; + ctx.fillText(txt, 2, 15); + ctx.fillStyle = 'rgba(102, 204, 0, 0.7)'; + ctx.fillText(txt, 4, 17); + + const b64 = canvas.toDataURL().replace("data:image/png;base64,", ""); + const bin = window.atob(b64); + const hash = bin2hex(bin.slice(-16, -12)); + + const fingerprint = [ + navigator.platform, + navigator.product, + navigator.productSub, + navigator.appName, + navigator.appVersion, + navigator.javaEnabled(), + navigator.userAgent, + screen.width, + screen.height, + new Date().getTimezoneOffset(), + hash, + screen.colorDepth, + navigator.language, + navigator.hardwareConcurrency, + getOSInfo(), + navigator.maxTouchPoints, + navigator.doNotTrack, + navigator.cookieEnabled + ].join('|'); + + return fingerprint; +} + +function djb2Hash(str) { + let hash = 5381; + for (let i = 0; i < str.length; i++) { + const char = str.charCodeAt(i); + hash = ((hash << 5) + hash) + char; /* hash * 33 + c */ + } + return hash.toString(36); // Convert to base 36 for shorter string +} + +function GetClientId() { + let uuid = localStorage.getItem("ClientID"); + if (!uuid) { + const fingerprint = getBrowserFingerprint(); + uuid = djb2Hash(fingerprint).slice(0, 36); + localStorage.setItem("ClientID", uuid); + } + + return uuid; +} \ No newline at end of file diff --git a/frontend/public/ref/config.js b/frontend/public/ref/config.js new file mode 100644 index 0000000..83e659b --- /dev/null +++ b/frontend/public/ref/config.js @@ -0,0 +1,167 @@ +const getSystemConfig = (ifset = false) => { + const configSetting = localStorage.getItem('GodoOS-config') || '{}'; + let config = JSON.parse(configSetting); + + config.version ??= '1.0.4'; + config.isFirstRun ??= false; + config.lang ??= ''; + config.apiUrl ??= `${window.location.protocol}//${window.location.hostname}:56780`; + config.userType ??= 'person'; + config.editorType ??= 'local'; + config.onlyoffice ??= { url: '', secret: '' }; + config.file ??= { isPwd: 0, pwd: '' }; + config.fileInputPwd ??= []; + config.userInfo ??= { + url: '', + username: '', + password: '', + id: 0, + nickname: '', + avatar: '', + email: '', + phone: '', + desc: '', + job_number: '', + work_place: '', + hired_date: '', + ding_id: '', + role_id: 0, + roleName: '', + dept_id: 0, + deptName: '', + token: '', + user_auths: '', + user_shares: '', + isPwd: false + }; + + config.isApp = window.go ? true : false; + config.systemInfo ??= {}; + config.theme ??= 'light'; + config.storeType ??= localStorage.getItem('GodoOS-storeType') || 'local'; + config.storePath ??= ''; + config.netPath ??= ''; + config.netPort ??= '56780'; + config.background ??= { + url: '/image/bg/bg6.jpg', + type: 'image', + color: 'rgba(30, 144, 255, 1)', + imageList: [ + '/image/bg/bg1.jpg', + '/image/bg/bg2.jpg', + '/image/bg/bg3.jpg', + '/image/bg/bg4.jpg', + '/image/bg/bg5.jpg', + '/image/bg/bg6.jpg', + '/image/bg/bg7.jpg', + '/image/bg/bg8.jpg', + '/image/bg/bg9.jpg', + ] + }; + + config.account ??= { ad: false, username: '', password: '' }; + if (config.userType === 'member') { + config.account.ad = false; + } + config.storenet ??= { url: '', username: '', password: '', isCors: '' }; + config.webdavClient ??= { url: '', username: '', password: '' }; + config.dbInfo ??= { url: '', username: '', password: '', dbname: '' }; + config.chatConf ??= { + checkTime: '15', + first: '192', + second: '168', + thirdStart: '1', + thirdEnd: '1', + fourthStart: '2', + fourthEnd: '254' + }; + + config.desktopList ??= []; + config.menuList ??= []; + config.token ??= generateRandomString(16); + config = parseAiConfig(config); + + if (ifset) { + setSystemConfig(config); + } + + return config; +}; + +const setSystemConfig = (config) => { + localStorage.setItem('GodoOS-config', JSON.stringify(config)); + localStorage.setItem('GodoOS-storeType', config.storeType); +}; + + +function generateRandomString(length) { + let result = ''; + const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + const charactersLength = characters.length; + for (let i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; +} + + +const parseAiConfig = (config) => { + if (!config.ollamaUrl) { + config.ollamaUrl = `${window.location.protocol}//${window.location.hostname}:11434` + } + if (!config.ollamaDir) { + config.ollamaDir = '' + } + if (!config.aiDir) { + config.aiDir = '' + } + if (!config.aiUrl) { + config.aiUrl = config.apiUrl + } + //openai + if (!config.openaiUrl) { + config.openaiUrl = 'https://api.openai.com/v1' + } + if (!config.openaiSecret) { + config.openaiSecret = "" + } + //gitee + if (!config.giteeSecret) { + config.giteeSecret = "" + } + //cloudflare + if (!config.cloudflareUserId) { + config.cloudflareUserId = "" + } + if (!config.cloudflareSecret) { + config.cloudflareSecret = "" + } + if (!config.deepseekSecret) { + config.deepseekSecret = "" + } + if (!config.bigmodelSecret) { + config.bigmodelSecret = "" + } + if (!config.volcesSecret) { + config.volcesSecret = "" + } + if (!config.alibabaSecret) { + config.alibabaSecret = "" + } + if (!config.groqSecret) { + config.groqSecret = "" + } + if (!config.mistralSecret) { + config.mistralSecret = "" + } + if (!config.anthropicSecret) { + config.anthropicSecret = "" + } + if (!config.llamafamilySecret) { + config.llamafamilySecret = "" + } + if (!config.siliconflowSecret) { + config.siliconflowSecret = "" + } + return config +}; \ No newline at end of file diff --git a/frontend/public/ref/ding.html b/frontend/public/ref/ding.html new file mode 100644 index 0000000..68290f6 --- /dev/null +++ b/frontend/public/ref/ding.html @@ -0,0 +1,111 @@ + + +
+ +