123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849 |
- (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["pagesHome/common/vendor"],{
- /***/ 100:
- /*!********************************************************************************!*\
- !*** D:/project/新医院随访2023/follow_applet/node_modules/websocket/lib/version.js ***!
- \********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(/*! ../package.json */ 101).version;
- /***/ }),
- /***/ 101:
- /*!******************************************************************************!*\
- !*** D:/project/新医院随访2023/follow_applet/node_modules/websocket/package.json ***!
- \******************************************************************************/
- /*! exports provided: name, description, keywords, author, contributors, version, repository, homepage, engines, dependencies, devDependencies, config, scripts, main, directories, browser, license, default */
- /***/ (function(module) {
- module.exports = JSON.parse("{\"name\":\"websocket\",\"description\":\"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.\",\"keywords\":[\"websocket\",\"websockets\",\"socket\",\"networking\",\"comet\",\"push\",\"RFC-6455\",\"realtime\",\"server\",\"client\"],\"author\":\"Brian McKelvey <theturtle32@gmail.com> (https://github.com/theturtle32)\",\"contributors\":[\"Iñaki Baz Castillo <ibc@aliax.net> (http://dev.sipdoc.net)\"],\"version\":\"1.0.34\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/theturtle32/WebSocket-Node.git\"},\"homepage\":\"https://github.com/theturtle32/WebSocket-Node\",\"engines\":{\"node\":\">=4.0.0\"},\"dependencies\":{\"bufferutil\":\"^4.0.1\",\"debug\":\"^2.2.0\",\"es5-ext\":\"^0.10.50\",\"typedarray-to-buffer\":\"^3.1.5\",\"utf-8-validate\":\"^5.0.2\",\"yaeti\":\"^0.0.6\"},\"devDependencies\":{\"buffer-equal\":\"^1.0.0\",\"gulp\":\"^4.0.2\",\"gulp-jshint\":\"^2.0.4\",\"jshint-stylish\":\"^2.2.1\",\"jshint\":\"^2.0.0\",\"tape\":\"^4.9.1\"},\"config\":{\"verbose\":false},\"scripts\":{\"test\":\"tape test/unit/*.js\",\"gulp\":\"gulp\"},\"main\":\"index\",\"directories\":{\"lib\":\"./lib\"},\"browser\":\"lib/browser.js\",\"license\":\"Apache-2.0\"}");
- /***/ }),
- /***/ 93:
- /*!**************************************************************!*\
- !*** D:/project/新医院随访2023/follow_applet/common/websocket.js ***!
- \**************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(uni) {
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = void 0;
- var _stompjs = _interopRequireDefault(__webpack_require__(/*! stompjs */ 94));
- var socketOpen = false;
- var socketMsgQueue = [];
- var _default = {
- client: null,
- init: function init(url, header, connectWS) {
- var _this = this;
- if (this.client) {
- return Promise.resolve(this.client);
- }
- return new Promise(function (resolve, reject) {
- var ws = {
- send: _this.sendMessage,
- onopen: null,
- onmessage: null
- };
- uni.connectSocket({
- url: url,
- header: header
- });
- uni.onSocketOpen(function (res) {
- console.log('WebSocket连接已打开!', res);
- socketOpen = true;
- for (var i = 0; i < socketMsgQueue.length; i++) {
- ws.send(socketMsgQueue[i]);
- }
- socketMsgQueue = [];
- ws.onopen && ws.onopen();
- });
- uni.onSocketMessage(function (res) {
- // ios 缺少 0x00 导致解析失败
- if (res && res.data) {
- var value = res.data;
- var code = value.charCodeAt(value.length - 1);
- if (code !== 0x00) {
- value += String.fromCharCode(0x00);
- res.data = value;
- }
- }
- ws.onmessage && ws.onmessage(res);
- });
- uni.onSocketError(function (res) {
- console.log('WebSocket 错误!', res);
- });
- uni.onSocketClose(function (res) {
- _this.client = null;
- socketOpen = false;
- console.log('WebSocket 已关闭!', res);
- if (res.code !== 1000) {
- setTimeout(function () {
- connectWS();
- }, 3000);
- }
- });
- _stompjs.default.setInterval = function (interval, f) {
- return setInterval(f, interval);
- };
- _stompjs.default.clearInterval = function (id) {
- return clearInterval(id);
- };
- var client = _this.client = _stompjs.default.over(ws);
- // 关闭连接
- client.close = function () {
- uni.closeSocket();
- };
- client.connect(header, function () {
- console.log('stomp connected');
- resolve(client);
- });
- });
- },
- sendMessage: function sendMessage(message) {
- if (socketOpen) {
- uni.sendSocketMessage({
- data: message
- });
- } else {
- socketMsgQueue.push(message);
- }
- }
- };
- exports.default = _default;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
- /***/ }),
- /***/ 94:
- /*!************************************************************************!*\
- !*** D:/project/新医院随访2023/follow_applet/node_modules/stompjs/index.js ***!
- \************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- // Copyright (C) 2013 [Jeff Mesnil](http://jmesnil.net/)
- //
- // Stomp Over WebSocket http://www.jmesnil.net/stomp-websocket/doc/ | Apache License V2.0
- //
- // The library can be used in node.js app to connect to STOMP brokers over TCP
- // or Web sockets.
- // Root of the `stompjs module`
- var Stomp = __webpack_require__(/*! ./lib/stomp.js */ 95);
- var StompNode = __webpack_require__(/*! ./lib/stomp-node.js */ 96);
- module.exports = Stomp.Stomp;
- module.exports.overTCP = StompNode.overTCP;
- module.exports.overWS = StompNode.overWS;
- /***/ }),
- /***/ 95:
- /*!****************************************************************************!*\
- !*** D:/project/新医院随访2023/follow_applet/node_modules/stompjs/lib/stomp.js ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- // Generated by CoffeeScript 1.7.1
- /*
- Stomp Over WebSocket http://www.jmesnil.net/stomp-websocket/doc/ | Apache License V2.0
- Copyright (C) 2010-2013 [Jeff Mesnil](http://jmesnil.net/)
- Copyright (C) 2012 [FuseSource, Inc.](http://fusesource.com)
- */
- (function () {
- var Byte,
- Client,
- Frame,
- Stomp,
- __hasProp = {}.hasOwnProperty,
- __slice = [].slice;
- Byte = {
- LF: '\x0A',
- NULL: '\x00'
- };
- Frame = function () {
- var unmarshallSingle;
- function Frame(command, headers, body) {
- this.command = command;
- this.headers = headers != null ? headers : {};
- this.body = body != null ? body : '';
- }
- Frame.prototype.toString = function () {
- var lines, name, skipContentLength, value, _ref;
- lines = [this.command];
- skipContentLength = this.headers['content-length'] === false ? true : false;
- if (skipContentLength) {
- delete this.headers['content-length'];
- }
- _ref = this.headers;
- for (name in _ref) {
- if (!__hasProp.call(_ref, name)) continue;
- value = _ref[name];
- lines.push("" + name + ":" + value);
- }
- if (this.body && !skipContentLength) {
- lines.push("content-length:" + Frame.sizeOfUTF8(this.body));
- }
- lines.push(Byte.LF + this.body);
- return lines.join(Byte.LF);
- };
- Frame.sizeOfUTF8 = function (s) {
- if (s) {
- return encodeURI(s).match(/%..|./g).length;
- } else {
- return 0;
- }
- };
- unmarshallSingle = function unmarshallSingle(data) {
- var body, chr, command, divider, headerLines, headers, i, idx, len, line, start, trim, _i, _j, _len, _ref, _ref1;
- divider = data.search(RegExp("" + Byte.LF + Byte.LF));
- headerLines = data.substring(0, divider).split(Byte.LF);
- command = headerLines.shift();
- headers = {};
- trim = function trim(str) {
- return str.replace(/^\s+|\s+$/g, '');
- };
- _ref = headerLines.reverse();
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- line = _ref[_i];
- idx = line.indexOf(':');
- headers[trim(line.substring(0, idx))] = trim(line.substring(idx + 1));
- }
- body = '';
- start = divider + 2;
- if (headers['content-length']) {
- len = parseInt(headers['content-length']);
- body = ('' + data).substring(start, start + len);
- } else {
- chr = null;
- for (i = _j = start, _ref1 = data.length; start <= _ref1 ? _j < _ref1 : _j > _ref1; i = start <= _ref1 ? ++_j : --_j) {
- chr = data.charAt(i);
- if (chr === Byte.NULL) {
- break;
- }
- body += chr;
- }
- }
- return new Frame(command, headers, body);
- };
- Frame.unmarshall = function (datas) {
- var data;
- return function () {
- var _i, _len, _ref, _results;
- _ref = datas.split(RegExp("" + Byte.NULL + Byte.LF + "*"));
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- data = _ref[_i];
- if ((data != null ? data.length : void 0) > 0) {
- _results.push(unmarshallSingle(data));
- }
- }
- return _results;
- }();
- };
- Frame.marshall = function (command, headers, body) {
- var frame;
- frame = new Frame(command, headers, body);
- return frame.toString() + Byte.NULL;
- };
- return Frame;
- }();
- Client = function () {
- var now;
- function Client(ws) {
- this.ws = ws;
- this.ws.binaryType = "arraybuffer";
- this.counter = 0;
- this.connected = false;
- this.heartbeat = {
- outgoing: 10000,
- incoming: 10000
- };
- this.maxWebSocketFrameSize = 16 * 1024;
- this.subscriptions = {};
- }
- Client.prototype.debug = function (message) {
- var _ref;
- return typeof window !== "undefined" && window !== null ? (_ref = window.console) != null ? _ref.log(message) : void 0 : void 0;
- };
- now = function now() {
- if (Date.now) {
- return Date.now();
- } else {
- return new Date().valueOf;
- }
- };
- Client.prototype._transmit = function (command, headers, body) {
- var out;
- out = Frame.marshall(command, headers, body);
- if (typeof this.debug === "function") {
- this.debug(">>> " + out);
- }
- while (true) {
- if (out.length > this.maxWebSocketFrameSize) {
- this.ws.send(out.substring(0, this.maxWebSocketFrameSize));
- out = out.substring(this.maxWebSocketFrameSize);
- if (typeof this.debug === "function") {
- this.debug("remaining = " + out.length);
- }
- } else {
- return this.ws.send(out);
- }
- }
- };
- Client.prototype._setupHeartbeat = function (headers) {
- var serverIncoming, serverOutgoing, ttl, v, _ref, _ref1;
- if ((_ref = headers.version) !== Stomp.VERSIONS.V1_1 && _ref !== Stomp.VERSIONS.V1_2) {
- return;
- }
- _ref1 = function () {
- var _i, _len, _ref1, _results;
- _ref1 = headers['heart-beat'].split(",");
- _results = [];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- v = _ref1[_i];
- _results.push(parseInt(v));
- }
- return _results;
- }(), serverOutgoing = _ref1[0], serverIncoming = _ref1[1];
- if (!(this.heartbeat.outgoing === 0 || serverIncoming === 0)) {
- ttl = Math.max(this.heartbeat.outgoing, serverIncoming);
- if (typeof this.debug === "function") {
- this.debug("send PING every " + ttl + "ms");
- }
- this.pinger = Stomp.setInterval(ttl, function (_this) {
- return function () {
- _this.ws.send(Byte.LF);
- return typeof _this.debug === "function" ? _this.debug(">>> PING") : void 0;
- };
- }(this));
- }
- if (!(this.heartbeat.incoming === 0 || serverOutgoing === 0)) {
- ttl = Math.max(this.heartbeat.incoming, serverOutgoing);
- if (typeof this.debug === "function") {
- this.debug("check PONG every " + ttl + "ms");
- }
- return this.ponger = Stomp.setInterval(ttl, function (_this) {
- return function () {
- var delta;
- delta = now() - _this.serverActivity;
- if (delta > ttl * 2) {
- if (typeof _this.debug === "function") {
- _this.debug("did not receive server activity for the last " + delta + "ms");
- }
- return _this.ws.close();
- }
- };
- }(this));
- }
- };
- Client.prototype._parseConnect = function () {
- var args, connectCallback, errorCallback, headers;
- args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
- headers = {};
- switch (args.length) {
- case 2:
- headers = args[0], connectCallback = args[1];
- break;
- case 3:
- if (args[1] instanceof Function) {
- headers = args[0], connectCallback = args[1], errorCallback = args[2];
- } else {
- headers.login = args[0], headers.passcode = args[1], connectCallback = args[2];
- }
- break;
- case 4:
- headers.login = args[0], headers.passcode = args[1], connectCallback = args[2], errorCallback = args[3];
- break;
- default:
- headers.login = args[0], headers.passcode = args[1], connectCallback = args[2], errorCallback = args[3], headers.host = args[4];
- }
- return [headers, connectCallback, errorCallback];
- };
- Client.prototype.connect = function () {
- var args, errorCallback, headers, out;
- args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
- out = this._parseConnect.apply(this, args);
- headers = out[0], this.connectCallback = out[1], errorCallback = out[2];
- if (typeof this.debug === "function") {
- this.debug("Opening Web Socket...");
- }
- this.ws.onmessage = function (_this) {
- return function (evt) {
- var arr, c, client, data, frame, messageID, onreceive, subscription, _i, _len, _ref, _results;
- data = typeof ArrayBuffer !== 'undefined' && evt.data instanceof ArrayBuffer ? (arr = new Uint8Array(evt.data), typeof _this.debug === "function" ? _this.debug("--- got data length: " + arr.length) : void 0, function () {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = arr.length; _i < _len; _i++) {
- c = arr[_i];
- _results.push(String.fromCharCode(c));
- }
- return _results;
- }().join('')) : evt.data;
- _this.serverActivity = now();
- if (data === Byte.LF) {
- if (typeof _this.debug === "function") {
- _this.debug("<<< PONG");
- }
- return;
- }
- if (typeof _this.debug === "function") {
- _this.debug("<<< " + data);
- }
- _ref = Frame.unmarshall(data);
- _results = [];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- frame = _ref[_i];
- switch (frame.command) {
- case "CONNECTED":
- if (typeof _this.debug === "function") {
- _this.debug("connected to server " + frame.headers.server);
- }
- _this.connected = true;
- _this._setupHeartbeat(frame.headers);
- _results.push(typeof _this.connectCallback === "function" ? _this.connectCallback(frame) : void 0);
- break;
- case "MESSAGE":
- subscription = frame.headers.subscription;
- onreceive = _this.subscriptions[subscription] || _this.onreceive;
- if (onreceive) {
- client = _this;
- messageID = frame.headers["message-id"];
- frame.ack = function (headers) {
- if (headers == null) {
- headers = {};
- }
- return client.ack(messageID, subscription, headers);
- };
- frame.nack = function (headers) {
- if (headers == null) {
- headers = {};
- }
- return client.nack(messageID, subscription, headers);
- };
- _results.push(onreceive(frame));
- } else {
- _results.push(typeof _this.debug === "function" ? _this.debug("Unhandled received MESSAGE: " + frame) : void 0);
- }
- break;
- case "RECEIPT":
- _results.push(typeof _this.onreceipt === "function" ? _this.onreceipt(frame) : void 0);
- break;
- case "ERROR":
- _results.push(typeof errorCallback === "function" ? errorCallback(frame) : void 0);
- break;
- default:
- _results.push(typeof _this.debug === "function" ? _this.debug("Unhandled frame: " + frame) : void 0);
- }
- }
- return _results;
- };
- }(this);
- this.ws.onclose = function (_this) {
- return function () {
- var msg;
- msg = "Whoops! Lost connection to " + _this.ws.url;
- if (typeof _this.debug === "function") {
- _this.debug(msg);
- }
- _this._cleanUp();
- return typeof errorCallback === "function" ? errorCallback(msg) : void 0;
- };
- }(this);
- return this.ws.onopen = function (_this) {
- return function () {
- if (typeof _this.debug === "function") {
- _this.debug('Web Socket Opened...');
- }
- headers["accept-version"] = Stomp.VERSIONS.supportedVersions();
- headers["heart-beat"] = [_this.heartbeat.outgoing, _this.heartbeat.incoming].join(',');
- return _this._transmit("CONNECT", headers);
- };
- }(this);
- };
- Client.prototype.disconnect = function (disconnectCallback, headers) {
- if (headers == null) {
- headers = {};
- }
- this._transmit("DISCONNECT", headers);
- this.ws.onclose = null;
- this.ws.close();
- this._cleanUp();
- return typeof disconnectCallback === "function" ? disconnectCallback() : void 0;
- };
- Client.prototype._cleanUp = function () {
- this.connected = false;
- if (this.pinger) {
- Stomp.clearInterval(this.pinger);
- }
- if (this.ponger) {
- return Stomp.clearInterval(this.ponger);
- }
- };
- Client.prototype.send = function (destination, headers, body) {
- if (headers == null) {
- headers = {};
- }
- if (body == null) {
- body = '';
- }
- headers.destination = destination;
- return this._transmit("SEND", headers, body);
- };
- Client.prototype.subscribe = function (destination, callback, headers) {
- var client;
- if (headers == null) {
- headers = {};
- }
- if (!headers.id) {
- headers.id = "sub-" + this.counter++;
- }
- headers.destination = destination;
- this.subscriptions[headers.id] = callback;
- this._transmit("SUBSCRIBE", headers);
- client = this;
- return {
- id: headers.id,
- unsubscribe: function unsubscribe() {
- return client.unsubscribe(headers.id);
- }
- };
- };
- Client.prototype.unsubscribe = function (id) {
- delete this.subscriptions[id];
- return this._transmit("UNSUBSCRIBE", {
- id: id
- });
- };
- Client.prototype.begin = function (transaction) {
- var client, txid;
- txid = transaction || "tx-" + this.counter++;
- this._transmit("BEGIN", {
- transaction: txid
- });
- client = this;
- return {
- id: txid,
- commit: function commit() {
- return client.commit(txid);
- },
- abort: function abort() {
- return client.abort(txid);
- }
- };
- };
- Client.prototype.commit = function (transaction) {
- return this._transmit("COMMIT", {
- transaction: transaction
- });
- };
- Client.prototype.abort = function (transaction) {
- return this._transmit("ABORT", {
- transaction: transaction
- });
- };
- Client.prototype.ack = function (messageID, subscription, headers) {
- if (headers == null) {
- headers = {};
- }
- headers["message-id"] = messageID;
- headers.subscription = subscription;
- return this._transmit("ACK", headers);
- };
- Client.prototype.nack = function (messageID, subscription, headers) {
- if (headers == null) {
- headers = {};
- }
- headers["message-id"] = messageID;
- headers.subscription = subscription;
- return this._transmit("NACK", headers);
- };
- return Client;
- }();
- Stomp = {
- VERSIONS: {
- V1_0: '1.0',
- V1_1: '1.1',
- V1_2: '1.2',
- supportedVersions: function supportedVersions() {
- return '1.1,1.0';
- }
- },
- client: function client(url, protocols) {
- var klass, ws;
- if (protocols == null) {
- protocols = ['v10.stomp', 'v11.stomp'];
- }
- klass = Stomp.WebSocketClass || WebSocket;
- ws = new klass(url, protocols);
- return new Client(ws);
- },
- over: function over(ws) {
- return new Client(ws);
- },
- Frame: Frame
- };
- if ( true && exports !== null) {
- exports.Stomp = Stomp;
- }
- if (typeof window !== "undefined" && window !== null) {
- Stomp.setInterval = function (interval, f) {
- return window.setInterval(f, interval);
- };
- Stomp.clearInterval = function (id) {
- return window.clearInterval(id);
- };
- window.Stomp = Stomp;
- } else if (!exports) {
- self.Stomp = Stomp;
- }
- }).call(this);
- /***/ }),
- /***/ 96:
- /*!*********************************************************************************!*\
- !*** D:/project/新医院随访2023/follow_applet/node_modules/stompjs/lib/stomp-node.js ***!
- \*********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- // Generated by CoffeeScript 1.7.1
- /*
- Stomp Over WebSocket http://www.jmesnil.net/stomp-websocket/doc/ | Apache License V2.0
- Copyright (C) 2013 [Jeff Mesnil](http://jmesnil.net/)
- */
- (function () {
- var Stomp, net, overTCP, overWS, wrapTCP, wrapWS;
- Stomp = __webpack_require__(/*! ./stomp */ 95);
- net = __webpack_require__(/*! net */ 97);
- Stomp.Stomp.setInterval = function (interval, f) {
- return setInterval(f, interval);
- };
- Stomp.Stomp.clearInterval = function (id) {
- return clearInterval(id);
- };
- wrapTCP = function wrapTCP(port, host) {
- var socket, ws;
- socket = null;
- ws = {
- url: 'tcp:// ' + host + ':' + port,
- send: function send(d) {
- return socket.write(d);
- },
- close: function close() {
- return socket.end();
- }
- };
- socket = net.connect(port, host, function (e) {
- return ws.onopen();
- });
- socket.on('error', function (e) {
- return typeof ws.onclose === "function" ? ws.onclose(e) : void 0;
- });
- socket.on('close', function (e) {
- return typeof ws.onclose === "function" ? ws.onclose(e) : void 0;
- });
- socket.on('data', function (data) {
- var event;
- event = {
- 'data': data.toString()
- };
- return ws.onmessage(event);
- });
- return ws;
- };
- wrapWS = function wrapWS(url) {
- var WebSocketClient, connection, socket, ws;
- WebSocketClient = __webpack_require__(/*! websocket */ 98).client;
- connection = null;
- ws = {
- url: url,
- send: function send(d) {
- return connection.sendUTF(d);
- },
- close: function close() {
- return connection.close();
- }
- };
- socket = new WebSocketClient();
- socket.on('connect', function (conn) {
- connection = conn;
- ws.onopen();
- connection.on('error', function (error) {
- return typeof ws.onclose === "function" ? ws.onclose(error) : void 0;
- });
- connection.on('close', function () {
- return typeof ws.onclose === "function" ? ws.onclose() : void 0;
- });
- return connection.on('message', function (message) {
- var event;
- if (message.type === 'utf8') {
- event = {
- 'data': message.utf8Data
- };
- return ws.onmessage(event);
- }
- });
- });
- socket.connect(url);
- return ws;
- };
- overTCP = function overTCP(host, port) {
- var socket;
- socket = wrapTCP(port, host);
- return Stomp.Stomp.over(socket);
- };
- overWS = function overWS(url) {
- var socket;
- socket = wrapWS(url);
- return Stomp.Stomp.over(socket);
- };
- exports.overTCP = overTCP;
- exports.overWS = overWS;
- }).call(this);
- /***/ }),
- /***/ 97:
- /*!******************************************************!*\
- !*** ./node_modules/node-libs-browser/mock/empty.js ***!
- \******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- /***/ }),
- /***/ 98:
- /*!********************************************************************************!*\
- !*** D:/project/新医院随访2023/follow_applet/node_modules/websocket/lib/browser.js ***!
- \********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
- var _globalThis;
- if ((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === 'object') {
- _globalThis = globalThis;
- } else {
- try {
- _globalThis = __webpack_require__(/*! es5-ext/global */ 99);
- } catch (error) {} finally {
- if (!_globalThis && typeof window !== 'undefined') {
- _globalThis = window;
- }
- if (!_globalThis) {
- throw new Error('Could not determine global this');
- }
- }
- }
- var NativeWebSocket = _globalThis.WebSocket || _globalThis.MozWebSocket;
- var websocket_version = __webpack_require__(/*! ./version */ 100);
- /**
- * Expose a W3C WebSocket class with just one or two arguments.
- */
- function W3CWebSocket(uri, protocols) {
- var native_instance;
- if (protocols) {
- native_instance = new NativeWebSocket(uri, protocols);
- } else {
- native_instance = new NativeWebSocket(uri);
- }
- /**
- * 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket
- * class). Since it is an Object it will be returned as it is when creating an
- * instance of W3CWebSocket via 'new W3CWebSocket()'.
- *
- * ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2
- */
- return native_instance;
- }
- if (NativeWebSocket) {
- ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'].forEach(function (prop) {
- Object.defineProperty(W3CWebSocket, prop, {
- get: function get() {
- return NativeWebSocket[prop];
- }
- });
- });
- }
- /**
- * Module exports.
- */
- module.exports = {
- 'w3cwebsocket': NativeWebSocket ? W3CWebSocket : null,
- 'version': websocket_version
- };
- /***/ }),
- /***/ 99:
- /*!*************************************************************************!*\
- !*** D:/project/新医院随访2023/follow_applet/node_modules/es5-ext/global.js ***!
- \*************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
- var naiveFallback = function naiveFallback() {
- if ((typeof self === "undefined" ? "undefined" : _typeof(self)) === "object" && self) return self;
- if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && window) return window;
- throw new Error("Unable to resolve global `this`");
- };
- module.exports = function () {
- if (this) return this;
- // Unexpected strict mode (may happen if e.g. bundled into ESM module)
- // Fallback to standard globalThis if available
- if ((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === "object" && globalThis) return globalThis;
- // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
- // In all ES5+ engines global object inherits from Object.prototype
- // (if you approached one that doesn't please report)
- try {
- Object.defineProperty(Object.prototype, "__global__", {
- get: function get() {
- return this;
- },
- configurable: true
- });
- } catch (error) {
- // Unfortunate case of updates to Object.prototype being restricted
- // via preventExtensions, seal or freeze
- return naiveFallback();
- }
- try {
- // Safari case (window.__global__ works, but __global__ does not)
- if (!__global__) return naiveFallback();
- return __global__;
- } finally {
- delete Object.prototype.__global__;
- }
- }();
- /***/ })
- }]);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pagesHome/common/vendor.js.map
|