yakuza0 2.23.27 → 2.23.28-beta.2

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.27",
3
+ "version": "2.23.28-beta.2",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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: {} };
@@ -77,6 +90,8 @@ export default async (ctx, inject) => {
77
90
  // 拓展平台对象存储
78
91
  tfs.fastdfs = async (fileUrl, opt) => {
79
92
  const serv = $yk.proxyServer && $yk.proxyServer.services && $yk.proxyServer.services['$'];
93
+ const __cFileName = opt.__cFileName || ""
94
+ opt = _.omit(opt, ['__cFileName'])
80
95
 
81
96
  if (!serv) {
82
97
  console.error(errMsg['proxyServer.baseKey.none']);
@@ -88,6 +103,7 @@ export default async (ctx, inject) => {
88
103
  ...opt,
89
104
  query: {
90
105
  fileUrl,
106
+ __cFileName,
91
107
  }
92
108
  })
93
109
  }
@@ -211,7 +227,7 @@ export default async (ctx, inject) => {
211
227
  if (isNFS(fileUrl)) {
212
228
  res = await tfs.nfs(fileUrl);
213
229
  } else {
214
- res = await tfs.fastdfs(fileUrl);
230
+ res = await tfs.fastdfs(fileUrl, {__cFileName: filename});
215
231
  }
216
232
  if (res) {
217
233
  fetchDownload(res, filename);