1.Sass.js增加两个接口
/3m/api/meeting/joinParams.do 请求入会前信息 /3m/api/meeting/detail.do 入会成功后所有详细信息 2.MCUClientEngine 公开外部调用接口
正在显示
33 个修改的文件
包含
1422 行增加
和
149 行删除
此 diff 太大无法显示。
node_modules/charenc/LICENSE.mkd
0 → 100644
| 1 | +Copyright © 2011, Paul Vorbach. All rights reserved. | ||
| 2 | +Copyright © 2009, Jeff Mott. All rights reserved. | ||
| 3 | + | ||
| 4 | +All rights reserved. | ||
| 5 | + | ||
| 6 | +Redistribution and use in source and binary forms, with or without modification, | ||
| 7 | +are permitted provided that the following conditions are met: | ||
| 8 | + | ||
| 9 | +* Redistributions of source code must retain the above copyright notice, this | ||
| 10 | + list of conditions and the following disclaimer. | ||
| 11 | +* Redistributions in binary form must reproduce the above copyright notice, this | ||
| 12 | + list of conditions and the following disclaimer in the documentation and/or | ||
| 13 | + other materials provided with the distribution. | ||
| 14 | +* Neither the name Crypto-JS nor the names of its contributors may be used to | ||
| 15 | + endorse or promote products derived from this software without specific prior | ||
| 16 | + written permission. | ||
| 17 | + | ||
| 18 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
| 19 | +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| 20 | +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| 21 | +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
| 22 | +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| 23 | +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 24 | +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
| 25 | +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 26 | +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| 27 | +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
node_modules/charenc/README.js
0 → 100644
| 1 | +**enc** provides crypto character encoding utilities. |
node_modules/charenc/charenc.js
0 → 100644
| 1 | +var charenc = { | ||
| 2 | + // UTF-8 encoding | ||
| 3 | + utf8: { | ||
| 4 | + // Convert a string to a byte array | ||
| 5 | + stringToBytes: function(str) { | ||
| 6 | + return charenc.bin.stringToBytes(unescape(encodeURIComponent(str))); | ||
| 7 | + }, | ||
| 8 | + | ||
| 9 | + // Convert a byte array to a string | ||
| 10 | + bytesToString: function(bytes) { | ||
| 11 | + return decodeURIComponent(escape(charenc.bin.bytesToString(bytes))); | ||
| 12 | + } | ||
| 13 | + }, | ||
| 14 | + | ||
| 15 | + // Binary encoding | ||
| 16 | + bin: { | ||
| 17 | + // Convert a string to a byte array | ||
| 18 | + stringToBytes: function(str) { | ||
| 19 | + for (var bytes = [], i = 0; i < str.length; i++) | ||
| 20 | + bytes.push(str.charCodeAt(i) & 0xFF); | ||
| 21 | + return bytes; | ||
| 22 | + }, | ||
| 23 | + | ||
| 24 | + // Convert a byte array to a string | ||
| 25 | + bytesToString: function(bytes) { | ||
| 26 | + for (var str = [], i = 0; i < bytes.length; i++) | ||
| 27 | + str.push(String.fromCharCode(bytes[i])); | ||
| 28 | + return str.join(''); | ||
| 29 | + } | ||
| 30 | + } | ||
| 31 | +}; | ||
| 32 | + | ||
| 33 | +module.exports = charenc; |
node_modules/charenc/package.json
0 → 100644
| 1 | +{ | ||
| 2 | + "_args": [ | ||
| 3 | + [ | ||
| 4 | + "charenc@~0.0.1", | ||
| 5 | + "D:\\work\\McuClient\\node_modules\\md5" | ||
| 6 | + ] | ||
| 7 | + ], | ||
| 8 | + "_from": "charenc@>=0.0.1 <0.1.0", | ||
| 9 | + "_id": "charenc@0.0.2", | ||
| 10 | + "_inCache": true, | ||
| 11 | + "_installable": true, | ||
| 12 | + "_location": "/charenc", | ||
| 13 | + "_nodeVersion": "4.4.5", | ||
| 14 | + "_npmOperationalInternal": { | ||
| 15 | + "host": "packages-12-west.internal.npmjs.com", | ||
| 16 | + "tmp": "tmp/charenc-0.0.2.tgz_1482450158427_0.9801697849761695" | ||
| 17 | + }, | ||
| 18 | + "_npmUser": { | ||
| 19 | + "email": "paul@vorba.ch", | ||
| 20 | + "name": "pvorb" | ||
| 21 | + }, | ||
| 22 | + "_npmVersion": "3.9.3", | ||
| 23 | + "_phantomChildren": {}, | ||
| 24 | + "_requested": { | ||
| 25 | + "name": "charenc", | ||
| 26 | + "raw": "charenc@~0.0.1", | ||
| 27 | + "rawSpec": "~0.0.1", | ||
| 28 | + "scope": null, | ||
| 29 | + "spec": ">=0.0.1 <0.1.0", | ||
| 30 | + "type": "range" | ||
| 31 | + }, | ||
| 32 | + "_requiredBy": [ | ||
| 33 | + "/md5" | ||
| 34 | + ], | ||
| 35 | + "_resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", | ||
| 36 | + "_shasum": "c0a1d2f3a7092e03774bfa83f14c0fc5790a8667", | ||
| 37 | + "_shrinkwrap": null, | ||
| 38 | + "_spec": "charenc@~0.0.1", | ||
| 39 | + "_where": "D:\\work\\McuClient\\node_modules\\md5", | ||
| 40 | + "author": { | ||
| 41 | + "email": "paul@vorb.de", | ||
| 42 | + "name": "Paul Vorbach", | ||
| 43 | + "url": "http://vorb.de" | ||
| 44 | + }, | ||
| 45 | + "bugs": { | ||
| 46 | + "url": "https://github.com/pvorb/node-charenc/issues" | ||
| 47 | + }, | ||
| 48 | + "dependencies": {}, | ||
| 49 | + "description": "character encoding utilities", | ||
| 50 | + "devDependencies": {}, | ||
| 51 | + "directories": {}, | ||
| 52 | + "dist": { | ||
| 53 | + "shasum": "c0a1d2f3a7092e03774bfa83f14c0fc5790a8667", | ||
| 54 | + "tarball": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz" | ||
| 55 | + }, | ||
| 56 | + "engines": { | ||
| 57 | + "node": "*" | ||
| 58 | + }, | ||
| 59 | + "gitHead": "01d66efb429d0cb242b2dd5af2ce338554fd3e54", | ||
| 60 | + "homepage": "https://github.com/pvorb/node-charenc#readme", | ||
| 61 | + "license": "BSD-3-Clause", | ||
| 62 | + "main": "charenc.js", | ||
| 63 | + "maintainers": [ | ||
| 64 | + { | ||
| 65 | + "email": "paul@vorb.de", | ||
| 66 | + "name": "pvorb" | ||
| 67 | + } | ||
| 68 | + ], | ||
| 69 | + "name": "charenc", | ||
| 70 | + "optionalDependencies": {}, | ||
| 71 | + "readme": "ERROR: No README data found!", | ||
| 72 | + "repository": { | ||
| 73 | + "type": "git", | ||
| 74 | + "url": "git://github.com/pvorb/node-charenc.git" | ||
| 75 | + }, | ||
| 76 | + "scripts": {}, | ||
| 77 | + "tags": [ | ||
| 78 | + "utf8", | ||
| 79 | + "binary", | ||
| 80 | + "byte", | ||
| 81 | + "string" | ||
| 82 | + ], | ||
| 83 | + "version": "0.0.2" | ||
| 84 | +} |
node_modules/crypt/LICENSE.mkd
0 → 100644
| 1 | +Copyright © 2011, Paul Vorbach. All rights reserved. | ||
| 2 | +Copyright © 2009, Jeff Mott. All rights reserved. | ||
| 3 | + | ||
| 4 | +All rights reserved. | ||
| 5 | + | ||
| 6 | +Redistribution and use in source and binary forms, with or without modification, | ||
| 7 | +are permitted provided that the following conditions are met: | ||
| 8 | + | ||
| 9 | +* Redistributions of source code must retain the above copyright notice, this | ||
| 10 | + list of conditions and the following disclaimer. | ||
| 11 | +* Redistributions in binary form must reproduce the above copyright notice, this | ||
| 12 | + list of conditions and the following disclaimer in the documentation and/or | ||
| 13 | + other materials provided with the distribution. | ||
| 14 | +* Neither the name Crypto-JS nor the names of its contributors may be used to | ||
| 15 | + endorse or promote products derived from this software without specific prior | ||
| 16 | + written permission. | ||
| 17 | + | ||
| 18 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
| 19 | +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| 20 | +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| 21 | +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
| 22 | +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| 23 | +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 24 | +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
| 25 | +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 26 | +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| 27 | +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
node_modules/crypt/README.mkd
0 → 100644
| 1 | +**crypt** provides utilities for encryption and hashing |
node_modules/crypt/crypt.js
0 → 100644
| 1 | +(function() { | ||
| 2 | + var base64map | ||
| 3 | + = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', | ||
| 4 | + | ||
| 5 | + crypt = { | ||
| 6 | + // Bit-wise rotation left | ||
| 7 | + rotl: function(n, b) { | ||
| 8 | + return (n << b) | (n >>> (32 - b)); | ||
| 9 | + }, | ||
| 10 | + | ||
| 11 | + // Bit-wise rotation right | ||
| 12 | + rotr: function(n, b) { | ||
| 13 | + return (n << (32 - b)) | (n >>> b); | ||
| 14 | + }, | ||
| 15 | + | ||
| 16 | + // Swap big-endian to little-endian and vice versa | ||
| 17 | + endian: function(n) { | ||
| 18 | + // If number given, swap endian | ||
| 19 | + if (n.constructor == Number) { | ||
| 20 | + return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00; | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + // Else, assume array and swap all items | ||
| 24 | + for (var i = 0; i < n.length; i++) | ||
| 25 | + n[i] = crypt.endian(n[i]); | ||
| 26 | + return n; | ||
| 27 | + }, | ||
| 28 | + | ||
| 29 | + // Generate an array of any length of random bytes | ||
| 30 | + randomBytes: function(n) { | ||
| 31 | + for (var bytes = []; n > 0; n--) | ||
| 32 | + bytes.push(Math.floor(Math.random() * 256)); | ||
| 33 | + return bytes; | ||
| 34 | + }, | ||
| 35 | + | ||
| 36 | + // Convert a byte array to big-endian 32-bit words | ||
| 37 | + bytesToWords: function(bytes) { | ||
| 38 | + for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) | ||
| 39 | + words[b >>> 5] |= bytes[i] << (24 - b % 32); | ||
| 40 | + return words; | ||
| 41 | + }, | ||
| 42 | + | ||
| 43 | + // Convert big-endian 32-bit words to a byte array | ||
| 44 | + wordsToBytes: function(words) { | ||
| 45 | + for (var bytes = [], b = 0; b < words.length * 32; b += 8) | ||
| 46 | + bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); | ||
| 47 | + return bytes; | ||
| 48 | + }, | ||
| 49 | + | ||
| 50 | + // Convert a byte array to a hex string | ||
| 51 | + bytesToHex: function(bytes) { | ||
| 52 | + for (var hex = [], i = 0; i < bytes.length; i++) { | ||
| 53 | + hex.push((bytes[i] >>> 4).toString(16)); | ||
| 54 | + hex.push((bytes[i] & 0xF).toString(16)); | ||
| 55 | + } | ||
| 56 | + return hex.join(''); | ||
| 57 | + }, | ||
| 58 | + | ||
| 59 | + // Convert a hex string to a byte array | ||
| 60 | + hexToBytes: function(hex) { | ||
| 61 | + for (var bytes = [], c = 0; c < hex.length; c += 2) | ||
| 62 | + bytes.push(parseInt(hex.substr(c, 2), 16)); | ||
| 63 | + return bytes; | ||
| 64 | + }, | ||
| 65 | + | ||
| 66 | + // Convert a byte array to a base-64 string | ||
| 67 | + bytesToBase64: function(bytes) { | ||
| 68 | + for (var base64 = [], i = 0; i < bytes.length; i += 3) { | ||
| 69 | + var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]; | ||
| 70 | + for (var j = 0; j < 4; j++) | ||
| 71 | + if (i * 8 + j * 6 <= bytes.length * 8) | ||
| 72 | + base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F)); | ||
| 73 | + else | ||
| 74 | + base64.push('='); | ||
| 75 | + } | ||
| 76 | + return base64.join(''); | ||
| 77 | + }, | ||
| 78 | + | ||
| 79 | + // Convert a base-64 string to a byte array | ||
| 80 | + base64ToBytes: function(base64) { | ||
| 81 | + // Remove non-base-64 characters | ||
| 82 | + base64 = base64.replace(/[^A-Z0-9+\/]/ig, ''); | ||
| 83 | + | ||
| 84 | + for (var bytes = [], i = 0, imod4 = 0; i < base64.length; | ||
| 85 | + imod4 = ++i % 4) { | ||
| 86 | + if (imod4 == 0) continue; | ||
| 87 | + bytes.push(((base64map.indexOf(base64.charAt(i - 1)) | ||
| 88 | + & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2)) | ||
| 89 | + | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2))); | ||
| 90 | + } | ||
| 91 | + return bytes; | ||
| 92 | + } | ||
| 93 | + }; | ||
| 94 | + | ||
| 95 | + module.exports = crypt; | ||
| 96 | +})(); |
node_modules/crypt/package.json
0 → 100644
| 1 | +{ | ||
| 2 | + "_args": [ | ||
| 3 | + [ | ||
| 4 | + "crypt@~0.0.1", | ||
| 5 | + "D:\\work\\McuClient\\node_modules\\md5" | ||
| 6 | + ] | ||
| 7 | + ], | ||
| 8 | + "_from": "crypt@>=0.0.1 <0.1.0", | ||
| 9 | + "_id": "crypt@0.0.2", | ||
| 10 | + "_inCache": true, | ||
| 11 | + "_installable": true, | ||
| 12 | + "_location": "/crypt", | ||
| 13 | + "_nodeVersion": "4.4.5", | ||
| 14 | + "_npmOperationalInternal": { | ||
| 15 | + "host": "packages-18-east.internal.npmjs.com", | ||
| 16 | + "tmp": "tmp/crypt-0.0.2.tgz_1482450046585_0.08984375675208867" | ||
| 17 | + }, | ||
| 18 | + "_npmUser": { | ||
| 19 | + "email": "paul@vorba.ch", | ||
| 20 | + "name": "pvorb" | ||
| 21 | + }, | ||
| 22 | + "_npmVersion": "3.9.3", | ||
| 23 | + "_phantomChildren": {}, | ||
| 24 | + "_requested": { | ||
| 25 | + "name": "crypt", | ||
| 26 | + "raw": "crypt@~0.0.1", | ||
| 27 | + "rawSpec": "~0.0.1", | ||
| 28 | + "scope": null, | ||
| 29 | + "spec": ">=0.0.1 <0.1.0", | ||
| 30 | + "type": "range" | ||
| 31 | + }, | ||
| 32 | + "_requiredBy": [ | ||
| 33 | + "/md5" | ||
| 34 | + ], | ||
| 35 | + "_resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", | ||
| 36 | + "_shasum": "88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b", | ||
| 37 | + "_shrinkwrap": null, | ||
| 38 | + "_spec": "crypt@~0.0.1", | ||
| 39 | + "_where": "D:\\work\\McuClient\\node_modules\\md5", | ||
| 40 | + "author": { | ||
| 41 | + "email": "paul@vorb.de", | ||
| 42 | + "name": "Paul Vorbach", | ||
| 43 | + "url": "http://vorb.de" | ||
| 44 | + }, | ||
| 45 | + "bugs": { | ||
| 46 | + "url": "https://github.com/pvorb/node-crypt/issues" | ||
| 47 | + }, | ||
| 48 | + "dependencies": {}, | ||
| 49 | + "description": "utilities for encryption and hashing", | ||
| 50 | + "devDependencies": {}, | ||
| 51 | + "directories": {}, | ||
| 52 | + "dist": { | ||
| 53 | + "shasum": "88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b", | ||
| 54 | + "tarball": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz" | ||
| 55 | + }, | ||
| 56 | + "engines": { | ||
| 57 | + "node": "*" | ||
| 58 | + }, | ||
| 59 | + "gitHead": "b275e2cde03cab40206dbb2a551b781f51feca3f", | ||
| 60 | + "homepage": "https://github.com/pvorb/node-crypt#readme", | ||
| 61 | + "license": "BSD-3-Clause", | ||
| 62 | + "main": "crypt.js", | ||
| 63 | + "maintainers": [ | ||
| 64 | + { | ||
| 65 | + "email": "paul@vorb.de", | ||
| 66 | + "name": "pvorb" | ||
| 67 | + } | ||
| 68 | + ], | ||
| 69 | + "name": "crypt", | ||
| 70 | + "optionalDependencies": {}, | ||
| 71 | + "readme": "ERROR: No README data found!", | ||
| 72 | + "repository": { | ||
| 73 | + "type": "git", | ||
| 74 | + "url": "git://github.com/pvorb/node-crypt.git" | ||
| 75 | + }, | ||
| 76 | + "scripts": {}, | ||
| 77 | + "tags": [ | ||
| 78 | + "hash", | ||
| 79 | + "security" | ||
| 80 | + ], | ||
| 81 | + "version": "0.0.2" | ||
| 82 | +} |
node_modules/is-buffer/.travis.yml
0 → 100644
| 1 | +sudo: false | ||
| 2 | +language: node_js | ||
| 3 | +node_js: | ||
| 4 | + - node | ||
| 5 | +env: | ||
| 6 | + global: | ||
| 7 | + - secure: du27W3wTgZ3G183axW7w0I01lOIurx8kilMH9p45VMfNXCu8lo6FLtLIQZxJ1FYMoJLQ1yfJTu2G0rq39SotDfJumsk6tF7BjTY/HKCocZaHqCMgw0W2bcylb5kMAdLhBNPlzejpPoWa1x1axbAHNFOLQNVosG/Bavu3/kuIIps= | ||
| 8 | + - secure: Ax/5aekM40o67NuTkvQqx1DhfP86ZlHTtKbv5yI+WFmbjD3FQM8b8G1J/o7doaBDev7Mp+1zDJOK2pFGtt+JGRl0lM2JUmLh6yh/b28obXyei5iuUkqzKJLfKZHMbY5QW/1i4DUM+zSXe6Kava0qnqYg5wBBnrF6gLdsVsCGNQk= |
node_modules/is-buffer/.zuul.yml
0 → 100644
node_modules/is-buffer/LICENSE
0 → 100644
| 1 | +The MIT License (MIT) | ||
| 2 | + | ||
| 3 | +Copyright (c) Feross Aboukhadijeh | ||
| 4 | + | ||
| 5 | +Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 6 | +of this software and associated documentation files (the "Software"), to deal | ||
| 7 | +in the Software without restriction, including without limitation the rights | ||
| 8 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 9 | +copies of the Software, and to permit persons to whom the Software is | ||
| 10 | +furnished to do so, subject to the following conditions: | ||
| 11 | + | ||
| 12 | +The above copyright notice and this permission notice shall be included in | ||
| 13 | +all copies or substantial portions of the Software. | ||
| 14 | + | ||
| 15 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 16 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 17 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 18 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 19 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 20 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| 21 | +THE SOFTWARE. |
node_modules/is-buffer/README.md
0 → 100644
| 1 | +# is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url] | ||
| 2 | + | ||
| 3 | +#### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer)) | ||
| 4 | + | ||
| 5 | +[![saucelabs][saucelabs-image]][saucelabs-url] | ||
| 6 | + | ||
| 7 | +[travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg | ||
| 8 | +[travis-url]: https://travis-ci.org/feross/is-buffer | ||
| 9 | +[npm-image]: https://img.shields.io/npm/v/is-buffer.svg | ||
| 10 | +[npm-url]: https://npmjs.org/package/is-buffer | ||
| 11 | +[downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg | ||
| 12 | +[saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg | ||
| 13 | +[saucelabs-url]: https://saucelabs.com/u/is-buffer | ||
| 14 | + | ||
| 15 | +## Why not use `Buffer.isBuffer`? | ||
| 16 | + | ||
| 17 | +This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)). | ||
| 18 | + | ||
| 19 | +It's future-proof and works in node too! | ||
| 20 | + | ||
| 21 | +## install | ||
| 22 | + | ||
| 23 | +```bash | ||
| 24 | +npm install is-buffer | ||
| 25 | +``` | ||
| 26 | + | ||
| 27 | +## usage | ||
| 28 | + | ||
| 29 | +```js | ||
| 30 | +var isBuffer = require('is-buffer') | ||
| 31 | + | ||
| 32 | +isBuffer(new Buffer(4)) // true | ||
| 33 | + | ||
| 34 | +isBuffer(undefined) // false | ||
| 35 | +isBuffer(null) // false | ||
| 36 | +isBuffer('') // false | ||
| 37 | +isBuffer(true) // false | ||
| 38 | +isBuffer(false) // false | ||
| 39 | +isBuffer(0) // false | ||
| 40 | +isBuffer(1) // false | ||
| 41 | +isBuffer(1.0) // false | ||
| 42 | +isBuffer('string') // false | ||
| 43 | +isBuffer({}) // false | ||
| 44 | +isBuffer(function foo () {}) // false | ||
| 45 | +``` | ||
| 46 | + | ||
| 47 | +## license | ||
| 48 | + | ||
| 49 | +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org). |
node_modules/is-buffer/index.js
0 → 100644
| 1 | +/*! | ||
| 2 | + * Determine if an object is a Buffer | ||
| 3 | + * | ||
| 4 | + * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> | ||
| 5 | + * @license MIT | ||
| 6 | + */ | ||
| 7 | + | ||
| 8 | +// The _isBuffer check is for Safari 5-7 support, because it's missing | ||
| 9 | +// Object.prototype.constructor. Remove this eventually | ||
| 10 | +module.exports = function (obj) { | ||
| 11 | + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +function isBuffer (obj) { | ||
| 15 | + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | +// For Node v0.10 support. Remove this eventually. | ||
| 19 | +function isSlowBuffer (obj) { | ||
| 20 | + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) | ||
| 21 | +} |
node_modules/is-buffer/package.json
0 → 100644
| 1 | +{ | ||
| 2 | + "_args": [ | ||
| 3 | + [ | ||
| 4 | + "is-buffer@~1.1.1", | ||
| 5 | + "D:\\work\\McuClient\\node_modules\\md5" | ||
| 6 | + ] | ||
| 7 | + ], | ||
| 8 | + "_from": "is-buffer@>=1.1.1 <1.2.0", | ||
| 9 | + "_id": "is-buffer@1.1.4", | ||
| 10 | + "_inCache": true, | ||
| 11 | + "_installable": true, | ||
| 12 | + "_location": "/is-buffer", | ||
| 13 | + "_nodeVersion": "0.10.46", | ||
| 14 | + "_npmOperationalInternal": { | ||
| 15 | + "host": "packages-16-east.internal.npmjs.com", | ||
| 16 | + "tmp": "tmp/is-buffer-1.1.4.tgz_1470267365943_0.6724087686743587" | ||
| 17 | + }, | ||
| 18 | + "_npmUser": { | ||
| 19 | + "email": "feross@feross.org", | ||
| 20 | + "name": "feross" | ||
| 21 | + }, | ||
| 22 | + "_npmVersion": "2.15.1", | ||
| 23 | + "_phantomChildren": {}, | ||
| 24 | + "_requested": { | ||
| 25 | + "name": "is-buffer", | ||
| 26 | + "raw": "is-buffer@~1.1.1", | ||
| 27 | + "rawSpec": "~1.1.1", | ||
| 28 | + "scope": null, | ||
| 29 | + "spec": ">=1.1.1 <1.2.0", | ||
| 30 | + "type": "range" | ||
| 31 | + }, | ||
| 32 | + "_requiredBy": [ | ||
| 33 | + "/md5" | ||
| 34 | + ], | ||
| 35 | + "_resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz", | ||
| 36 | + "_shasum": "cfc86ccd5dc5a52fa80489111c6920c457e2d98b", | ||
| 37 | + "_shrinkwrap": null, | ||
| 38 | + "_spec": "is-buffer@~1.1.1", | ||
| 39 | + "_where": "D:\\work\\McuClient\\node_modules\\md5", | ||
| 40 | + "author": { | ||
| 41 | + "email": "feross@feross.org", | ||
| 42 | + "name": "Feross Aboukhadijeh", | ||
| 43 | + "url": "http://feross.org/" | ||
| 44 | + }, | ||
| 45 | + "bugs": { | ||
| 46 | + "url": "https://github.com/feross/is-buffer/issues" | ||
| 47 | + }, | ||
| 48 | + "dependencies": {}, | ||
| 49 | + "description": "Determine if an object is a Buffer", | ||
| 50 | + "devDependencies": { | ||
| 51 | + "standard": "^7.0.0", | ||
| 52 | + "tape": "^4.0.0", | ||
| 53 | + "zuul": "^3.0.0" | ||
| 54 | + }, | ||
| 55 | + "directories": {}, | ||
| 56 | + "dist": { | ||
| 57 | + "shasum": "cfc86ccd5dc5a52fa80489111c6920c457e2d98b", | ||
| 58 | + "tarball": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz" | ||
| 59 | + }, | ||
| 60 | + "gitHead": "fd1a429f6ab8092f2e39cb5cc7175b5d9a986c31", | ||
| 61 | + "homepage": "https://github.com/feross/is-buffer#readme", | ||
| 62 | + "keywords": [ | ||
| 63 | + "buffer", | ||
| 64 | + "buffers", | ||
| 65 | + "type", | ||
| 66 | + "core buffer", | ||
| 67 | + "browser buffer", | ||
| 68 | + "browserify", | ||
| 69 | + "typed array", | ||
| 70 | + "uint32array", | ||
| 71 | + "int16array", | ||
| 72 | + "int32array", | ||
| 73 | + "float32array", | ||
| 74 | + "float64array", | ||
| 75 | + "browser", | ||
| 76 | + "arraybuffer", | ||
| 77 | + "dataview" | ||
| 78 | + ], | ||
| 79 | + "license": "MIT", | ||
| 80 | + "main": "index.js", | ||
| 81 | + "maintainers": [ | ||
| 82 | + { | ||
| 83 | + "email": "feross@feross.org", | ||
| 84 | + "name": "feross" | ||
| 85 | + } | ||
| 86 | + ], | ||
| 87 | + "name": "is-buffer", | ||
| 88 | + "optionalDependencies": {}, | ||
| 89 | + "readme": "ERROR: No README data found!", | ||
| 90 | + "repository": { | ||
| 91 | + "type": "git", | ||
| 92 | + "url": "git://github.com/feross/is-buffer.git" | ||
| 93 | + }, | ||
| 94 | + "scripts": { | ||
| 95 | + "test": "standard && npm run test-node && npm run test-browser", | ||
| 96 | + "test-browser": "zuul -- test/*.js", | ||
| 97 | + "test-browser-local": "zuul --local -- test/*.js", | ||
| 98 | + "test-node": "tape test/*.js" | ||
| 99 | + }, | ||
| 100 | + "testling": { | ||
| 101 | + "files": "test/*.js" | ||
| 102 | + }, | ||
| 103 | + "version": "1.1.4" | ||
| 104 | +} |
node_modules/is-buffer/test/basic.js
0 → 100644
| 1 | +var buffer = require('buffer') | ||
| 2 | +var isBuffer = require('../') | ||
| 3 | +var test = require('tape') | ||
| 4 | + | ||
| 5 | +test('is-buffer', function (t) { | ||
| 6 | + t.equal(isBuffer(new Buffer(4)), true, 'new Buffer(4)') | ||
| 7 | + t.equal(isBuffer(buffer.SlowBuffer(100)), true, 'SlowBuffer(100)') | ||
| 8 | + | ||
| 9 | + t.equal(isBuffer(undefined), false, 'undefined') | ||
| 10 | + t.equal(isBuffer(null), false, 'null') | ||
| 11 | + t.equal(isBuffer(''), false, 'empty string') | ||
| 12 | + t.equal(isBuffer(true), false, 'true') | ||
| 13 | + t.equal(isBuffer(false), false, 'false') | ||
| 14 | + t.equal(isBuffer(0), false, '0') | ||
| 15 | + t.equal(isBuffer(1), false, '1') | ||
| 16 | + t.equal(isBuffer(1.0), false, '1.0') | ||
| 17 | + t.equal(isBuffer('string'), false, 'string') | ||
| 18 | + t.equal(isBuffer({}), false, '{}') | ||
| 19 | + t.equal(isBuffer([]), false, '[]') | ||
| 20 | + t.equal(isBuffer(function foo () {}), false, 'function foo () {}') | ||
| 21 | + t.equal(isBuffer({ isBuffer: null }), false, '{ isBuffer: null }') | ||
| 22 | + t.equal(isBuffer({ isBuffer: function () { throw new Error() } }), false, '{ isBuffer: function () { throw new Error() } }') | ||
| 23 | + | ||
| 24 | + t.end() | ||
| 25 | +}) |
node_modules/md5/.npmignore
0 → 100644
| 1 | +node_modules/mocha |
node_modules/md5/.travis.yml
0 → 100644
node_modules/md5/LICENSE
0 → 100644
| 1 | +Copyright © 2011-2012, Paul Vorbach. | ||
| 2 | +Copyright © 2009, Jeff Mott. | ||
| 3 | + | ||
| 4 | +All rights reserved. | ||
| 5 | + | ||
| 6 | +Redistribution and use in source and binary forms, with or without modification, | ||
| 7 | +are permitted provided that the following conditions are met: | ||
| 8 | + | ||
| 9 | +* Redistributions of source code must retain the above copyright notice, this | ||
| 10 | + list of conditions and the following disclaimer. | ||
| 11 | +* Redistributions in binary form must reproduce the above copyright notice, this | ||
| 12 | + list of conditions and the following disclaimer in the documentation and/or | ||
| 13 | + other materials provided with the distribution. | ||
| 14 | +* Neither the name Crypto-JS nor the names of its contributors may be used to | ||
| 15 | + endorse or promote products derived from this software without specific prior | ||
| 16 | + written permission. | ||
| 17 | + | ||
| 18 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
| 19 | +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| 20 | +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| 21 | +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
| 22 | +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| 23 | +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 24 | +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
| 25 | +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 26 | +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| 27 | +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
node_modules/md5/README.md
0 → 100644
| 1 | +# MD5 | ||
| 2 | + | ||
| 3 | +[](http://travis-ci.org/pvorb/node-md5) | ||
| 4 | + | ||
| 5 | +a JavaScript function for hashing messages with MD5. | ||
| 6 | + | ||
| 7 | +## Installation | ||
| 8 | + | ||
| 9 | +You can use this package on the server side as well as the client side. | ||
| 10 | + | ||
| 11 | +### [Node.js](http://nodejs.org/): | ||
| 12 | + | ||
| 13 | +~~~ | ||
| 14 | +npm install md5 | ||
| 15 | +~~~ | ||
| 16 | + | ||
| 17 | + | ||
| 18 | +## API | ||
| 19 | + | ||
| 20 | +~~~ javascript | ||
| 21 | +md5(message) | ||
| 22 | +~~~ | ||
| 23 | + | ||
| 24 | + * `message` -- `String` or `Buffer` | ||
| 25 | + * returns `String` | ||
| 26 | + | ||
| 27 | + | ||
| 28 | +## Usage | ||
| 29 | + | ||
| 30 | +~~~ javascript | ||
| 31 | +var md5 = require('md5'); | ||
| 32 | + | ||
| 33 | +console.log(md5('message')); | ||
| 34 | +~~~ | ||
| 35 | + | ||
| 36 | +This will print the following | ||
| 37 | + | ||
| 38 | +~~~ | ||
| 39 | +78e731027d8fd50ed642340b7c9a63b3 | ||
| 40 | +~~~ | ||
| 41 | + | ||
| 42 | +It supports buffers, too | ||
| 43 | + | ||
| 44 | +~~~ javascript | ||
| 45 | +var fs = require('fs'); | ||
| 46 | +var md5 = require('md5'); | ||
| 47 | + | ||
| 48 | +fs.readFile('example.txt', function(err, buf) { | ||
| 49 | + console.log(md5(buf)); | ||
| 50 | +}); | ||
| 51 | +~~~ | ||
| 52 | + | ||
| 53 | +## Versions | ||
| 54 | + | ||
| 55 | +Before version 2.0.0 there were two packages called md5 on npm, one lowercase, | ||
| 56 | +one uppercase (the one you're looking at). As of version 2.0.0, all new versions | ||
| 57 | +of this module will go to lowercase [md5](https://www.npmjs.com/package/md5) on | ||
| 58 | +npm. To use the correct version, users of this module will have to change their | ||
| 59 | +code from `require('MD5')` to `require('md5')` if they want to use versions >= | ||
| 60 | +2.0.0. | ||
| 61 | + | ||
| 62 | + | ||
| 63 | +## Bugs and Issues | ||
| 64 | + | ||
| 65 | +If you encounter any bugs or issues, feel free to open an issue at | ||
| 66 | +[github](https://github.com/pvorb/node-md5/issues). | ||
| 67 | + | ||
| 68 | + | ||
| 69 | +## Credits | ||
| 70 | + | ||
| 71 | +This package is based on the work of Jeff Mott, who did a pure JS implementation | ||
| 72 | +of the MD5 algorithm that was published by Ronald L. Rivest in 1991. I needed a | ||
| 73 | +npm package of the algorithm, so I used Jeff’s implementation for this package. | ||
| 74 | +The original implementation can be found in the | ||
| 75 | +[CryptoJS](http://code.google.com/p/crypto-js/) project. | ||
| 76 | + | ||
| 77 | + | ||
| 78 | +## License | ||
| 79 | + | ||
| 80 | +~~~ | ||
| 81 | +Copyright © 2011-2015, Paul Vorbach. | ||
| 82 | +Copyright © 2009, Jeff Mott. | ||
| 83 | + | ||
| 84 | +All rights reserved. | ||
| 85 | + | ||
| 86 | +Redistribution and use in source and binary forms, with or without modification, | ||
| 87 | +are permitted provided that the following conditions are met: | ||
| 88 | + | ||
| 89 | +* Redistributions of source code must retain the above copyright notice, this | ||
| 90 | + list of conditions and the following disclaimer. | ||
| 91 | +* Redistributions in binary form must reproduce the above copyright notice, this | ||
| 92 | + list of conditions and the following disclaimer in the documentation and/or | ||
| 93 | + other materials provided with the distribution. | ||
| 94 | +* Neither the name Crypto-JS nor the names of its contributors may be used to | ||
| 95 | + endorse or promote products derived from this software without specific prior | ||
| 96 | + written permission. | ||
| 97 | + | ||
| 98 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
| 99 | +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| 100 | +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| 101 | +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
| 102 | +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| 103 | +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 104 | +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
| 105 | +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 106 | +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| 107 | +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 108 | +~~~ |
node_modules/md5/md5.js
0 → 100644
| 1 | +(function(){ | ||
| 2 | + var crypt = require('crypt'), | ||
| 3 | + utf8 = require('charenc').utf8, | ||
| 4 | + isBuffer = require('is-buffer'), | ||
| 5 | + bin = require('charenc').bin, | ||
| 6 | + | ||
| 7 | + // The core | ||
| 8 | + md5 = function (message, options) { | ||
| 9 | + // Convert to byte array | ||
| 10 | + if (message.constructor == String) | ||
| 11 | + if (options && options.encoding === 'binary') | ||
| 12 | + message = bin.stringToBytes(message); | ||
| 13 | + else | ||
| 14 | + message = utf8.stringToBytes(message); | ||
| 15 | + else if (isBuffer(message)) | ||
| 16 | + message = Array.prototype.slice.call(message, 0); | ||
| 17 | + else if (!Array.isArray(message)) | ||
| 18 | + message = message.toString(); | ||
| 19 | + // else, assume byte array already | ||
| 20 | + | ||
| 21 | + var m = crypt.bytesToWords(message), | ||
| 22 | + l = message.length * 8, | ||
| 23 | + a = 1732584193, | ||
| 24 | + b = -271733879, | ||
| 25 | + c = -1732584194, | ||
| 26 | + d = 271733878; | ||
| 27 | + | ||
| 28 | + // Swap endian | ||
| 29 | + for (var i = 0; i < m.length; i++) { | ||
| 30 | + m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF | | ||
| 31 | + ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + // Padding | ||
| 35 | + m[l >>> 5] |= 0x80 << (l % 32); | ||
| 36 | + m[(((l + 64) >>> 9) << 4) + 14] = l; | ||
| 37 | + | ||
| 38 | + // Method shortcuts | ||
| 39 | + var FF = md5._ff, | ||
| 40 | + GG = md5._gg, | ||
| 41 | + HH = md5._hh, | ||
| 42 | + II = md5._ii; | ||
| 43 | + | ||
| 44 | + for (var i = 0; i < m.length; i += 16) { | ||
| 45 | + | ||
| 46 | + var aa = a, | ||
| 47 | + bb = b, | ||
| 48 | + cc = c, | ||
| 49 | + dd = d; | ||
| 50 | + | ||
| 51 | + a = FF(a, b, c, d, m[i+ 0], 7, -680876936); | ||
| 52 | + d = FF(d, a, b, c, m[i+ 1], 12, -389564586); | ||
| 53 | + c = FF(c, d, a, b, m[i+ 2], 17, 606105819); | ||
| 54 | + b = FF(b, c, d, a, m[i+ 3], 22, -1044525330); | ||
| 55 | + a = FF(a, b, c, d, m[i+ 4], 7, -176418897); | ||
| 56 | + d = FF(d, a, b, c, m[i+ 5], 12, 1200080426); | ||
| 57 | + c = FF(c, d, a, b, m[i+ 6], 17, -1473231341); | ||
| 58 | + b = FF(b, c, d, a, m[i+ 7], 22, -45705983); | ||
| 59 | + a = FF(a, b, c, d, m[i+ 8], 7, 1770035416); | ||
| 60 | + d = FF(d, a, b, c, m[i+ 9], 12, -1958414417); | ||
| 61 | + c = FF(c, d, a, b, m[i+10], 17, -42063); | ||
| 62 | + b = FF(b, c, d, a, m[i+11], 22, -1990404162); | ||
| 63 | + a = FF(a, b, c, d, m[i+12], 7, 1804603682); | ||
| 64 | + d = FF(d, a, b, c, m[i+13], 12, -40341101); | ||
| 65 | + c = FF(c, d, a, b, m[i+14], 17, -1502002290); | ||
| 66 | + b = FF(b, c, d, a, m[i+15], 22, 1236535329); | ||
| 67 | + | ||
| 68 | + a = GG(a, b, c, d, m[i+ 1], 5, -165796510); | ||
| 69 | + d = GG(d, a, b, c, m[i+ 6], 9, -1069501632); | ||
| 70 | + c = GG(c, d, a, b, m[i+11], 14, 643717713); | ||
| 71 | + b = GG(b, c, d, a, m[i+ 0], 20, -373897302); | ||
| 72 | + a = GG(a, b, c, d, m[i+ 5], 5, -701558691); | ||
| 73 | + d = GG(d, a, b, c, m[i+10], 9, 38016083); | ||
| 74 | + c = GG(c, d, a, b, m[i+15], 14, -660478335); | ||
| 75 | + b = GG(b, c, d, a, m[i+ 4], 20, -405537848); | ||
| 76 | + a = GG(a, b, c, d, m[i+ 9], 5, 568446438); | ||
| 77 | + d = GG(d, a, b, c, m[i+14], 9, -1019803690); | ||
| 78 | + c = GG(c, d, a, b, m[i+ 3], 14, -187363961); | ||
| 79 | + b = GG(b, c, d, a, m[i+ 8], 20, 1163531501); | ||
| 80 | + a = GG(a, b, c, d, m[i+13], 5, -1444681467); | ||
| 81 | + d = GG(d, a, b, c, m[i+ 2], 9, -51403784); | ||
| 82 | + c = GG(c, d, a, b, m[i+ 7], 14, 1735328473); | ||
| 83 | + b = GG(b, c, d, a, m[i+12], 20, -1926607734); | ||
| 84 | + | ||
| 85 | + a = HH(a, b, c, d, m[i+ 5], 4, -378558); | ||
| 86 | + d = HH(d, a, b, c, m[i+ 8], 11, -2022574463); | ||
| 87 | + c = HH(c, d, a, b, m[i+11], 16, 1839030562); | ||
| 88 | + b = HH(b, c, d, a, m[i+14], 23, -35309556); | ||
| 89 | + a = HH(a, b, c, d, m[i+ 1], 4, -1530992060); | ||
| 90 | + d = HH(d, a, b, c, m[i+ 4], 11, 1272893353); | ||
| 91 | + c = HH(c, d, a, b, m[i+ 7], 16, -155497632); | ||
| 92 | + b = HH(b, c, d, a, m[i+10], 23, -1094730640); | ||
| 93 | + a = HH(a, b, c, d, m[i+13], 4, 681279174); | ||
| 94 | + d = HH(d, a, b, c, m[i+ 0], 11, -358537222); | ||
| 95 | + c = HH(c, d, a, b, m[i+ 3], 16, -722521979); | ||
| 96 | + b = HH(b, c, d, a, m[i+ 6], 23, 76029189); | ||
| 97 | + a = HH(a, b, c, d, m[i+ 9], 4, -640364487); | ||
| 98 | + d = HH(d, a, b, c, m[i+12], 11, -421815835); | ||
| 99 | + c = HH(c, d, a, b, m[i+15], 16, 530742520); | ||
| 100 | + b = HH(b, c, d, a, m[i+ 2], 23, -995338651); | ||
| 101 | + | ||
| 102 | + a = II(a, b, c, d, m[i+ 0], 6, -198630844); | ||
| 103 | + d = II(d, a, b, c, m[i+ 7], 10, 1126891415); | ||
| 104 | + c = II(c, d, a, b, m[i+14], 15, -1416354905); | ||
| 105 | + b = II(b, c, d, a, m[i+ 5], 21, -57434055); | ||
| 106 | + a = II(a, b, c, d, m[i+12], 6, 1700485571); | ||
| 107 | + d = II(d, a, b, c, m[i+ 3], 10, -1894986606); | ||
| 108 | + c = II(c, d, a, b, m[i+10], 15, -1051523); | ||
| 109 | + b = II(b, c, d, a, m[i+ 1], 21, -2054922799); | ||
| 110 | + a = II(a, b, c, d, m[i+ 8], 6, 1873313359); | ||
| 111 | + d = II(d, a, b, c, m[i+15], 10, -30611744); | ||
| 112 | + c = II(c, d, a, b, m[i+ 6], 15, -1560198380); | ||
| 113 | + b = II(b, c, d, a, m[i+13], 21, 1309151649); | ||
| 114 | + a = II(a, b, c, d, m[i+ 4], 6, -145523070); | ||
| 115 | + d = II(d, a, b, c, m[i+11], 10, -1120210379); | ||
| 116 | + c = II(c, d, a, b, m[i+ 2], 15, 718787259); | ||
| 117 | + b = II(b, c, d, a, m[i+ 9], 21, -343485551); | ||
| 118 | + | ||
| 119 | + a = (a + aa) >>> 0; | ||
| 120 | + b = (b + bb) >>> 0; | ||
| 121 | + c = (c + cc) >>> 0; | ||
| 122 | + d = (d + dd) >>> 0; | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + return crypt.endian([a, b, c, d]); | ||
| 126 | + }; | ||
| 127 | + | ||
| 128 | + // Auxiliary functions | ||
| 129 | + md5._ff = function (a, b, c, d, x, s, t) { | ||
| 130 | + var n = a + (b & c | ~b & d) + (x >>> 0) + t; | ||
| 131 | + return ((n << s) | (n >>> (32 - s))) + b; | ||
| 132 | + }; | ||
| 133 | + md5._gg = function (a, b, c, d, x, s, t) { | ||
| 134 | + var n = a + (b & d | c & ~d) + (x >>> 0) + t; | ||
| 135 | + return ((n << s) | (n >>> (32 - s))) + b; | ||
| 136 | + }; | ||
| 137 | + md5._hh = function (a, b, c, d, x, s, t) { | ||
| 138 | + var n = a + (b ^ c ^ d) + (x >>> 0) + t; | ||
| 139 | + return ((n << s) | (n >>> (32 - s))) + b; | ||
| 140 | + }; | ||
| 141 | + md5._ii = function (a, b, c, d, x, s, t) { | ||
| 142 | + var n = a + (c ^ (b | ~d)) + (x >>> 0) + t; | ||
| 143 | + return ((n << s) | (n >>> (32 - s))) + b; | ||
| 144 | + }; | ||
| 145 | + | ||
| 146 | + // Package private blocksize | ||
| 147 | + md5._blocksize = 16; | ||
| 148 | + md5._digestsize = 16; | ||
| 149 | + | ||
| 150 | + module.exports = function (message, options) { | ||
| 151 | + if (message === undefined || message === null) | ||
| 152 | + throw new Error('Illegal argument ' + message); | ||
| 153 | + | ||
| 154 | + var digestbytes = crypt.wordsToBytes(md5(message, options)); | ||
| 155 | + return options && options.asBytes ? digestbytes : | ||
| 156 | + options && options.asString ? bin.bytesToString(digestbytes) : | ||
| 157 | + crypt.bytesToHex(digestbytes); | ||
| 158 | + }; | ||
| 159 | + | ||
| 160 | +})(); |
node_modules/md5/package.json
0 → 100644
| 1 | +{ | ||
| 2 | + "_args": [ | ||
| 3 | + [ | ||
| 4 | + "md5", | ||
| 5 | + "D:\\work\\McuClient" | ||
| 6 | + ] | ||
| 7 | + ], | ||
| 8 | + "_from": "md5@latest", | ||
| 9 | + "_id": "md5@2.2.1", | ||
| 10 | + "_inCache": true, | ||
| 11 | + "_installable": true, | ||
| 12 | + "_location": "/md5", | ||
| 13 | + "_nodeVersion": "4.4.5", | ||
| 14 | + "_npmOperationalInternal": { | ||
| 15 | + "host": "packages-16-east.internal.npmjs.com", | ||
| 16 | + "tmp": "tmp/md5-2.2.1.tgz_1472679629604_0.48944878415204585" | ||
| 17 | + }, | ||
| 18 | + "_npmUser": { | ||
| 19 | + "email": "paul@vorba.ch", | ||
| 20 | + "name": "pvorb" | ||
| 21 | + }, | ||
| 22 | + "_npmVersion": "3.9.3", | ||
| 23 | + "_phantomChildren": {}, | ||
| 24 | + "_requested": { | ||
| 25 | + "name": "md5", | ||
| 26 | + "raw": "md5", | ||
| 27 | + "rawSpec": "", | ||
| 28 | + "scope": null, | ||
| 29 | + "spec": "latest", | ||
| 30 | + "type": "tag" | ||
| 31 | + }, | ||
| 32 | + "_requiredBy": [ | ||
| 33 | + "#USER" | ||
| 34 | + ], | ||
| 35 | + "_resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", | ||
| 36 | + "_shasum": "53ab38d5fe3c8891ba465329ea23fac0540126f9", | ||
| 37 | + "_shrinkwrap": null, | ||
| 38 | + "_spec": "md5", | ||
| 39 | + "_where": "D:\\work\\McuClient", | ||
| 40 | + "author": { | ||
| 41 | + "email": "paul@vorba.ch", | ||
| 42 | + "name": "Paul Vorbach", | ||
| 43 | + "url": "http://paul.vorba.ch" | ||
| 44 | + }, | ||
| 45 | + "bugs": { | ||
| 46 | + "url": "https://github.com/pvorb/node-md5/issues" | ||
| 47 | + }, | ||
| 48 | + "contributors": [ | ||
| 49 | + { | ||
| 50 | + "name": "salba" | ||
| 51 | + } | ||
| 52 | + ], | ||
| 53 | + "dependencies": { | ||
| 54 | + "charenc": "~0.0.1", | ||
| 55 | + "crypt": "~0.0.1", | ||
| 56 | + "is-buffer": "~1.1.1" | ||
| 57 | + }, | ||
| 58 | + "description": "js function for hashing messages with MD5", | ||
| 59 | + "devDependencies": { | ||
| 60 | + "mocha": "~2.3.4" | ||
| 61 | + }, | ||
| 62 | + "directories": {}, | ||
| 63 | + "dist": { | ||
| 64 | + "shasum": "53ab38d5fe3c8891ba465329ea23fac0540126f9", | ||
| 65 | + "tarball": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz" | ||
| 66 | + }, | ||
| 67 | + "gitHead": "5536a25dbe856b25d9963fd47da5eb4e1bca4250", | ||
| 68 | + "homepage": "https://github.com/pvorb/node-md5#readme", | ||
| 69 | + "license": "BSD-3-Clause", | ||
| 70 | + "main": "md5.js", | ||
| 71 | + "maintainers": [ | ||
| 72 | + { | ||
| 73 | + "email": "coolaj86@gmail.com", | ||
| 74 | + "name": "coolaj86" | ||
| 75 | + }, | ||
| 76 | + { | ||
| 77 | + "email": "paul@vorba.ch", | ||
| 78 | + "name": "pvorb" | ||
| 79 | + } | ||
| 80 | + ], | ||
| 81 | + "name": "md5", | ||
| 82 | + "optionalDependencies": {}, | ||
| 83 | + "readme": "ERROR: No README data found!", | ||
| 84 | + "repository": { | ||
| 85 | + "type": "git", | ||
| 86 | + "url": "git://github.com/pvorb/node-md5.git" | ||
| 87 | + }, | ||
| 88 | + "scripts": { | ||
| 89 | + "test": "mocha" | ||
| 90 | + }, | ||
| 91 | + "tags": [ | ||
| 92 | + "md5", | ||
| 93 | + "hash", | ||
| 94 | + "encryption", | ||
| 95 | + "message digest" | ||
| 96 | + ], | ||
| 97 | + "version": "2.2.1" | ||
| 98 | +} |
node_modules/md5/test.js
0 → 100644
| 1 | +var md5 = require('./md5.js'); | ||
| 2 | +var assert = require('assert'); | ||
| 3 | + | ||
| 4 | +describe('md5', function () { | ||
| 5 | + | ||
| 6 | + it('should throw an error for `undefined`', function() { | ||
| 7 | + assert.throws(function() { | ||
| 8 | + md5(undefined); | ||
| 9 | + }); | ||
| 10 | + }); | ||
| 11 | + | ||
| 12 | + it('should throw an error for `null`', function() { | ||
| 13 | + assert.throws(function() { | ||
| 14 | + md5(null); | ||
| 15 | + }); | ||
| 16 | + }); | ||
| 17 | + | ||
| 18 | + it('should return the expected MD5 hash for "message"', function() { | ||
| 19 | + assert.equal('78e731027d8fd50ed642340b7c9a63b3', md5('message')); | ||
| 20 | + }); | ||
| 21 | + | ||
| 22 | + it('should not return the same hash for random numbers twice', function() { | ||
| 23 | + var msg1 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime(); | ||
| 24 | + var msg2 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime(); | ||
| 25 | + | ||
| 26 | + if (msg1 !== msg2) { | ||
| 27 | + assert.notEqual(md5(msg1), md5(msg2)); | ||
| 28 | + } else { | ||
| 29 | + assert.equal(md5(msg1), md5(msg1)); | ||
| 30 | + } | ||
| 31 | + }); | ||
| 32 | + | ||
| 33 | + it('should support Node.js Buffers', function() { | ||
| 34 | + var buffer = new Buffer('message áßäöü', 'utf8'); | ||
| 35 | + | ||
| 36 | + assert.equal(md5(buffer), md5('message áßäöü')); | ||
| 37 | + }) | ||
| 38 | + | ||
| 39 | + it('should be able to use a binary encoded string', function() { | ||
| 40 | + var hash1 = md5('abc', { asString: true }); | ||
| 41 | + var hash2 = md5(hash1 + 'a', { asString: true, encoding : 'binary' }); | ||
| 42 | + var hash3 = md5(hash1 + 'a', { encoding : 'binary' }); | ||
| 43 | + assert.equal(hash3, '131f0ac52813044f5110e4aec638c169'); | ||
| 44 | + }); | ||
| 45 | +}); |
| @@ -5,100 +5,177 @@ import MessageTypes from 'MessageTypes'; | @@ -5,100 +5,177 @@ import MessageTypes from 'MessageTypes'; | ||
| 5 | import Loger from 'Loger'; | 5 | import Loger from 'Loger'; |
| 6 | import ConferApe from 'apes/ConferApe'; | 6 | import ConferApe from 'apes/ConferApe'; |
| 7 | import ChatApe from 'apes/ChatApe'; | 7 | import ChatApe from 'apes/ChatApe'; |
| 8 | -import VideoChat from 'apes/VideoApe'; | 8 | +import VideoApe from 'apes/VideoApe'; |
| 9 | import DocApe from 'apes/DocApe'; | 9 | import DocApe from 'apes/DocApe'; |
| 10 | import WhiteBoardApe from 'apes/WhiteBoardApe'; | 10 | import WhiteBoardApe from 'apes/WhiteBoardApe'; |
| 11 | import EngineUtils from "EngineUtils"; | 11 | import EngineUtils from "EngineUtils"; |
| 12 | +import GlobalConfig from 'GlobalConfig'; | ||
| 12 | 13 | ||
| 13 | let loger = Loger.getLoger('MessageEntrance'); | 14 | let loger = Loger.getLoger('MessageEntrance'); |
| 15 | +let _sdkInfo={"version":"v1.0.0","author":"www.3mang.com"}; | ||
| 16 | +let _confInfo={};//存储入会数据 | ||
| 14 | 17 | ||
| 15 | -let info={"version":"v1.0.0","author":"3mang"}; | ||
| 16 | - | ||
| 17 | -let confInfo={}; | ||
| 18 | -let sass; | ||
| 19 | -let mcu ; | ||
| 20 | -let confer_ape; | ||
| 21 | -let chat_ape; | ||
| 22 | -let video_ape; | ||
| 23 | -let doc_ape; | ||
| 24 | -let wb_ape; | 18 | +let _sass; |
| 19 | +let _mcu ; | ||
| 20 | +let _confer_ape; | ||
| 21 | +let _chat_ape; | ||
| 22 | +let _video_ape; | ||
| 23 | +let _doc_ape; | ||
| 24 | +let _wb_ape; | ||
| 25 | 25 | ||
| 26 | export default class MessageEntrance extends Emiter { | 26 | export default class MessageEntrance extends Emiter { |
| 27 | constructor() { | 27 | constructor() { |
| 28 | super(); | 28 | super(); |
| 29 | - | ||
| 30 | - this.info=info; | ||
| 31 | - | ||
| 32 | - // 应用层会议信息 | ||
| 33 | - confInfo = {}; | ||
| 34 | - | 29 | + //sdk 信息 |
| 30 | + this.sdkInfo=_sdkInfo; | ||
| 31 | + loger.log(this.sdkInfo); | ||
| 35 | // Sass平台层 | 32 | // Sass平台层 |
| 36 | - sass = Sass; | ||
| 37 | - sass.on('*', (type, data) => this._emit(type, data)); | ||
| 38 | - sass.on(sass.SUCCESS, this._h5SassSuccessHandler.bind(this)); | 33 | + _sass = Sass; |
| 34 | + _sass.on('*', (type, data) => this._emit(type, data)); | ||
| 35 | + _sass.on(_sass.SUCCESS, this._h5SassSuccessHandler.bind(this)); | ||
| 36 | + _sass.on(_sass.CLASS_INIT_SUCCESS, this._h5SassInitSuccessHandler.bind(this)); | ||
| 37 | + _sass.on(_sass.CLASS_INIT_FAILED, this._h5SassInitFailedHandler.bind(this)); | ||
| 38 | + _sass.on(_sass.CLASS_GET_MEETING_PARAM,this._h5SassGetMeetingParaSuccessHandler); | ||
| 39 | 39 | ||
| 40 | // 底层MCU消息层 | 40 | // 底层MCU消息层 |
| 41 | - mcu = Mcu; | ||
| 42 | - mcu.on('*', (type, data) => this._emit(type, data)); | ||
| 43 | - mcu.on(MessageTypes.CONFERENCE_JOIN_SUCCESS, this._conferenceJoinSuccessHandler.bind(this)); | 41 | + _mcu = Mcu; |
| 42 | + _mcu.on('*', (type, data) => this._emit(type, data)); | ||
| 43 | + _mcu.on(MessageTypes.CLASS_JOIN_SUCCESS, this._conferenceJoinSuccessHandler.bind(this)); | ||
| 44 | 44 | ||
| 45 | // 注册所有应用Ape | 45 | // 注册所有应用Ape |
| 46 | - confer_ape = new ConferApe(); | ||
| 47 | - confer_ape.on('*', (type, data) => this._emit(type, data)); | ||
| 48 | - confer_ape.on(MessageTypes.DOC_SWITCH, this.docSwitchHandler.bind(this)); | 46 | + _confer_ape = new ConferApe(); |
| 47 | + _confer_ape.on('*', (type, data) => this._emit(type, data)); | ||
| 48 | + _confer_ape.on(MessageTypes.DOC_SWITCH, this.docSwitchHandler.bind(this)); | ||
| 49 | 49 | ||
| 50 | - chat_ape = new ChatApe(); | ||
| 51 | - chat_ape.on('*', (type, data) => this._emit(type, data)); | 50 | + _chat_ape = new ChatApe(); |
| 51 | + _chat_ape.on('*', (type, data) => this._emit(type, data)); | ||
| 52 | 52 | ||
| 53 | - video_ape = new VideoChat(); | ||
| 54 | - video_ape.on('*', (type, data) => this._emit(type, data)); | 53 | + _video_ape = new VideoApe(); |
| 54 | + _video_ape.on('*', (type, data) => this._emit(type, data)); | ||
| 55 | 55 | ||
| 56 | - doc_ape = new DocApe(); | ||
| 57 | - doc_ape.on('*', (type, data) => this._emit(type, data)); | ||
| 58 | - doc_ape.on(MessageTypes.DOC_UPDATE, this.docUpdateHandler.bind(this)); | 56 | + _doc_ape = new DocApe(); |
| 57 | + _doc_ape.on('*', (type, data) => this._emit(type, data)); | ||
| 58 | + _doc_ape.on(MessageTypes.DOC_UPDATE, this.docUpdateHandler.bind(this)); | ||
| 59 | 59 | ||
| 60 | - doc_ape.on(MessageTypes.DOC_DEL, this.docDeleteHandler.bind(this)); | 60 | + _doc_ape.on(MessageTypes.DOC_DEL, this.docDeleteHandler.bind(this)); |
| 61 | 61 | ||
| 62 | - wb_ape = new WhiteBoardApe(); | ||
| 63 | - wb_ape.on('*', (type, data) => this._emit(type, data)); | ||
| 64 | - wb_ape.on(MessageTypes.ANNO_UPDATE, this.annoUpdateHandler.bind(this)); | 62 | + _wb_ape = new WhiteBoardApe(); |
| 63 | + _wb_ape.on('*', (type, data) => this._emit(type, data)); | ||
| 64 | + _wb_ape.on(MessageTypes.ANNO_UPDATE, this.annoUpdateHandler.bind(this)); | ||
| 65 | this.on(MessageTypes.DOC_SHOW, this.docShowHandler.bind(this)); | 65 | this.on(MessageTypes.DOC_SHOW, this.docShowHandler.bind(this)); |
| 66 | 66 | ||
| 67 | - this.sendChatMsg=this._sendChatMsg; | 67 | + //公开外部调用的方法 |
| 68 | + this.init=this._init; | ||
| 68 | this.joinClass=this._joinClass; | 69 | this.joinClass=this._joinClass; |
| 70 | + this.sendChatMsg=this._sendChatMsg; | ||
| 71 | + this.setDebugData=this._setDebugData; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + //初始化,根据课堂号和角色类型获取登录验证时需要的基本信息 | ||
| 75 | + _init(_param) { | ||
| 76 | + //{"meetingNumber":"1653304953","portal":"112.126.80.182:80","userRole":"normal","userId":0} | ||
| 77 | + //判断传入的参数是否存在 | ||
| 78 | + if(_param===null||EngineUtils.isEmptyObject(_param)){ | ||
| 79 | + loger.log('init初始化失败',MessageTypes.ERROR_PARAM); | ||
| 80 | + this._emit(MessageTypes.CLASS_INIT_FAILED,MessageTypes.ERROR_PARAM); | ||
| 81 | + return ; | ||
| 82 | + } | ||
| 83 | + //判断必要的参数字段值 | ||
| 84 | + if(_param.meetingNumber===null||isNaN(_param.meetingNumber)||_param.portal===null){ | ||
| 85 | + this._emit(MessageTypes.CLASS_INIT_FAILED,MessageTypes.ERROR_PARAM); | ||
| 86 | + return ; | ||
| 87 | + } | ||
| 88 | + loger.log('_init',_param); | ||
| 89 | + //保存参数 | ||
| 90 | + GlobalConfig.confId=_param.meetingNumber; | ||
| 91 | + GlobalConfig.portal=_param.portal; | ||
| 92 | + GlobalConfig.userRole=_param.userRole||"normal"; | ||
| 93 | + GlobalConfig.userId=_param.userId||"0"; | ||
| 94 | + | ||
| 95 | + //获取课堂校验信息 | ||
| 96 | + if(_sass){ | ||
| 97 | + //_sass.sassGetJoinParams(_param); | ||
| 98 | + _sass.sassGetJoinParams(GlobalConfig.getConfInfo()); | ||
| 99 | + } | ||
| 69 | } | 100 | } |
| 70 | 101 | ||
| 71 | // 进入会议 | 102 | // 进入会议 |
| 72 | - _joinClass(_confInfo) { | ||
| 73 | - confInfo = _confInfo||{}; | ||
| 74 | - if(confInfo===null||EngineUtils.isEmptyObject(confInfo)){ | ||
| 75 | - loger.log('不能进入会议,传递的参数不对.',_confInfo); | 103 | + _joinClass(_param) { |
| 104 | + //{"userName":"名字","password":""} | ||
| 105 | + if(_param===null||EngineUtils.isEmptyObject(_param)){ | ||
| 106 | + this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERROR_PARAM); | ||
| 107 | + loger.log('不能进入会议,传递的参数不对.',_param); | ||
| 76 | return ; | 108 | return ; |
| 77 | } | 109 | } |
| 78 | - if(sass){ | ||
| 79 | - sass.sassChecking(_confInfo); | 110 | + //判断userName |
| 111 | + if(_param.userName===null){ | ||
| 112 | + loger.log('不能进入会议,传递的参数不对.名字不能为空'); | ||
| 113 | + this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERROR_PARAM); | ||
| 114 | + return ; | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + GlobalConfig.userName=_param.userName; | ||
| 118 | + GlobalConfig.password=_param.password||""; | ||
| 119 | + | ||
| 120 | + //开始校验 | ||
| 121 | + if(_sass){ | ||
| 122 | + // _sass.sassChecking(_confInfo); | ||
| 123 | + _sass.sassChecking(GlobalConfig.getConfInfo()); | ||
| 80 | } | 124 | } |
| 81 | } | 125 | } |
| 82 | 126 | ||
| 83 | // 离开会议 | 127 | // 离开会议 |
| 84 | leaveClass() { | 128 | leaveClass() { |
| 85 | - if(mcu){ | ||
| 86 | - mcu.leaveMCU(); | 129 | + if(_mcu){ |
| 130 | + _mcu.leaveMCU(); | ||
| 131 | + } | ||
| 132 | + } | ||
| 133 | + // 用meetingNumber向SASS平台获取入会验证信息成功 | ||
| 134 | + _h5SassInitSuccessHandler(_data) { | ||
| 135 | + //{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1} | ||
| 136 | + if(_data){ | ||
| 137 | + GlobalConfig.md5=_data.md5||"";//这个暂时用假数据,后台接口写完就有数据了 | ||
| 138 | + GlobalConfig.msType=_data.msType||1; | ||
| 139 | + GlobalConfig.nopassword=_data.passwordRequired||false; | ||
| 140 | + GlobalConfig.siteId=_data.siteId; | ||
| 87 | } | 141 | } |
| 142 | + loger.log('向SASS平台获取入会验证信息成功.'); | ||
| 143 | + this._emit(MessageTypes.CLASS_INIT_SUCCESS,_data); | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + // 用meetingNumber向SASS平台获取入会验证信息失败 | ||
| 147 | + _h5SassInitFailedHandler() { | ||
| 148 | + loger.log('向SASS平台获取入会验证信息失败.'); | ||
| 149 | + this._emit(MessageTypes.CLASS_INIT_FAILED); | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + //使用固定的假数据 | ||
| 153 | + _setDebugData(_data){ | ||
| 154 | + loger.log("setDebugData "+_data); | ||
| 155 | + GlobalConfig.setDebugData(_data); | ||
| 88 | } | 156 | } |
| 157 | + | ||
| 89 | // 通过SASS平台验证 | 158 | // 通过SASS平台验证 |
| 90 | - _h5SassSuccessHandler() { | ||
| 91 | - loger.log('加入底层MCU会议.'+confInfo.toString()); | ||
| 92 | - if(mcu){ | ||
| 93 | - mcu.joinMCU(confInfo); | 159 | + _h5SassSuccessHandler(_data) { |
| 160 | + loger.log('加入底层MCU会议.'); | ||
| 161 | + if(_mcu){ | ||
| 162 | + //_mcu.joinMCU(_confInfo); | ||
| 163 | + _mcu.joinMCU(GlobalConfig.getConfInfo()); | ||
| 164 | + } | ||
| 94 | } | 165 | } |
| 166 | + //获取会议所有参数 | ||
| 167 | + _h5SassGetMeetingParaSuccessHandler(_data){ | ||
| 168 | + loger.log('获取getMeetingParam完成.'); | ||
| 169 | + GlobalConfig.meetingParam=_data; | ||
| 170 | + loger.log(_data); | ||
| 95 | } | 171 | } |
| 96 | 172 | ||
| 97 | // MCU 会议成功 | 173 | // MCU 会议成功 |
| 98 | _conferenceJoinSuccessHandler() { | 174 | _conferenceJoinSuccessHandler() { |
| 99 | - if(sass){ | ||
| 100 | - sass.getClassDetail();//会议信息 | ||
| 101 | - sass.getMeetingParm();//会议参数大全 | 175 | + loger.log('MCU 会议成功.'); |
| 176 | + if(_sass){ | ||
| 177 | + _sass.getClassDetail();//会议信息 | ||
| 178 | + _sass.getMeetingParam();//会议参数大全 | ||
| 102 | } | 179 | } |
| 103 | } | 180 | } |
| 104 | // 参会处理 | 181 | // 参会处理 |
| @@ -109,27 +186,22 @@ export default class MessageEntrance extends Emiter { | @@ -109,27 +186,22 @@ export default class MessageEntrance extends Emiter { | ||
| 109 | }; | 186 | }; |
| 110 | this._emit(msg.type, msg); | 187 | this._emit(msg.type, msg); |
| 111 | } | 188 | } |
| 189 | + | ||
| 112 | // 发送聊天消息 | 190 | // 发送聊天消息 |
| 113 | - /* _sendChatMsg(to, msg) { | ||
| 114 | - if (chat_ape) { | ||
| 115 | - chat_ape.sendChatMsg(to, msg); | ||
| 116 | - } | ||
| 117 | - }*/ | ||
| 118 | _sendChatMsg(_messageInfo) { | 191 | _sendChatMsg(_messageInfo) { |
| 119 | if(_messageInfo===null||EngineUtils.isEmptyObject(_messageInfo)){ | 192 | if(_messageInfo===null||EngineUtils.isEmptyObject(_messageInfo)){ |
| 120 | loger.log('sendChatMsg 传递的参数不对',_messageInfo); | 193 | loger.log('sendChatMsg 传递的参数不对',_messageInfo); |
| 121 | return ; | 194 | return ; |
| 122 | } | 195 | } |
| 123 | - | ||
| 124 | - if (chat_ape) { | ||
| 125 | - chat_ape.sendChatMsg(_messageInfo); | 196 | + if (_chat_ape) { |
| 197 | + _chat_ape.sendChatMsg(_messageInfo); | ||
| 126 | } | 198 | } |
| 127 | } | 199 | } |
| 128 | 200 | ||
| 129 | // 白板笔记更新 | 201 | // 白板笔记更新 |
| 130 | annoUpdateHandler(annoInfo) { | 202 | annoUpdateHandler(annoInfo) { |
| 131 | - const activeDocId = confer_ape.activeDocId; | ||
| 132 | - const docItem = doc_ape.docList[activeDocId]; | 203 | + const activeDocId = _confer_ape.activeDocId; |
| 204 | + const docItem = _doc_ape.docList[activeDocId]; | ||
| 133 | if (docItem && annoInfo.id == docItem.wbid) { | 205 | if (docItem && annoInfo.id == docItem.wbid) { |
| 134 | this._emit(MessageTypes.DOC_ANNO, annoInfo); | 206 | this._emit(MessageTypes.DOC_ANNO, annoInfo); |
| 135 | } | 207 | } |
| @@ -138,22 +210,20 @@ export default class MessageEntrance extends Emiter { | @@ -138,22 +210,20 @@ export default class MessageEntrance extends Emiter { | ||
| 138 | // 文档变更-笔记处理 | 210 | // 文档变更-笔记处理 |
| 139 | docShowHandler(docItem) { | 211 | docShowHandler(docItem) { |
| 140 | loger.log('Doc Show ->' + docItem.id + '|' + docItem.curPageNo); | 212 | loger.log('Doc Show ->' + docItem.id + '|' + docItem.curPageNo); |
| 141 | - | ||
| 142 | - const annoInfo = wb_ape.annoInfos[docItem.wbid]; | 213 | + const annoInfo = _wb_ape.annoInfos[docItem.wbid]; |
| 143 | if (annoInfo) { | 214 | if (annoInfo) { |
| 144 | this._emit(MessageTypes.DOC_ANNO, annoInfo); | 215 | this._emit(MessageTypes.DOC_ANNO, annoInfo); |
| 145 | } else { | 216 | } else { |
| 146 | this._emit(MessageTypes.DOC_ANNO); | 217 | this._emit(MessageTypes.DOC_ANNO); |
| 147 | 218 | ||
| 148 | } | 219 | } |
| 149 | - | ||
| 150 | } | 220 | } |
| 151 | 221 | ||
| 152 | // 文档切换 | 222 | // 文档切换 |
| 153 | docSwitchHandler() { | 223 | docSwitchHandler() { |
| 154 | - const activeDocId = confer_ape.activeDocId; | 224 | + const activeDocId = _confer_ape.activeDocId; |
| 155 | loger.log('Switch Doc Active -> ' + activeDocId); | 225 | loger.log('Switch Doc Active -> ' + activeDocId); |
| 156 | - const docItem = doc_ape.docList[activeDocId]; | 226 | + const docItem = _doc_ape.docList[activeDocId]; |
| 157 | if (docItem) { | 227 | if (docItem) { |
| 158 | this._emit(MessageTypes.DOC_SHOW, docItem); | 228 | this._emit(MessageTypes.DOC_SHOW, docItem); |
| 159 | } | 229 | } |
| @@ -161,17 +231,16 @@ export default class MessageEntrance extends Emiter { | @@ -161,17 +231,16 @@ export default class MessageEntrance extends Emiter { | ||
| 161 | 231 | ||
| 162 | // 文档变更 | 232 | // 文档变更 |
| 163 | docUpdateHandler(docItem) { | 233 | docUpdateHandler(docItem) { |
| 164 | - loger.log('Doc UpdateId ->' + docItem.id + '| activeDocId ->' + confer_ape.activeDocId); | ||
| 165 | - if (docItem.id == confer_ape.activeDocId) { | 234 | + loger.log('Doc UpdateId ->' + docItem.id + '| activeDocId ->' + _confer_ape.activeDocId); |
| 235 | + if (docItem.id == _confer_ape.activeDocId) { | ||
| 166 | this._emit(MessageTypes.DOC_SHOW, docItem); | 236 | this._emit(MessageTypes.DOC_SHOW, docItem); |
| 167 | } | 237 | } |
| 168 | } | 238 | } |
| 169 | 239 | ||
| 170 | //文档删除 | 240 | //文档删除 |
| 171 | docDeleteHandler(docItem){ | 241 | docDeleteHandler(docItem){ |
| 172 | - if (docItem.id == confer_ape.activeDocId) { | 242 | + if (docItem.id == _confer_ape.activeDocId) { |
| 173 | this._emit(MessageTypes.DOC_DEL, docItem); | 243 | this._emit(MessageTypes.DOC_DEL, docItem); |
| 174 | } | 244 | } |
| 175 | } | 245 | } |
| 176 | } | 246 | } |
| 177 | -//MessageEntrance.MessageTypes = MessageTypes; |
| @@ -96,8 +96,11 @@ class EverSocket extends Emiter { | @@ -96,8 +96,11 @@ class EverSocket extends Emiter { | ||
| 96 | 96 | ||
| 97 | _onOpen() { | 97 | _onOpen() { |
| 98 | loger.log('WebSocket建立成功', this.wsURL); | 98 | loger.log('WebSocket建立成功', this.wsURL); |
| 99 | + | ||
| 100 | + //启动心跳,检查socket链接状态 | ||
| 99 | //this.pingTimer = window.setInterval(this._sendPingHandler.bind(this), EverSocket.PING_INTERVAL); | 101 | //this.pingTimer = window.setInterval(this._sendPingHandler.bind(this), EverSocket.PING_INTERVAL); |
| 100 | //this.pongTimer = window.setInterval(this._checkPongHandler.bind(this), EverSocket.PONG_INTERVAL); | 102 | //this.pongTimer = window.setInterval(this._checkPongHandler.bind(this), EverSocket.PONG_INTERVAL); |
| 103 | + | ||
| 101 | this._setConnected(); | 104 | this._setConnected(); |
| 102 | } | 105 | } |
| 103 | 106 |
| 1 | /* | 1 | /* |
| 2 | * 全局数据管理 | 2 | * 全局数据管理 |
| 3 | * */ | 3 | * */ |
| 4 | +import Loger from 'Loger'; | ||
| 5 | +let loger = Loger.getLoger('GlobalConfig'); | ||
| 4 | 6 | ||
| 5 | class GlobalConfig { | 7 | class GlobalConfig { |
| 6 | constructor () { | 8 | constructor () { |
| 7 | - console.log(new.target); | ||
| 8 | } | 9 | } |
| 9 | - | ||
| 10 | - toString () { | ||
| 11 | - return super.toString() + ',' + this.z; | 10 | + static setDebugData (_deBugData){ |
| 11 | + this.isDebug=true; | ||
| 12 | + this.deBugData=_deBugData; | ||
| 12 | } | 13 | } |
| 14 | + static getConfInfo (){ | ||
| 15 | + if(this.isDebug){ | ||
| 16 | + | ||
| 17 | + //这几个属性是sass验证完成之后返回的,启动MCU的时候需要 | ||
| 18 | + this .deBugData.MCUServerIP=this.MCUServerIP; | ||
| 19 | + this .deBugData.MCUServerPort=this.MCUServerPort; | ||
| 20 | + this .deBugData.maxVideoChannels=this.maxVideoChannels; | ||
| 21 | + this .deBugData.maxAudioChannels=this.maxAudioChannels; | ||
| 22 | + this .deBugData.maxMediaChannels=this.maxMediaChannels; | ||
| 13 | 23 | ||
| 14 | - static getConfigInfo() { | ||
| 15 | - console.log('static method'+this.z); | 24 | + return this .deBugData; |
| 25 | + }else { | ||
| 26 | + return{ | ||
| 27 | + "siteId": this.siteId, | ||
| 28 | + "confId": this.confId, | ||
| 29 | + "h5Module": this.h5Module, | ||
| 30 | + "nodeId": this.nodeId, | ||
| 31 | + "topNodeID":this.topNodeID, | ||
| 32 | + "userRole": this.userRole, | ||
| 33 | + "role": this.role, | ||
| 34 | + "isHost": this.isHost, | ||
| 35 | + "classRole": this.classRole, | ||
| 36 | + "userId": this.userId, | ||
| 37 | + "userName": this.userName, | ||
| 38 | + "password": this.password, | ||
| 39 | + "userType": this.userType, | ||
| 40 | + "nopassword": this.nopassword, | ||
| 41 | + "md5": this.md5, | ||
| 42 | + "msType": this.msType, | ||
| 43 | + "portal": this.portal, | ||
| 44 | + "mcuDelay":this.mcuDelay, | ||
| 45 | + "MCUServerIP": this.MCUServerIP, | ||
| 46 | + "MCUServerPort":this.MCUServerPort, | ||
| 47 | + "maxVideoChannels": this.maxVideoChannels, | ||
| 48 | + "maxAudioChannels": this.maxAudioChannels, | ||
| 49 | + "maxMediaChannels": this.maxMediaChannels | ||
| 16 | } | 50 | } |
| 17 | - get z() { | ||
| 18 | - return 4; | ||
| 19 | } | 51 | } |
| 20 | - set z(value) { | ||
| 21 | - console.log(value); | ||
| 22 | } | 52 | } |
| 23 | } | 53 | } |
| 54 | +GlobalConfig.siteId="gust"; | ||
| 55 | +GlobalConfig.confId=1653304953;//课堂号=classId=meetingNumber 之后统一修改为classId | ||
| 56 | +GlobalConfig.nodeId=1483947664;//随机生成 | ||
| 57 | +GlobalConfig.topNodeID=101;//现在固定值,还不知道是做什么用 | ||
| 58 | +GlobalConfig.userRole="normal"; | ||
| 59 | +GlobalConfig.role=1; | ||
| 60 | +GlobalConfig.isHost=false; | ||
| 61 | +GlobalConfig.classRole=0; | ||
| 62 | +GlobalConfig.userId=0; | ||
| 63 | +GlobalConfig.userName=""; | ||
| 64 | +GlobalConfig.password=""; | ||
| 65 | +GlobalConfig.userType=8; | ||
| 66 | +GlobalConfig.h5Module=0; | ||
| 67 | +GlobalConfig.nopassword=false; | ||
| 68 | +GlobalConfig.md5=""; | ||
| 69 | +GlobalConfig.msType=1; | ||
| 70 | +GlobalConfig.mcuDelay=3000; | ||
| 71 | +GlobalConfig.portal="112.126.80.182:80"; | ||
| 72 | +GlobalConfig.ip="112.126.80.182"; | ||
| 73 | +GlobalConfig.port="80"; | ||
| 74 | +GlobalConfig.MCUServerIP="114.215.195.70"; | ||
| 75 | +GlobalConfig.MCUServerPort=9003; | ||
| 76 | +GlobalConfig.maxVideoChannels=1; | ||
| 77 | +GlobalConfig.maxAudioChannels=1; | ||
| 78 | +GlobalConfig.maxMediaChannels=2; | ||
| 79 | +GlobalConfig.isDebug=false; | ||
| 80 | +GlobalConfig.deBugData={}; | ||
| 81 | + | ||
| 82 | +GlobalConfig.meetingParam={}; | ||
| 24 | export default GlobalConfig; | 83 | export default GlobalConfig; |
| @@ -15,17 +15,17 @@ | @@ -15,17 +15,17 @@ | ||
| 15 | 15 | ||
| 16 | class Loger { | 16 | class Loger { |
| 17 | constructor(info) { | 17 | constructor(info) { |
| 18 | - this.info = info || ''; | 18 | + this.sdkInfo = info || ''; |
| 19 | this.id = this.initId(); | 19 | this.id = this.initId(); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | initId() { | 22 | initId() { |
| 23 | - const infoType = this.info.constructor.name.toLowerCase(); | 23 | + const infoType = this.sdkInfo.constructor.name.toLowerCase(); |
| 24 | if (infoType === 'string') { | 24 | if (infoType === 'string') { |
| 25 | - return this.info; | 25 | + return this.sdkInfo; |
| 26 | } | 26 | } |
| 27 | if (infoType === 'object') { | 27 | if (infoType === 'object') { |
| 28 | - return this.info.mid || ''; | 28 | + return this.sdkInfo.mid || ''; |
| 29 | } | 29 | } |
| 30 | return ''; | 30 | return ''; |
| 31 | } | 31 | } |
| @@ -15,34 +15,51 @@ | @@ -15,34 +15,51 @@ | ||
| 15 | 15 | ||
| 16 | function MessageTypes() {} | 16 | function MessageTypes() {} |
| 17 | 17 | ||
| 18 | -MessageTypes.CONFERENCE_SHOW_USERNAME = 'show.name.input'; | ||
| 19 | -MessageTypes.CONFERENCE_SHOW_ILLEGAL = 'illegal.user'; | ||
| 20 | -MessageTypes.CONFERENCE_SHOW_USERNAME_PASSWORD = 'show.name.pasword.input'; | ||
| 21 | -MessageTypes.CONFERENCE_SHOW_WRONG_PASSWORD = 'password.wrong'; | ||
| 22 | -MessageTypes.CONFERENCE_JOIN_FAILED = 'join.conference.failed'; | ||
| 23 | -MessageTypes.CONFERENCE_JOIN_SUCCESS = 'join.conference.success'; | ||
| 24 | -MessageTypes.CONFERENCE_JOIN_FULL = 'full.capacity'; | ||
| 25 | -MessageTypes.CONFERENCE_EXIT = 'conference.exit'; | ||
| 26 | -MessageTypes.CONFERENCE_JOIN_CONFILICT = 'have.been.logged.elsewhere'; | ||
| 27 | -MessageTypes.CONFERENCE_SHOW_DETAIL = 'class_detail.message'; | ||
| 28 | -MessageTypes.CONFERENCE_SHOW_ROSTER_NUM = 'roster_num.message'; | 18 | +//--------------------事件相关的定义-------------------------------------- |
| 19 | +//初始化相关事件定义 | ||
| 20 | +MessageTypes.CLASS_INIT_SUCCESS='class.init.success';//初始化成功 | ||
| 21 | +MessageTypes.CLASS_INIT_FAILED='class.init.failed';//初始化失败 | ||
| 29 | 22 | ||
| 30 | -MessageTypes.NET_ERROR = 'net_error'; | ||
| 31 | -MessageTypes.PRO_ERROR = 'pro_error'; | 23 | +//加入会议相关事件定义 |
| 24 | +MessageTypes.CLASS_JOIN_FAILED = 'join.class.failed'; | ||
| 25 | +MessageTypes.CLASS_JOIN_SUCCESS = 'join.class.success'; | ||
| 26 | + | ||
| 27 | +//会议信息和操作事件定义 | ||
| 28 | +MessageTypes.CLASS_SHOW_DETAIL = 'class_detail.message'; | ||
| 29 | +MessageTypes.CLASS_SHOW_ROSTER_NUM = 'roster_num.message'; | ||
| 30 | +MessageTypes.CLASS_EXIT = 'class.exit'; | ||
| 31 | + | ||
| 32 | +//聊天模块事件定义 | ||
| 33 | +MessageTypes.CHAT_RECEIVE = 'chat.message'; | ||
| 32 | 34 | ||
| 35 | +//视频模块事件定义 | ||
| 33 | MessageTypes.VIDEO_SHOW = 'video.message'; | 36 | MessageTypes.VIDEO_SHOW = 'video.message'; |
| 34 | 37 | ||
| 38 | +//文档模块事件定义 | ||
| 35 | MessageTypes.DOC_SHOW = 'document.message'; | 39 | MessageTypes.DOC_SHOW = 'document.message'; |
| 36 | MessageTypes.DOC_SWITCH = 'document.switch'; | 40 | MessageTypes.DOC_SWITCH = 'document.switch'; |
| 37 | MessageTypes.DOC_UPDATE = 'document.update'; | 41 | MessageTypes.DOC_UPDATE = 'document.update'; |
| 38 | MessageTypes.DOC_DEL='document.delete'; | 42 | MessageTypes.DOC_DEL='document.delete'; |
| 39 | -MessageTypes.DOC_ANNO = 'document.anno'; | ||
| 40 | - | ||
| 41 | -MessageTypes.CHAT_RECEIVE = 'chat.message'; | 43 | +MessageTypes.DOC_ANNO = 'document.anno';//笔记 |
| 42 | 44 | ||
| 45 | +//笔记事件定义 | ||
| 43 | MessageTypes.ANNO_UPDATE = 'anno_update'; | 46 | MessageTypes.ANNO_UPDATE = 'anno_update'; |
| 44 | - | ||
| 45 | MessageTypes.AUDIO_SHOW='audio.message'; | 47 | MessageTypes.AUDIO_SHOW='audio.message'; |
| 46 | 48 | ||
| 49 | +//错误事件定义 | ||
| 50 | +MessageTypes.NET_ERROR = 'net_error'; | ||
| 51 | +MessageTypes.PRO_ERROR = 'pro_error';//协议异常 | ||
| 52 | + | ||
| 53 | + | ||
| 54 | +//---------------错误消息定义------------------------------------------------- | ||
| 55 | +MessageTypes.ERROR_NET='网络异常'; | ||
| 56 | +MessageTypes.ERROR_PARAM='参数不正确'; | ||
| 57 | + | ||
| 58 | +MessageTypes.ERROR_CLASS_JOIN_FULL = 'class.join,full';//人数已满 | ||
| 59 | +MessageTypes.ERROR_CLASS_JOIN_CONFILICT = 'class.join.conflict';//已经在其它地方登陆 | ||
| 60 | +MessageTypes.ERROR_CLASS_PASSWORD_WRONG = 'class.password.wrong';//密码错误 | ||
| 61 | +MessageTypes.ERROR_CLASS_MD5_WRONG = 'class.md5.wrong';//MD5验证失败 | ||
| 62 | +MessageTypes.ERROR_CLASS_PROTOCOL_WRONG = 'class.protocol.wrong';//协议异常 | ||
| 63 | + | ||
| 47 | export default MessageTypes; | 64 | export default MessageTypes; |
| 48 | 65 |
| 1 | import Emiter from 'Emiter'; | 1 | import Emiter from 'Emiter'; |
| 2 | import Loger from 'Loger'; | 2 | import Loger from 'Loger'; |
| 3 | import MessageTypes from 'MessageTypes'; | 3 | import MessageTypes from 'MessageTypes'; |
| 4 | - | 4 | +import GlobalConfig from 'GlobalConfig'; |
| 5 | +import MD5 from "md5"; | ||
| 5 | // 日志对象 | 6 | // 日志对象 |
| 6 | const loger = Loger.getLoger('Sass'); | 7 | const loger = Loger.getLoger('Sass'); |
| 7 | 8 | ||
| 8 | let confInfo = {}; | 9 | let confInfo = {}; |
| 10 | +let initInfo={}; | ||
| 9 | class Sass extends Emiter { | 11 | class Sass extends Emiter { |
| 10 | constructor() { | 12 | constructor() { |
| 11 | super(); | 13 | super(); |
| 12 | } | 14 | } |
| 13 | 15 | ||
| 14 | - // Sass校验 | ||
| 15 | - sassChecking(_confInfo) { | ||
| 16 | - loger.log('发起Sass校验', _confInfo); | ||
| 17 | - confInfo = _confInfo; | 16 | + //Sass 接口 |
| 17 | + //----1.校验之前的接口----- | ||
| 18 | + //sassGetJoinParams 获取课堂校验信息 let url = `http://${_initInfo.portal}/3m/api/meeting/joinParams.do?meetingNumber=${_initInfo.confId}&userID=${_initInfo.userId}`; | ||
| 19 | + | ||
| 20 | + //-----2.开始校验,如果有密码先校验密码,否则直接开始MD5验证----- | ||
| 21 | + //sendPWDChecking入会密码校验 let url = `http://${confInfo.portal}/3m/getCheckMeetinig.do?siteId=${confInfo.siteId}&classId=${confInfo.confId}&password=${confInfo.password}`; | ||
| 22 | + //sendMD5Checking MD5校验(发起入会) let url = `http://${confInfo.portal}/3m/meeting/md5CheckMeeting.do?siteId=${confInfo.siteId}&meetingNumber=${confInfo.confId}&userId=${confInfo.userId}&userName=${confInfo.userName}&userType=${confInfo.userType}&nopassword=${confInfo.nopassword}&md5=${confInfo.md5}`; | ||
| 23 | + | ||
| 24 | + //----3.验证完成后获取------ | ||
| 25 | + //getClassDetail 获取会议详情 let url = `http://${confInfo.portal}/3m/meeting/getClassH5.do?classNumber=${confInfo.confId}`; | ||
| 26 | + //getMeetingParam 获取会议最全参数集合 let url = `http://${confInfo.portal}/3m/api/meeting/detail.do?meetingNumber=${confInfo.confId}×tamp=${timestamp}&authId=${authId}`; | ||
| 27 | + | ||
| 28 | + | ||
| 29 | + //Sass获取课堂校验信息 | ||
| 30 | + sassGetJoinParams(_initInfo) { | ||
| 31 | + loger.log('Sass获取课堂校验信息', _initInfo); | ||
| 32 | + /* 获取用于加入课堂的参数 | ||
| 33 | + /3m/api/meeting/joinParams.do | ||
| 34 | + 参数 (application/x-www-form-urlencoded): | ||
| 35 | + 名称 类型 可选 默认值 说明 | ||
| 36 | + meetingNumber String 否 null 课堂号 | ||
| 37 | + userID String 是 0 用户id | ||
| 38 | + 返回 (application/json): | ||
| 39 | + | ||
| 40 | + 名称 类型 说明 | ||
| 41 | + code int 0 正常 | ||
| 42 | + 1 课堂号必填 | ||
| 43 | + 2 无效的课堂号 | ||
| 44 | + 3 没有对应的站点 | ||
| 45 | + 4 站点已过期 | ||
| 46 | + siteId String 站点号 | ||
| 47 | + passwordRequired Boolean 是否需要输入密码 | ||
| 48 | + md5 String 用于后续加入课堂验证 | ||
| 49 | + msType int 媒体服务器类型 | ||
| 50 | + */ | ||
| 51 | + let url = `http://${_initInfo.portal}/3m/api/meeting/joinParams.do?meetingNumber=${_initInfo.confId}&userID=${_initInfo.userId}`; | ||
| 52 | + loger.log('Sass获取课堂校验信息.', url); | ||
| 53 | + fetch(url, { | ||
| 54 | + timeout: 5000 | ||
| 55 | + }) | ||
| 56 | + .then(ret => { | ||
| 57 | + if (ret.ok) { | ||
| 58 | + return ret.json(); | ||
| 59 | + } else { | ||
| 60 | + loger.error(`Sass获取课堂校验信息-网络异常.状态码:${ret.status}`); | ||
| 61 | + this._emit(Sass.CLASS_INIT_FAILED); | ||
| 62 | + throw ''; | ||
| 63 | + } | ||
| 64 | + }) | ||
| 65 | + .then(ret => { | ||
| 66 | + if (ret.code === 0) { | ||
| 67 | + loger.log('Sass获取课堂校验信息完成'); | ||
| 68 | + this._emit(Sass.CLASS_INIT_SUCCESS,ret); | ||
| 69 | + } else { | ||
| 70 | + loger.warn('Sass获取课堂校验信息失败.'); | ||
| 71 | + this._emit(Sass.CLASS_INIT_FAILED); | ||
| 72 | + } | ||
| 73 | + }) | ||
| 74 | + .catch(err => { | ||
| 75 | + loger.error(`Sass获取课堂校验信息异常.状态码:${err}`); | ||
| 76 | + this._emit(Sass.CLASS_INIT_FAILED,err); | ||
| 77 | + }); | ||
| 78 | + } | ||
| 18 | 79 | ||
| 80 | + // Sass校验开始 | ||
| 81 | + sassChecking(_param) { | ||
| 82 | + loger.log('发起Sass校验', _param); | ||
| 83 | + confInfo = _param; | ||
| 19 | // 密码校验 | 84 | // 密码校验 |
| 20 | if (confInfo.nopassword === 'true') { | 85 | if (confInfo.nopassword === 'true') { |
| 21 | return this.sendPWDChecking(); | 86 | return this.sendPWDChecking(); |
| 22 | } | 87 | } |
| 23 | - | ||
| 24 | // MD5校验 | 88 | // MD5校验 |
| 25 | this.sendMD5Checking(); | 89 | this.sendMD5Checking(); |
| 26 | } | 90 | } |
| 27 | 91 | ||
| 28 | - // 入会校验 | 92 | + // 入会密码校验 |
| 29 | sendPWDChecking() { | 93 | sendPWDChecking() { |
| 30 | let url = `http://${confInfo.portal}/3m/getCheckMeetinig.do?siteId=${confInfo.siteId}&classId=${confInfo.confId}&password=${confInfo.password}`; | 94 | let url = `http://${confInfo.portal}/3m/getCheckMeetinig.do?siteId=${confInfo.siteId}&classId=${confInfo.confId}&password=${confInfo.password}`; |
| 95 | + | ||
| 31 | loger.log('会议密码校验', url); | 96 | loger.log('会议密码校验', url); |
| 32 | fetch(url, { | 97 | fetch(url, { |
| 33 | timeout: 5000 | 98 | timeout: 5000 |
| @@ -44,7 +109,7 @@ class Sass extends Emiter { | @@ -44,7 +109,7 @@ class Sass extends Emiter { | ||
| 44 | .then(ret => { | 109 | .then(ret => { |
| 45 | if (ret === 'false') { | 110 | if (ret === 'false') { |
| 46 | loger.error(`会议密码校验-失败.`); | 111 | loger.error(`会议密码校验-失败.`); |
| 47 | - return this._emit(MessageTypes.CONFERENCE_SHOW_WRONG_PASSWORD); | 112 | + return this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERROR_CLASS_PASSWORD_WRONG); |
| 48 | } | 113 | } |
| 49 | if (ret === 'true') { | 114 | if (ret === 'true') { |
| 50 | loger.log(`会议密码校验-成功.`); | 115 | loger.log(`会议密码校验-成功.`); |
| @@ -52,7 +117,7 @@ class Sass extends Emiter { | @@ -52,7 +117,7 @@ class Sass extends Emiter { | ||
| 52 | return | 117 | return |
| 53 | } | 118 | } |
| 54 | loger.error(`会议密码校验-协议异常.`); | 119 | loger.error(`会议密码校验-协议异常.`); |
| 55 | - this._emit(MessageTypes.PRO_ERROR); | 120 | + this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERROR_CLASS_PROTOCOL_WRONG); |
| 56 | }) | 121 | }) |
| 57 | .catch(err => { | 122 | .catch(err => { |
| 58 | loger.error(`会议密码校验-异常.状态码:${err}`); | 123 | loger.error(`会议密码校验-异常.状态码:${err}`); |
| @@ -63,9 +128,7 @@ class Sass extends Emiter { | @@ -63,9 +128,7 @@ class Sass extends Emiter { | ||
| 63 | // 发起入会 | 128 | // 发起入会 |
| 64 | sendMD5Checking() { | 129 | sendMD5Checking() { |
| 65 | let url = `http://${confInfo.portal}/3m/meeting/md5CheckMeeting.do?siteId=${confInfo.siteId}&meetingNumber=${confInfo.confId}&userId=${confInfo.userId}&userName=${confInfo.userName}&userType=${confInfo.userType}&nopassword=${confInfo.nopassword}&md5=${confInfo.md5}`; | 130 | let url = `http://${confInfo.portal}/3m/meeting/md5CheckMeeting.do?siteId=${confInfo.siteId}&meetingNumber=${confInfo.confId}&userId=${confInfo.userId}&userName=${confInfo.userName}&userType=${confInfo.userType}&nopassword=${confInfo.nopassword}&md5=${confInfo.md5}`; |
| 66 | - | ||
| 67 | loger.log('H5SassMD5校验', url); | 131 | loger.log('H5SassMD5校验', url); |
| 68 | - | ||
| 69 | fetch(url, { | 132 | fetch(url, { |
| 70 | timeout: 5000 | 133 | timeout: 5000 |
| 71 | }) | 134 | }) |
| @@ -84,17 +147,24 @@ class Sass extends Emiter { | @@ -84,17 +147,24 @@ class Sass extends Emiter { | ||
| 84 | let server = ret.h5_mcu_list.split(";")[0]; | 147 | let server = ret.h5_mcu_list.split(";")[0]; |
| 85 | confInfo.MCUServerIP = server.split(":")[0]; | 148 | confInfo.MCUServerIP = server.split(":")[0]; |
| 86 | confInfo.MCUServerPort = server.split(":")[1]; | 149 | confInfo.MCUServerPort = server.split(":")[1]; |
| 150 | + | ||
| 151 | + GlobalConfig.MCUServerIP=confInfo.MCUServerIP; | ||
| 152 | + GlobalConfig.MCUServerPort=confInfo.MCUServerPort; | ||
| 87 | } | 153 | } |
| 88 | - console.log(ret); | ||
| 89 | confInfo.maxVideoChannels = ret.maxVideoChannels; | 154 | confInfo.maxVideoChannels = ret.maxVideoChannels; |
| 90 | confInfo.maxAudioChannels = ret.maxAudioChannels; | 155 | confInfo.maxAudioChannels = ret.maxAudioChannels; |
| 91 | confInfo.maxMediaChannels = confInfo.maxVideoChannels + confInfo.maxAudioChannels; | 156 | confInfo.maxMediaChannels = confInfo.maxVideoChannels + confInfo.maxAudioChannels; |
| 92 | - loger.log('H5Sass校验完成'); | ||
| 93 | 157 | ||
| 94 | - this._emit(Sass.SUCCESS); | 158 | + GlobalConfig.maxVideoChannels=confInfo.maxVideoChannels; |
| 159 | + GlobalConfig.maxAudioChannels=confInfo.maxAudioChannels; | ||
| 160 | + GlobalConfig.maxMediaChannels=confInfo.maxMediaChannels; | ||
| 161 | + loger.log('H5Sass校验完成'); | ||
| 162 | + console.log(ret); | ||
| 163 | + this._emit(Sass.SUCCESS,ret); | ||
| 95 | } else { | 164 | } else { |
| 96 | loger.log('H5SassMD5校验-失败.'); | 165 | loger.log('H5SassMD5校验-失败.'); |
| 97 | - this._emit(MessageTypes.CONFERENCE_JOIN_FAILED); | 166 | + this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERROR_CLASS_MD5_WRONG); |
| 167 | + | ||
| 98 | } | 168 | } |
| 99 | }) | 169 | }) |
| 100 | .catch(err => { | 170 | .catch(err => { |
| @@ -106,9 +176,7 @@ class Sass extends Emiter { | @@ -106,9 +176,7 @@ class Sass extends Emiter { | ||
| 106 | // 获取会议详情 | 176 | // 获取会议详情 |
| 107 | getClassDetail() { | 177 | getClassDetail() { |
| 108 | let url = `http://${confInfo.portal}/3m/meeting/getClassH5.do?classNumber=${confInfo.confId}`; | 178 | let url = `http://${confInfo.portal}/3m/meeting/getClassH5.do?classNumber=${confInfo.confId}`; |
| 109 | - | ||
| 110 | loger.log('H5Sass获取Class详情.', url); | 179 | loger.log('H5Sass获取Class详情.', url); |
| 111 | - | ||
| 112 | fetch(url, { | 180 | fetch(url, { |
| 113 | timeout: 5000 | 181 | timeout: 5000 |
| 114 | }) | 182 | }) |
| @@ -124,7 +192,7 @@ class Sass extends Emiter { | @@ -124,7 +192,7 @@ class Sass extends Emiter { | ||
| 124 | .then(ret => { | 192 | .then(ret => { |
| 125 | if (ret.errorCode === 0) { | 193 | if (ret.errorCode === 0) { |
| 126 | loger.log('H5Sass获取Class详情完成'); | 194 | loger.log('H5Sass获取Class详情完成'); |
| 127 | - this._emit(MessageTypes.CONFERENCE_SHOW_DETAIL, ret); | 195 | + this._emit(MessageTypes.CLASS_SHOW_DETAIL, ret); |
| 128 | } else { | 196 | } else { |
| 129 | loger.warn('H5Sass获取Class详情失败.'); | 197 | loger.warn('H5Sass获取Class详情失败.'); |
| 130 | this._emit(MessageTypes.NET_ERROR); | 198 | this._emit(MessageTypes.NET_ERROR); |
| @@ -136,43 +204,59 @@ class Sass extends Emiter { | @@ -136,43 +204,59 @@ class Sass extends Emiter { | ||
| 136 | }); | 204 | }); |
| 137 | } | 205 | } |
| 138 | 206 | ||
| 139 | - getMeetingParm(){ | ||
| 140 | - console.log("getMeetingParm------------------------"); | ||
| 141 | - //http://112.126.80.182/3m/meeting/getMeetingParam.do?meetingNumber=1653304953 | ||
| 142 | - //let url = `http://${confInfo.portal}/3m/meeting/getClassH5.do?classNumber=${confInfo.confId}`; | ||
| 143 | - let url = `http://${confInfo.portal}/3m/meeting/getMeetingParam.do?meetingNumber=${confInfo.confId}&device=flashplayer`; | ||
| 144 | - loger.log('H5Sass获取MeetingParam.', url); | 207 | + getMeetingParam(){ |
| 208 | + /* | ||
| 209 | + 参数 (application/x-www-form-urlencoded): | ||
| 210 | + 名称 类型 可选 默认值 说明 | ||
| 211 | + meetingNumber String 否 null 课堂号 | ||
| 212 | + timestamp String 否 null 时间戳 | ||
| 213 | + authId String 否 null 验证信息 md5(meetingNumber + timestamp) | ||
| 145 | 214 | ||
| 215 | + 返回 (application/json): | ||
| 216 | + 名称 类型 说明 | ||
| 217 | + code int 0 正常 | ||
| 218 | + 1 课堂号必填 | ||
| 219 | + 2 无效的课堂号 | ||
| 220 | + 3 没有对应的站点 | ||
| 221 | + 4 站点已过期 | ||
| 222 | + siteId String 站点号 | ||
| 223 | + meetingNumber String 课堂号 | ||
| 224 | + */ | ||
| 225 | + var timestamp=new Date().getTime(); | ||
| 226 | + var authId=MD5(confInfo.confId+""+timestamp);//课堂号+时间戳 的字符串,转成MD5 | ||
| 227 | + let url = `http://${confInfo.portal}/3m/api/meeting/detail.do?meetingNumber=${confInfo.confId}×tamp=${timestamp}&authId=${authId}`; | ||
| 228 | + loger.log('H5Sass获取getMeetingParam ', url); | ||
| 146 | fetch(url, { | 229 | fetch(url, { |
| 147 | - timeout: 5000, | ||
| 148 | - mode: 'no-cors' | 230 | + timeout: 5000 |
| 149 | }) | 231 | }) |
| 150 | .then(ret => { | 232 | .then(ret => { |
| 151 | if (ret.ok) { | 233 | if (ret.ok) { |
| 152 | return ret.json(); | 234 | return ret.json(); |
| 153 | } else { | 235 | } else { |
| 154 | - loger.error(`H5Sass获取MeetingParam-网络异常.状态码:${ret.status}`); | 236 | + loger.error(`H5Sass获取getMeetingParam-网络异常.状态码:${ret.status}`); |
| 155 | this._emit(MessageTypes.NET_ERROR); | 237 | this._emit(MessageTypes.NET_ERROR); |
| 156 | throw ''; | 238 | throw ''; |
| 157 | } | 239 | } |
| 158 | }) | 240 | }) |
| 159 | .then(ret => { | 241 | .then(ret => { |
| 160 | - if (ret.errorCode === 0) { | ||
| 161 | - loger.log('H5Sass获取MeetingParam完成'); | ||
| 162 | - this._emit(MessageTypes.CONFERENCE_SHOW_DETAIL, ret); | 242 | + if (ret.code === 0) { |
| 243 | + loger.log('H5Sass获取getMeetingParam完成'); | ||
| 244 | + this._emit(Sass.CLASS_GET_MEETING_PARAM, ret); | ||
| 163 | } else { | 245 | } else { |
| 164 | - loger.warn('H5Sass获取MeetingParam失败.'); | 246 | + loger.warn('H5Sass获取getMeetingParam失败.'); |
| 165 | this._emit(MessageTypes.NET_ERROR); | 247 | this._emit(MessageTypes.NET_ERROR); |
| 166 | } | 248 | } |
| 167 | }) | 249 | }) |
| 168 | .catch(err => { | 250 | .catch(err => { |
| 169 | - loger.error(`H5Sass获取MeetingParam异常.状态码:${err}`); | 251 | + loger.error(`H5Sass获取getMeetingParam异常.状态码:${err}`); |
| 170 | this._emit(MessageTypes.NET_ERROR); | 252 | this._emit(MessageTypes.NET_ERROR); |
| 171 | }); | 253 | }); |
| 172 | } | 254 | } |
| 173 | } | 255 | } |
| 174 | 256 | ||
| 175 | Sass.prototype.SUCCESS = Sass.SUCCESS = 'h5sass.success'; | 257 | Sass.prototype.SUCCESS = Sass.SUCCESS = 'h5sass.success'; |
| 176 | - | 258 | +Sass.prototype.CLASS_INIT_SUCCESS = Sass.CLASS_INIT_SUCCESS = 'sass.class.init.success'; |
| 259 | +Sass.prototype.CLASS_INIT_FAILED = Sass.CLASS_INIT_FAILED = 'sass.class.init.failed'; | ||
| 260 | +Sass.prototype.CLASS_GET_MEETING_PARAM= Sass.CLASS_GET_MEETING_PARAM = 'class_getMeetingParam.message'; | ||
| 177 | export default new Sass; | 261 | export default new Sass; |
| 178 | 262 |
| @@ -51,7 +51,7 @@ export default class Ape extends Emiter { | @@ -51,7 +51,7 @@ export default class Ape extends Emiter { | ||
| 51 | 51 | ||
| 52 | // 监听底层MCU会议 | 52 | // 监听底层MCU会议 |
| 53 | this.mcu = mcu; | 53 | this.mcu = mcu; |
| 54 | - this.mcu.on(MessageTypes.CONFERENCE_JOIN_SUCCESS, this._mcuConferenceJoinSuccessHandler.bind(this)); | 54 | + this.mcu.on(MessageTypes.CLASS_JOIN_SUCCESS, this._mcuConferenceJoinSuccessHandler.bind(this)); |
| 55 | this.mcu.registerApe(this); | 55 | this.mcu.registerApe(this); |
| 56 | } | 56 | } |
| 57 | 57 |
| @@ -38,9 +38,9 @@ class ChatApe extends Ape { | @@ -38,9 +38,9 @@ class ChatApe extends Ape { | ||
| 38 | this.on(pdu.RCPDU_CHAT_SEND_DATA_REQUEST, this.chatMsgIncomingHandler.bind(this)); | 38 | this.on(pdu.RCPDU_CHAT_SEND_DATA_REQUEST, this.chatMsgIncomingHandler.bind(this)); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | - chatMsgIncomingHandler(pdu) { | ||
| 42 | - | ||
| 43 | - } | 41 | + //chatMsgIncomingHandler(pdu) { |
| 42 | + // | ||
| 43 | + //} | ||
| 44 | 44 | ||
| 45 | sendChatMsg(_messageInfo) { | 45 | sendChatMsg(_messageInfo) { |
| 46 | if(this._confInfo===null||EngineUtils.isEmptyObject(this._confInfo)){ | 46 | if(this._confInfo===null||EngineUtils.isEmptyObject(this._confInfo)){ |
| @@ -51,14 +51,16 @@ class ChatApe extends Ape { | @@ -51,14 +51,16 @@ class ChatApe extends Ape { | ||
| 51 | 51 | ||
| 52 | // to, message | 52 | // to, message |
| 53 | loger.log('发送聊天消息.', _messageInfo.to, _messageInfo.message); | 53 | loger.log('发送聊天消息.', _messageInfo.to, _messageInfo.message); |
| 54 | + | ||
| 54 | let chatSendPdu = new pdu['RCChatSendDataRequestPdu']; | 55 | let chatSendPdu = new pdu['RCChatSendDataRequestPdu']; |
| 55 | chatSendPdu.type = pdu.RCPDU_CHAT_SEND_DATA_REQUEST; | 56 | chatSendPdu.type = pdu.RCPDU_CHAT_SEND_DATA_REQUEST; |
| 56 | chatSendPdu.initiator = this._confInfo.nodeId;//发起人 | 57 | chatSendPdu.initiator = this._confInfo.nodeId;//发起人 |
| 57 | - chatSendPdu.peer = _messageInfo.to;//发送给谁,公聊的时候是0,私聊的时候是指定的用户id | 58 | + chatSendPdu.peer = parseInt(_messageInfo.to);//发送给谁,公聊的时候是0,私聊的时候是指定的用户id |
| 58 | chatSendPdu.isPublic = true; | 59 | chatSendPdu.isPublic = true; |
| 59 | chatSendPdu.userData = this._rCArrayBufferUtil.strToUint8Array("h5" + _messageInfo.message); | 60 | chatSendPdu.userData = this._rCArrayBufferUtil.strToUint8Array("h5" + _messageInfo.message); |
| 60 | chatSendPdu.fromName = this._rCArrayBufferUtil.strToUint8Array("h5" + this._confInfo.userName); | 61 | chatSendPdu.fromName = this._rCArrayBufferUtil.strToUint8Array("h5" + this._confInfo.userName); |
| 61 | chatSendPdu.fromRole = this._confInfo.classRole; | 62 | chatSendPdu.fromRole = this._confInfo.classRole; |
| 63 | + | ||
| 62 | if (!(chatSendPdu.isPublic || 0 === chatSendPdu.peer)) { | 64 | if (!(chatSendPdu.isPublic || 0 === chatSendPdu.peer)) { |
| 63 | this.send(chatSendPdu); | 65 | this.send(chatSendPdu); |
| 64 | } else { | 66 | } else { |
| @@ -76,7 +78,7 @@ class ChatApe extends Ape { | @@ -76,7 +78,7 @@ class ChatApe extends Ape { | ||
| 76 | chatMsg.fromName = this._rCArrayBufferUtil.uint8ArrayToStr(chatReceivePdu.fromName, 2); | 78 | chatMsg.fromName = this._rCArrayBufferUtil.uint8ArrayToStr(chatReceivePdu.fromName, 2); |
| 77 | chatMsg.fromRole = chatReceivePdu.fromRole; | 79 | chatMsg.fromRole = chatReceivePdu.fromRole; |
| 78 | 80 | ||
| 79 | - loger.log('接受聊天消息.', chatMsg); | 81 | + loger.log('接收聊天消息.', chatMsg); |
| 80 | 82 | ||
| 81 | this._emit(MessageTypes.CHAT_RECEIVE, chatMsg); | 83 | this._emit(MessageTypes.CHAT_RECEIVE, chatMsg); |
| 82 | } | 84 | } |
| @@ -135,12 +135,12 @@ class ConferApe extends Ape { | @@ -135,12 +135,12 @@ class ConferApe extends Ape { | ||
| 135 | this.emitRosterChange(); | 135 | this.emitRosterChange(); |
| 136 | // 自己退出 | 136 | // 自己退出 |
| 137 | if (nodeId == this._confInfo.nodeId) { | 137 | if (nodeId == this._confInfo.nodeId) { |
| 138 | - this._emit(MessageTypes.CONFERENCE_EXIT); | 138 | + this._emit(MessageTypes.CLASS_EXIT); |
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | emitRosterChange() { | 142 | emitRosterChange() { |
| 143 | - this._emit(MessageTypes.CONFERENCE_SHOW_ROSTER_NUM, Object.keys(this.rosters).length); | 143 | + this._emit(MessageTypes.CLASS_SHOW_ROSTER_NUM, Object.keys(this.rosters).length); |
| 144 | } | 144 | } |
| 145 | } | 145 | } |
| 146 | 146 |
| @@ -11,6 +11,7 @@ import ApeConsts from 'apes/ApeConsts'; | @@ -11,6 +11,7 @@ import ApeConsts from 'apes/ApeConsts'; | ||
| 11 | import ConferApe from 'apes/ConferApe'; | 11 | import ConferApe from 'apes/ConferApe'; |
| 12 | import ArrayBufferUtil from 'libs/ArrayBufferUtil'; | 12 | import ArrayBufferUtil from 'libs/ArrayBufferUtil'; |
| 13 | import Base64 from 'base64-js'; | 13 | import Base64 from 'base64-js'; |
| 14 | +//import GlobalConfig from 'GlobalConfig'; | ||
| 14 | 15 | ||
| 15 | let loger = Loger.getLoger('MCU'); | 16 | let loger = Loger.getLoger('MCU'); |
| 16 | 17 | ||
| @@ -33,7 +34,7 @@ class MCU extends Emiter { | @@ -33,7 +34,7 @@ class MCU extends Emiter { | ||
| 33 | loger.log('MCU-发送加入会议请求.'); | 34 | loger.log('MCU-发送加入会议请求.'); |
| 34 | const confInfo = this.confInfo; | 35 | const confInfo = this.confInfo; |
| 35 | 36 | ||
| 36 | - // 刷新nodeId | 37 | + // 创建刷新nodeId |
| 37 | confInfo.nodeId = parseInt(Date.now() / 1000); | 38 | confInfo.nodeId = parseInt(Date.now() / 1000); |
| 38 | 39 | ||
| 39 | var joinRequestPdu = new pdu['RCConferenceJoinRequestPdu']; | 40 | var joinRequestPdu = new pdu['RCConferenceJoinRequestPdu']; |
| @@ -83,11 +84,13 @@ class MCU extends Emiter { | @@ -83,11 +84,13 @@ class MCU extends Emiter { | ||
| 83 | switch (pduResultCode) { | 84 | switch (pduResultCode) { |
| 84 | case PduConsts.RET_SUCCESS: | 85 | case PduConsts.RET_SUCCESS: |
| 85 | this._updateMCUConfInfoDesc(joinConfPdu.get("confDesc")); | 86 | this._updateMCUConfInfoDesc(joinConfPdu.get("confDesc")); |
| 86 | - this._emit(MessageTypes.CONFERENCE_JOIN_SUCCESS, this.confInfo); | 87 | + this._emit(MessageTypes.CLASS_JOIN_SUCCESS, this.confInfo); |
| 87 | break; | 88 | break; |
| 88 | case PduConsts.RET_FULL_CAPACITY: | 89 | case PduConsts.RET_FULL_CAPACITY: |
| 89 | - this._emit(MessageTypes.CONFERENCE_JOIN_FULL); | 90 | + this._emit(MessageTypes.CLASS_JOIN_FAILED,MessageTypes.ERROR_CLASS_JOIN_FULL); |
| 91 | + //this._emit(MessageTypes.CLASS_JOIN_FULL); | ||
| 90 | break; | 92 | break; |
| 93 | + | ||
| 91 | default: | 94 | default: |
| 92 | loger.warn('JoinConfPdu-未知类型-等待处理.', pduResultCode); | 95 | loger.warn('JoinConfPdu-未知类型-等待处理.', pduResultCode); |
| 93 | } | 96 | } |
| @@ -155,7 +158,7 @@ class MCU extends Emiter { | @@ -155,7 +158,7 @@ class MCU extends Emiter { | ||
| 155 | 158 | ||
| 156 | let conferenceRecord = {}; //RCConferenceRecord_T | 159 | let conferenceRecord = {}; //RCConferenceRecord_T |
| 157 | conferenceRecord._conference_id = this.confInfo.confId; | 160 | conferenceRecord._conference_id = this.confInfo.confId; |
| 158 | - conferenceRecord._top_node_id = this.confInfo.topNodeID; | 161 | + conferenceRecord._top_node_id =this.confInfo.topNodeID; |
| 159 | 162 | ||
| 160 | this.mcuConfInfo = {}; //RCMeetingInfo_T | 163 | this.mcuConfInfo = {}; //RCMeetingInfo_T |
| 161 | this.mcuConfInfo.self = nodeInfoRecordPdu; | 164 | this.mcuConfInfo.self = nodeInfoRecordPdu; |
| @@ -165,7 +168,7 @@ class MCU extends Emiter { | @@ -165,7 +168,7 @@ class MCU extends Emiter { | ||
| 165 | this.confInfo.mcuConfInfo = this.mcuConfInfo; | 168 | this.confInfo.mcuConfInfo = this.mcuConfInfo; |
| 166 | 169 | ||
| 167 | //开启EverSocket | 170 | //开启EverSocket |
| 168 | - this._everSocket.begin(this.confInfo.MCUServerIP, this.confInfo.MCUServerPort); | 171 | + this._everSocket.begin(this.confInfo.MCUServerIP,this.confInfo.MCUServerPort); |
| 169 | } | 172 | } |
| 170 | } | 173 | } |
| 171 | 174 |
-
请 注册 或 登录 后发表评论