Explorar o código

安装并引入TextDecoder

htc hai 1 semana
pai
achega
cc305e94aa

+ 11 - 10
node_modules/.package-lock.json

@@ -1,12 +1,13 @@
 {
-	
-"name": "CH_Wechat",
-	
-"version": "1.0.1",
-	
-"lockfileVersion": 2,
-	
-"requires": true,
-	
-"packages": {}
+  "name": "ChuangHengWx",
+  "version": "1.0.1",
+  "lockfileVersion": 2,
+  "requires": true,
+  "packages": {
+    "node_modules/text-encoding-shim": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmmirror.com/text-encoding-shim/-/text-encoding-shim-1.0.5.tgz",
+      "integrity": "sha512-H7yYW+jRn4yhu60ygZ2f/eMhXPITRt4QSUTKzLm+eCaDsdX8avmgWpmtmHAzesjBVUTAypz9odu5RKUjX5HNYA=="
+    }
+  }
 }

+ 0 - 21
node_modules/event-source-polyfill/LICENSE

@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2012 vic99999@yandex.ru
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.

+ 0 - 21
node_modules/event-source-polyfill/LICENSE.md

@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2018 Viktor
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.

+ 0 - 277
node_modules/event-source-polyfill/README.md

@@ -1,277 +0,0 @@
-EventSource polyfill - https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events
-========================================================
-
-Пожалуйста не используйте эту обосранную библиотеку!
-
-Installing:
------------
-
-You can get the code from npm or bower:
-
-```
-npm install event-source-polyfill
-```
-
-```
-bower install event-source-polyfill
-```
-
-Just include `src/eventsource.js` or `src/eventsource.min.js` in your page to use the polyfill.
-
-
-Ionic2/Angular2 Installation:
------------------------------
-
-Unless a typescript definition file is created for this polyfill, this is how you would use it in an Ionic2 project.  It should (in theory) be very similar in an Angular2 project.
-
-```
-npm install event-source-polyfill
-```
-
-Add to (or create) src/app/polyfills.ts (path is relative to where polyfills.ts is) :
-```
-import 'path/to/event-source-polyfill/src/eventsource.min.js'
-```
-
-Add anywhere you need access to EventSourcePolyfill class : 
-
-```
-declare var EventSourcePolyfill: any;
-```
-
-Usage with webpack/browserify:
-------------------------------
-
-```javascript
-import { NativeEventSource, EventSourcePolyfill } from 'event-source-polyfill';
-
-const EventSource = NativeEventSource || EventSourcePolyfill;
-// OR: may also need to set as global property
-global.EventSource =  NativeEventSource || EventSourcePolyfill;
-```
-
-Browser support:
-----------------
-
-* IE 10+, Firefox 3.5+, Chrome 3+, Safari 4+, Opera 12+
-* IE 8 - IE 9: XDomainRequest is used internally, which has some limitations (2KB padding in the beginning is required, no way to send cookies, no way to use client certificates)
-* It works on Mobile Safari, Opera Mobile, Chrome for Android, Firefox for Android
-* It does not work on: Android Browser(requires 4 KB padding after every chunk), Opera Mini
-
-Advantages:
------------
-
-* Simple server-side code
-* Cross-domain requests support
-
-Server-side requirements:
--------------------------
-
-* "Last-Event-ID" is sent in a query string (CORS + "Last-Event-ID" header is not supported by all browsers)
-* It is required to send 2 KB padding for IE < 10 and Chrome < 13 at the top of the response stream (the polyfill sends `padding=true` query argument)
-* You need to send "comment" messages each 15-30 seconds, these messages will be used as heartbeat to detect disconnects - see https://bugzilla.mozilla.org/show_bug.cgi?id=444328
-
-Specification:
---------------
-
-* http://www.w3.org/TR/eventsource/
-
-Build:
-------
-
-* To build EventSource, just install npm modules (`npm install`) and then run the build (`npm run build`). It should generate a new version of `src/eventsource.min.js`.
-
-Notes:
------
- * If you are using HTTP Basic Authentication, you can embed credentials into the URL - `http://username:password@github.com`.
-
-Custom Headers:
----------------
-```
-var es = new EventSourcePolyfill('/events', {
-  headers: {
-    'X-Custom-Header': 'value'
-  }
-});
-```
-
-Custom query parameter name for the last event id:
----------------
- * Some server require a special query parameter name for last-event-id, you can change that via option
- * The default is `lastEventId`
- * Example for mercure-hub (https://mercure.rocks/)
-  
-```
-var es = new EventSourcePolyfill(hubUrl, {
-  lastEventIdQueryParameterName: 'Last-Event-Id'
-});
-```
-
-Other EventSource polyfills:
-----------------------------
-
-* https://github.com/remy/polyfills/blob/master/EventSource.js by Remy Sharp
-* https://github.com/rwldrn/jquery.eventsource by Rick Waldron
-* https://github.com/amvtek/EventSource by AmvTek
-
-EXAMPLE
--------
-
-
-
-server-side (node.js)
----------------------
-
-```javascript
-var PORT = 8081;
-
-var http = require("http");
-var fs = require("fs");
-var url = require("url");
-
-http.createServer(function (request, response) {
-  var parsedURL = url.parse(request.url, true);
-  var pathname = parsedURL.pathname;
-  if (pathname === "/events.php") {
-
-    response.writeHead(200, {
-      "Content-Type": "text/event-stream",
-      "Cache-Control": "no-store",
-      "Access-Control-Allow-Origin": "*"
-    });
-
-    var padding = new Array(2049);
-    response.write(":" + padding.join(" ") + "\n"); // 2kB padding for IE
-    response.write("retry: 2000\n");
-
-    var lastEventId = Number(request.headers["last-event-id"]) || Number(parsedURL.query.lastEventId) || 0;
-
-    var timeoutId = 0;
-    var i = lastEventId;
-    var c = i + 100;
-    var f = function () {
-      if (++i < c) {
-        response.write("id: " + i + "\n");
-        response.write("data: " + i + "\n\n");
-        timeoutId = setTimeout(f, 1000);
-      } else {
-        response.end();
-      }
-    };
-
-    f();
-
-    response.on("close", function () {
-      clearTimeout(timeoutId);
-    });
-
-  } else {
-    if (pathname === "/") {
-      pathname = "/index.html";
-    }
-    if (pathname === "/index.html" || pathname === "../src/eventsource.js") {
-      response.writeHead(200, {
-        "Content-Type": pathname === "/index.html" ? "text/html" : "text/javascript"
-      });
-      response.write(fs.readFileSync(__dirname + pathname));
-    }
-    response.end();
-  }
-}).listen(PORT);
-```
-
-or use PHP (see php/events.php)
--------------------------------
-```php
-<?php
-
-  header("Content-Type: text/event-stream");
-  header("Cache-Control: no-store");
-  header("Access-Control-Allow-Origin: *");
-
-  $lastEventId = floatval(isset($_SERVER["HTTP_LAST_EVENT_ID"]) ? $_SERVER["HTTP_LAST_EVENT_ID"] : 0);
-  if ($lastEventId == 0) {
-    $lastEventId = floatval(isset($_GET["lastEventId"]) ? $_GET["lastEventId"] : 0);
-  }
-
-  echo ":" . str_repeat(" ", 2048) . "\n"; // 2 kB padding for IE
-  echo "retry: 2000\n";
-
-  // event-stream
-  $i = $lastEventId;
-  $c = $i + 100;
-  while (++$i < $c) {
-    echo "id: " . $i . "\n";
-    echo "data: " . $i . ";\n\n";
-    ob_flush();
-    flush();
-    sleep(1);
-  }
-
-?>
-```
-
-index.html (php/index.html):
-----------------------------
-```html
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8" />
-    <title>EventSource example</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <script src="../src/eventsource.js"></script>
-    <script>
-      var es = new EventSource("events.php");
-      var listener = function (event) {
-        var div = document.createElement("div");
-        var type = event.type;
-        div.appendChild(document.createTextNode(type + ": " + (type === "message" ? event.data : es.url)));
-        document.body.appendChild(div);
-      };
-      es.addEventListener("open", listener);
-      es.addEventListener("message", listener);
-      es.addEventListener("error", listener);
-    </script>
-</head>
-<body>
-</body>
-</html>
-```
-
-Usage in node.js:
-=================
-With some dynamic imports it may work in node.js:
-
-Install the library and the dependency:
-`npm install @titelmedia/node-fetch`
-`npm install event-source-polyfill`
-
-x.js:
-```javascript
-// The @titelmedia/node-fetch is used instead of node-fetch as it supports ReadableStream Web API
-import('@titelmedia/node-fetch').then(function (fetch) {
-  globalThis.fetch = fetch.default;
-  globalThis.Response = fetch.default.Response;
-  import('event-source-polyfill').then(function (x) {
-    var es = new x.default.EventSourcePolyfill('http://localhost:8004/events');
-    es.onerror = es.onopen = es.onmessage = function (event) {
-      console.log(event.type + ': ' + event.data);
-    };
-  });
-});
-```
-
-`node --experimental-modules ./x.js`
-
-License
--------
-The MIT License (MIT)
-
-Copyright (c) 2012 vic99999@yandex.ru
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0 - 34
node_modules/event-source-polyfill/package.json

@@ -1,34 +0,0 @@
-{
-  "name": "event-source-polyfill",
-  "version": "1.0.31",
-  "description": "A polyfill for http://www.w3.org/TR/eventsource/ ",
-  "main": "src/eventsource.js",
-  "scripts": {
-    "build": "grunt"
-  },
-  "repository": {
-    "type": "git",
-    "url": "git://github.com/Yaffle/EventSource.git"
-  },
-  "keywords": [
-    "sse",
-    "server sent events",
-    "eventsource",
-    "event-source",
-    "polyfill"
-  ],
-  "files": [
-    "src/*"
-  ],
-  "author": "Yaffle (https://github.com/Yaffle)",
-  "license": "MIT",
-  "bugs": {
-    "url": "https://github.com/Yaffle/EventSource/issues"
-  },
-  "homepage": "https://github.com/Yaffle/EventSource",
-  "devDependencies": {
-    "grunt": "^1.4.1",
-    "grunt-cli": "^1.4.3",
-    "grunt-contrib-uglify": "^5.0.1"
-  }
-}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 1048
node_modules/event-source-polyfill/src/eventsource.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 6
node_modules/event-source-polyfill/src/eventsource.min.js


+ 13 - 0
node_modules/text-encoding-shim/LICENSE

@@ -0,0 +1,13 @@
+The MIT License (MIT)
+Copyright (c) 2016 Till Affeldt
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+documentation files (the "Software"),to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 64 - 0
node_modules/text-encoding-shim/README.md

@@ -0,0 +1,64 @@
+# Text Encoding Shim
+When I was looking for a simple lightweight polyfill that works great with TypeScript I was not happy with the results.
+While a couple polyfills exist, they either broke in my special setup and lead to unexpected results or they implemented a bunch
+of features that I did not even want to have. So I wrote my own shim.
+
+## Installation
+### npm
+Get it via *npm* by adding `text-encoding-shim` to your `package.json` or run:
+```shell
+npm install text-encoding-shim
+```
+
+### Bower
+Get it via *Bower* by adding it to your `bower.json` or run:
+```shell
+bower install --save text-encoding-shim
+```
+
+### HTML script tag
+Altenatively you can simply download this project folder from [Gitlab](https://gitlab.com/PseudoPsycho/text-encoding-shim)
+and add it to your html script tags like so:
+```shell
+<script type="text/javascript" src="text-encoding-shim/index.js"></script>
+```
+
+### TypeScript definitions
+If you are using TypeScript you do not need to create a definition file. This project already includes one.
+If you are still using *typings* you may need to run this command to copy the file:
+```shell
+typings install --save --global npm:text-encoding-shim
+```
+
+## Importing the polyfill
+This polyfill utilizes the Universal Module Definition (UMD) and be used with either a module loader or standalone.
+If you import it by adding a script tag you do not have to do anything else. It will automatically be bound to the global scope.
+### CommonJS
+```js
+var TextEncodingShim = require('text-encoding-shim');
+var TextEncoder = TextEncodingShim.TextEncoder;
+var TextDecoder = TextEncodingShim.TextDecoder;
+```
+
+### Asynchronous Module Definition (AMD)
+```js
+define([TextEncodingShim], function() {
+	//...
+});
+```
+
+### ES2015 or TypeScript
+```js
+import { TextEncoder, TextDecoder } from 'text-encoding-shim';
+```
+
+## Basic Usage
+```js
+var uint8array = new TextEncoder('utf-8').encode(string);
+var string = new TextDecoder('utf-8').decode(uint8array);
+```
+
+## Limitations
+If a native implementation is available it will always be handled preferred to this polyfill.
+Just like native implementations of Mozilla Firefox or Google Chrome, this library only supports UTF-8 encoding.
+This makes it so fast. If you need additional encodings, check out [this more advanced polyfill](https://github.com/inexorabletash/text-encoding).

+ 27 - 0
node_modules/text-encoding-shim/bower.json

@@ -0,0 +1,27 @@
+{
+	"name": "text-encoding-shim",
+	"version": "1.0.0",
+	"main": "index.js",
+	"authors": ["Till Affeldt <till.affeldt@gmail.com>"],
+	"description": "Simple lightweight polyfill for the Text Encoding API, supporting UTF-8 only",
+	"license": "MIT",
+	"moduleType": [
+		"globals",
+		"amd",
+		"node"
+	],
+	"keywords": [
+		"encoding",
+		"decoding",
+		"w3c",
+		"utf-8"
+	],
+	"ignore": [
+		"*.log"
+	],
+	"repository": {
+		"type": "git",
+		"url": "https://gitlab.com/PseudoPsycho/text-encoding-shim"
+	},
+	"homepage": "https://gitlab.com/PseudoPsycho/text-encoding-shim"
+}

+ 37 - 0
node_modules/text-encoding-shim/index.d.ts

@@ -0,0 +1,37 @@
+declare namespace TextEncodingShim {
+	interface TextEncoder_Static {
+		new(encoding?: string): TextEncoder_Instance;
+	}
+
+	interface TextEncoder_Instance {
+		encoding: string;
+		encode(input?: string): Uint8Array;
+	}
+
+	interface TextDecoderConstructorOptions {
+		fatal?: boolean;
+	}
+
+	interface TextDecoderDecodeOptions {
+		stream?: boolean;
+	}
+
+	interface TextDecoder_Static {
+		new(encoding?: string, options?: TextDecoderConstructorOptions): TextDecoder_Instance;
+	}
+
+	interface TextDecoder_Instance {
+		 encoding:  string;
+		 fatal:     boolean;
+		 ignoreBOM: boolean;
+		 decode(input?: ArrayBufferView, options?: TextDecoderDecodeOptions): string;
+ 	}
+
+	var TextEncoder: TextEncoder_Static;
+	var TextDecoder: TextDecoder_Static;
+
+}
+
+declare module 'text-encoding-shim' {
+	export = TextEncodingShim;
+}

+ 78 - 0
node_modules/text-encoding-shim/index.js

@@ -0,0 +1,78 @@
+(function (root, factory) {
+    if (typeof define === "function" && define.amd) {
+        define([], factory);
+    } else if (typeof exports === "object") {
+        module.exports = factory();
+    } else {
+		var textEncoding = factory();
+        root.TextEncoder = textEncoding.TextEncoder;
+		root.TextDecoder = textEncoding.TextDecoder;
+    }
+}(this, function () {
+	"use strict";
+	// return native implementation if available
+	var g = typeof global !== 'undefined' ? global : self;
+	if (typeof g.TextEncoder !== 'undefined' && typeof g.TextDecoder !== 'undefined') {
+		return {'TextEncoder': g.TextEncoder, 'TextDecoder': g.TextDecoder};
+	}
+
+	// allowed encoding strings for utf-8
+	var utf8Encodings = [
+		'utf8',
+		'utf-8',
+		'unicode-1-1-utf-8'
+	];
+
+	var TextEncoder = function(encoding) {
+		if (utf8Encodings.indexOf(encoding) < 0 && typeof encoding !== 'undefined' && encoding !== null) {
+			throw new RangeError('Invalid encoding type. Only utf-8 is supported');
+		} else {
+			this.encoding = 'utf-8';
+			this.encode = function(str) {
+				if (typeof str !== 'string') {
+					throw new TypeError('passed argument must be of type string');
+				}
+				var binstr = unescape(encodeURIComponent(str)),
+					arr = new Uint8Array(binstr.length);
+				binstr.split('').forEach(function(char, i) {
+					arr[i] = char.charCodeAt(0);
+				});
+				return arr;
+			};
+		}
+	};
+
+	var TextDecoder = function(encoding, options) {
+		if (utf8Encodings.indexOf(encoding) < 0 && typeof encoding !== 'undefined' && encoding !== null) {
+			throw new RangeError('Invalid encoding type. Only utf-8 is supported');
+		}
+		this.encoding = 'utf-8';
+		this.ignoreBOM = false;
+		this.fatal = (typeof options !== 'undefined' && 'fatal' in options) ? options.fatal : false;
+		if (typeof this.fatal !== 'boolean') {
+			throw new TypeError('fatal flag must be boolean');
+		}
+		this.decode = function (view, options) {
+			if (typeof view === 'undefined') {
+				return '';
+			}
+
+			var stream = (typeof options !== 'undefined' && 'stream' in options) ? options.stream : false;
+			if (typeof stream !== 'boolean') {
+				throw new TypeError('stream option must be boolean');
+			}
+
+			if (!ArrayBuffer.isView(view)) {
+				throw new TypeError('passed argument must be an array buffer view');
+			} else {
+				var arr = new Uint8Array(view.buffer, view.byteOffset, view.byteLength),
+					charArr = new Array(arr.length);
+				arr.forEach(function(charcode, i) {
+					charArr[i] = String.fromCharCode(charcode);
+				});
+				return decodeURIComponent(escape(charArr.join('')));
+			}
+		};
+	};
+	return {'TextEncoder': TextEncoder, 'TextDecoder': TextDecoder};
+}));

+ 32 - 0
node_modules/text-encoding-shim/package.json

@@ -0,0 +1,32 @@
+{
+	"name": "text-encoding-shim",
+	"version": "1.0.5",
+	"main": "index.js",
+	"author": "Till Affeldt <affeldt@protonmail.com>",
+	"description": "Simple lightweight polyfill for the Text Encoding API, supporting UTF-8 only",
+	"license": "MIT",
+	"keywords": [
+		"encoding",
+		"decoding",
+		"w3c",
+		"utf-8"
+	],
+	"files": [
+		"bower.json",
+		"index.d.ts",
+		"index.js",
+		"LICENSE",
+		"package.json",
+		"README.md",
+		"typings.json"
+	],
+	"typings": "index.d.ts",
+	"repository": {
+		"type": "git",
+		"url": "https://gitlab.com/PseudoPsycho/text-encoding-shim"
+	},
+	"bugs": {
+		"url": "https://gitlab.com/PseudoPsycho/text-encoding-shim/issues"
+	},
+	"homepage": "https://gitlab.com/PseudoPsycho/text-encoding-shim"
+}

+ 4 - 0
node_modules/text-encoding-shim/typings.json

@@ -0,0 +1,4 @@
+{
+	"name": "text-encoding-shim",
+	"version": "1.0.5"
+}

+ 23 - 10
package-lock.json

@@ -1,12 +1,25 @@
 {
-	
-"name": "CH_Wechat",
-	
-"version": "1.0.1",
-	
-"lockfileVersion": 2,
-	
-"requires": true,
-	
-"packages": {}
+  "name": "ChuangHengWx",
+  "version": "1.0.1",
+  "lockfileVersion": 2,
+  "requires": true,
+  "packages": {
+    "": {
+      "dependencies": {
+        "text-encoding-shim": "^1.0.5"
+      }
+    },
+    "node_modules/text-encoding-shim": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmmirror.com/text-encoding-shim/-/text-encoding-shim-1.0.5.tgz",
+      "integrity": "sha512-H7yYW+jRn4yhu60ygZ2f/eMhXPITRt4QSUTKzLm+eCaDsdX8avmgWpmtmHAzesjBVUTAypz9odu5RKUjX5HNYA=="
+    }
+  },
+  "dependencies": {
+    "text-encoding-shim": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmmirror.com/text-encoding-shim/-/text-encoding-shim-1.0.5.tgz",
+      "integrity": "sha512-H7yYW+jRn4yhu60ygZ2f/eMhXPITRt4QSUTKzLm+eCaDsdX8avmgWpmtmHAzesjBVUTAypz9odu5RKUjX5HNYA=="
+    }
+  }
 }

+ 5 - 1
package.json

@@ -1 +1,5 @@
-{}
+{
+  "dependencies": {
+    "text-encoding-shim": "^1.0.5"
+  }
+}

+ 7 - 1
pages/dialog.vue

@@ -76,6 +76,7 @@
 	let requestTask = null;
 	import { BaseApi } from '../http/baseApi.js'
 	import Tabbar from '@/components/CusTabbar/index.vue'
+	import * as TextEncoding from "text-encoding-shim";
 	export default {
 		components:{ Tabbar },
 		data(){
@@ -164,12 +165,17 @@
 						},
 						fail: (err) => {
 							this._handleError(err.errMsg, resolve, reject);
+						},
+						complete: (com) => {
+							console.log('请求完成',com)
 						}
 					});
 					
 					requestTask.onChunkReceived(async (res) => {
+							console.log('res',res)
 						const uint8Array = new Uint8Array(res.data);
-						const decoder = new TextDecoder("utf-8");
+						// const decoder = new TextDecoder("utf-8");
+						const decoder = new TextEncoding.TextDecoder("utf-8");
 						const decodedString = decoder.decode(uint8Array);
 						let newtext = decodedString.replaceAll('data:','')
 						newtext = newtext.replace(/\s+/g,'');