yakuza0 2.23.26 → 2.23.28-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.23.26",
3
+ "version": "2.23.28-beta.1",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -96,7 +96,7 @@
96
96
  "sass-loader": "^10",
97
97
  "semver": "^6.3.0",
98
98
  "socket.io-client": "^2.2.0",
99
- "string-replace-loader": "^3.1.0",
99
+ "string-replace-loader": "3.1.0",
100
100
  "stylelint": "^14.1.0",
101
101
  "stylelint-config-prettier": "^9.0.3",
102
102
  "stylelint-config-rational-order": "^0.1.2",
@@ -4,6 +4,19 @@ import {fetchDownload, blobInfo} from 'yakuza1/lib/blob';
4
4
  // import {mixin} from 'yakuza1/lib/encrypt';
5
5
  import {errMsg} from "yakuza0/config/msg";
6
6
 
7
+ function toUnicode(str) {
8
+ var result = '';
9
+ if (str) {
10
+ for (var i = 0; i < str.length; i++) {
11
+ var code = str.charCodeAt(i).toString(16);
12
+ while (code.length < 4) code = '0' + code;
13
+ result += '\\u' + code;
14
+ }
15
+ return result;
16
+ }
17
+ return result
18
+ }
19
+
7
20
  export default async (ctx, inject) => {
8
21
  const { $http, $yk, $utils } = ctx;
9
22
  const tfs = { url: {}, download: {}, info: {}, fake: {} };
@@ -211,7 +224,11 @@ export default async (ctx, inject) => {
211
224
  if (isNFS(fileUrl)) {
212
225
  res = await tfs.nfs(fileUrl);
213
226
  } else {
214
- res = await tfs.fastdfs(fileUrl);
227
+ res = await tfs.fastdfs(fileUrl, {
228
+ headers: {
229
+ 'X-Save-As-Unicode': toUnicode(filename),
230
+ }
231
+ });
215
232
  }
216
233
  if (res) {
217
234
  fetchDownload(res, filename);