Skip to content

Commit

Permalink
🐛 Fix(custom): fix chinease char encode error
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuingsmile committed Dec 28, 2023
1 parent e99f789 commit 1fbd7a7
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 73 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"multer": "^1.4.5-lts.1",
"node-ssh-no-cpu-features": "^1.0.1",
"nodejs-file-downloader": "^4.12.1",
"piclist": "^1.6.9",
"piclist": "^1.7.0",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.0",
"proxy-agent": "^5.0.0",
Expand Down
8 changes: 8 additions & 0 deletions src/main/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ const multerStorage = multer.diskStorage({
cb(null, serverTempDir)
},
filename: function (_req: any, file: { originalname: any }, cb: (arg0: null, arg1: any) => void) {
console.log(file.originalname)
// eslint-disable-next-line no-control-regex
if (!/[^\u0000-\u00ff]/.test(file.originalname)) {
file.originalname = Buffer.from(file.originalname, 'latin1').toString(
'utf8'
)
}
console.log(file.originalname)
cb(null, file.originalname)
}
})
Expand Down
144 changes: 72 additions & 72 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4158,47 +4158,47 @@
semver "^7.3.4"
strip-ansi "^6.0.0"

"@vue/[email protected].12":
version "3.3.12"
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.3.12.tgz#3346c0f55ce0d59e17c21d9eef9154b70c19931b"
integrity sha512-qAtjyG3GBLG0chzp5xGCyRLLe6wFCHmjI82aGzwuGKyznNP+GJJMxjc0wOYWDB2YKfho7niJFdoFpo0CZZQg9w==
"@vue/[email protected].13":
version "3.3.13"
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.3.13.tgz#b3d5f8f84caee5de3f31d95cb568d899fd19c599"
integrity sha512-bwi9HShGu7uaZLOErZgsH2+ojsEdsjerbf2cMXPwmvcgZfVPZ2BVZzCVnwZBxTAYd6Mzbmf6izcUNDkWnBBQ6A==
dependencies:
"@babel/parser" "^7.23.5"
"@vue/shared" "3.3.12"
"@vue/shared" "3.3.13"
estree-walker "^2.0.2"
source-map-js "^1.0.2"

"@vue/[email protected].12":
version "3.3.12"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.3.12.tgz#267c54b388d58f30fc120ea496ebf27d4ea8368b"
integrity sha512-RdJU9oEYaoPKUdGXCy0l+i4clesdDeLmbvRlszoc9iagsnBnMmQtYfCPVQ5BHB6o7K4SCucDdJM2Dh3oXB0D6g==
"@vue/[email protected].13":
version "3.3.13"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.3.13.tgz#d029e222e545e7ab00be35aafd3abed167f962bf"
integrity sha512-EYRDpbLadGtNL0Gph+HoKiYqXLqZ0xSSpR5Dvnu/Ep7ggaCbjRDIus1MMxTS2Qm0koXED4xSlvTZaTnI8cYAsw==
dependencies:
"@vue/compiler-core" "3.3.12"
"@vue/shared" "3.3.12"
"@vue/compiler-core" "3.3.13"
"@vue/shared" "3.3.13"

"@vue/[email protected].12":
version "3.3.12"
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.3.12.tgz#6ec2c19858f264671457699c1f3a0a6fedf429fe"
integrity sha512-yy5b9e7b79dsGbMmglCe/YnhCQgBkHO7Uf6JfjWPSf2/5XH+MKn18LhzhHyxbHdJgnA4lZCqtXzLaJz8Pd8lMw==
"@vue/[email protected].13":
version "3.3.13"
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.3.13.tgz#7b397acefd5c0c3808701d2855be88c4be60155c"
integrity sha512-DQVmHEy/EKIgggvnGRLx21hSqnr1smUS9Aq8tfxiiot8UR0/pXKHN9k78/qQ7etyQTFj5em5nruODON7dBeumw==
dependencies:
"@babel/parser" "^7.23.5"
"@vue/compiler-core" "3.3.12"
"@vue/compiler-dom" "3.3.12"
"@vue/compiler-ssr" "3.3.12"
"@vue/reactivity-transform" "3.3.12"
"@vue/shared" "3.3.12"
"@vue/compiler-core" "3.3.13"
"@vue/compiler-dom" "3.3.13"
"@vue/compiler-ssr" "3.3.13"
"@vue/reactivity-transform" "3.3.13"
"@vue/shared" "3.3.13"
estree-walker "^2.0.2"
magic-string "^0.30.5"
postcss "^8.4.32"
source-map-js "^1.0.2"

"@vue/[email protected].12":
version "3.3.12"
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.3.12.tgz#e62499c6003ccd09acb7190167d08845e3a0eaa5"
integrity sha512-adCiMJPznfWcQyk/9HSuXGja859IaMV+b8UNSVzDatqv7h0PvT9BEeS22+gjkWofDiSg5d78/ZLls3sLA+cn3A==
"@vue/[email protected].13":
version "3.3.13"
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.3.13.tgz#ad8748abff8d738ac9c6a3c47be42020f0fbaa63"
integrity sha512-d/P3bCeUGmkJNS1QUZSAvoCIW4fkOKK3l2deE7zrp0ypJEy+En2AcypIkqvcFQOcw3F0zt2VfMvNsA9JmExTaw==
dependencies:
"@vue/compiler-dom" "3.3.12"
"@vue/shared" "3.3.12"
"@vue/compiler-dom" "3.3.13"
"@vue/shared" "3.3.13"

"@vue/component-compiler-utils@^3.1.0", "@vue/component-compiler-utils@^3.3.0":
version "3.3.0"
Expand Down Expand Up @@ -4242,53 +4242,53 @@
"@typescript-eslint/parser" "^6.7.0"
vue-eslint-parser "^9.3.1"

"@vue/[email protected].12":
version "3.3.12"
resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.3.12.tgz#4cb871b597eb8b321577b4d7f1e93eaebca16128"
integrity sha512-g5TijmML7FyKkLt6QnpqNmA4KD7K/T5SbXa88Bhq+hydNQEkzA8veVXWAQuNqg9rjaFYD0rPf0a9NofKA0ENgg==
"@vue/[email protected].13":
version "3.3.13"
resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.3.13.tgz#dc8e9be961865dc666e367e1aaaea0716afa5c90"
integrity sha512-oWnydGH0bBauhXvh5KXUy61xr9gKaMbtsMHk40IK9M4gMuKPJ342tKFarY0eQ6jef8906m35q37wwA8DMZOm5Q==
dependencies:
"@babel/parser" "^7.23.5"
"@vue/compiler-core" "3.3.12"
"@vue/shared" "3.3.12"
"@vue/compiler-core" "3.3.13"
"@vue/shared" "3.3.13"
estree-walker "^2.0.2"
magic-string "^0.30.5"

"@vue/[email protected].12":
version "3.3.12"
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.3.12.tgz#b4a62a7678ab20c1ef32f991342ddbb8532417da"
integrity sha512-vOJORzO8DlIx88cgTnMLIf2GlLYpoXAKsuoQsK6SGdaqODjxO129pVPTd2s/N/Mb6KKZEFIHIEwWGmtN4YPs+g==
"@vue/[email protected].13":
version "3.3.13"
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.3.13.tgz#9b1dff3b523a69997b66cba2f86f83839e8285fb"
integrity sha512-fjzCxceMahHhi4AxUBzQqqVhuA21RJ0COaWTbIBl1PruGW1CeY97louZzLi4smpYx+CHfFPPU/CS8NybbGvPKQ==
dependencies:
"@vue/shared" "3.3.12"
"@vue/shared" "3.3.13"

"@vue/[email protected].12":
version "3.3.12"
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.3.12.tgz#67ee6cfc2e85d656946975239ea635ec42dde5f6"
integrity sha512-5iL4w7MZrSGKEZU2wFAYhDZdZmgn+s//73EfgDXW1M+ZUOl36md7tlWp1QFK/ladiq4FvQ82shVjo0KiPDPr0A==
"@vue/[email protected].13":
version "3.3.13"
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.3.13.tgz#e8414218e8c7db94acfcec6fd12044704adda9cf"
integrity sha512-1TzA5TvGuh2zUwMJgdfvrBABWZ7y8kBwBhm7BXk8rvdx2SsgcGfz2ruv2GzuGZNvL1aKnK8CQMV/jFOrxNQUMA==
dependencies:
"@vue/reactivity" "3.3.12"
"@vue/shared" "3.3.12"
"@vue/reactivity" "3.3.13"
"@vue/shared" "3.3.13"

"@vue/[email protected].12", "@vue/runtime-dom@^3.3.12":
version "3.3.12"
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.3.12.tgz#28a239496e589037774cba7c1b27057242eedb11"
integrity sha512-8mMzqiIdl+IYa/OXwKwk6/4ebLq7cYV1pUcwCSwBK2KerUa6cwGosen5xrCL9f8o2DJ9TfPFwbPEvH7OXzUpoA==
"@vue/[email protected].13", "@vue/runtime-dom@^3.3.13":
version "3.3.13"
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.3.13.tgz#36b42b479d5a394972f305ca8e95c5f648bf55ef"
integrity sha512-JJkpE8R/hJKXqVTgUoODwS5wqKtOsmJPEqmp90PDVGygtJ4C0PtOkcEYXwhiVEmef6xeXcIlrT3Yo5aQ4qkHhQ==
dependencies:
"@vue/runtime-core" "3.3.12"
"@vue/shared" "3.3.12"
"@vue/runtime-core" "3.3.13"
"@vue/shared" "3.3.13"
csstype "^3.1.3"

"@vue/[email protected].12":
version "3.3.12"
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.3.12.tgz#f0246aba5d5d6fdfa840ac9e4f32d76f03b20665"
integrity sha512-OZ0IEK5TU5GXb5J8/wSplyxvGGdIcwEmS8EIO302Vz8K6fGSgSJTU54X0Sb6PaefzZdiN3vHsLXO8XIeF8crQQ==
"@vue/[email protected].13":
version "3.3.13"
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.3.13.tgz#fccdd0787798173be8929f40f23161c17b60ed36"
integrity sha512-vSnN+nuf6iSqTL3Qgx/9A+BT+0Zf/VJOgF5uMZrKjYPs38GMYyAU1coDyBNHauehXDaP+zl73VhwWv0vBRBHcg==
dependencies:
"@vue/compiler-ssr" "3.3.12"
"@vue/shared" "3.3.12"
"@vue/compiler-ssr" "3.3.13"
"@vue/shared" "3.3.13"

"@vue/[email protected].12":
version "3.3.12"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.3.12.tgz#7c030c4e2f1db8beb638b159cbb86d0ff78c3198"
integrity sha512-6p0Yin0pclvnER7BLNOQuod9Z+cxSYh8pSh7CzHnWNjAIP6zrTlCdHRvSCb1aYEx6i3Q3kvfuWU7nG16CgG1ag==
"@vue/[email protected].13":
version "3.3.13"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.3.13.tgz#4cb73cda958d77ffd389c8640cf7d93a10ac676f"
integrity sha512-/zYUwiHD8j7gKx2argXEMCUXVST6q/21DFU0sTfNX0URJroCe3b1UF6vLJ3lQDfLNIiiRl2ONp7Nh5UVWS6QnA==

"@vue/vue-loader-v15@npm:vue-loader@^15.9.7":
version "15.10.1"
Expand Down Expand Up @@ -12362,10 +12362,10 @@ performance-now@^2.1.0:
resolved "https://registry.npmmirror.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==

piclist@^1.6.8:
version "1.6.8"
resolved "https://registry.yarnpkg.com/piclist/-/piclist-1.6.8.tgz#523ac3510103f24cf39448f0ed82b7077d77acad"
integrity sha512-+LYhutXrqmRfVsr21h67b8sZNI4tF6+H6OAqOuhFhGQv/0ppIvvF0E9yH4CNvER/Cl82QfYsO/47b5COvpqWUQ==
piclist@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/piclist/-/piclist-1.7.0.tgz#a348859d1754510e41013afce5896f14ffa7d229"
integrity sha512-X+pGgJ63k4hq6iOuU8t0R+AW/N4zrCk3nC6pdsAjK3yykwDfG3AOg0Yb1Dcx2o9AiFNQd+9LllFakDwQAfMfkA==
dependencies:
"@picgo/i18n" "^1.0.0"
"@picgo/store" "^2.1.0"
Expand Down Expand Up @@ -15707,16 +15707,16 @@ vue3-photo-preview@^0.3.0:
dependencies:
lodash-es "^4.17.21"

vue@^3.3.12:
version "3.3.12"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.3.12.tgz#4a3a39e79d22e9826ae7c058863316333c838b63"
integrity sha512-jYNv2QmET2OTHsFzfWHMnqgCfqL4zfo97QwofdET+GBRCHhSCHuMTTvNIgeSn0/xF3JRT5OGah6MDwUFN7MPlg==
vue@^3.3.13:
version "3.3.13"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.3.13.tgz#f03098fa1b4e7cc88c133bef92260b55e3767002"
integrity sha512-LDnUpQvDgsfc0u/YgtAgTMXJlJQqjkxW1PVcOnJA5cshPleULDjHi7U45pl2VJYazSSvLH8UKcid/kzH8I0a0Q==
dependencies:
"@vue/compiler-dom" "3.3.12"
"@vue/compiler-sfc" "3.3.12"
"@vue/runtime-dom" "3.3.12"
"@vue/server-renderer" "3.3.12"
"@vue/shared" "3.3.12"
"@vue/compiler-dom" "3.3.13"
"@vue/compiler-sfc" "3.3.13"
"@vue/runtime-dom" "3.3.13"
"@vue/server-renderer" "3.3.13"
"@vue/shared" "3.3.13"

watchpack@^2.4.0:
version "2.4.0"
Expand Down

0 comments on commit 1fbd7a7

Please sign in to comment.