Commit 56321386 authored by zhuxianguo's avatar zhuxianguo

修正外部库依赖

parent fec80eea
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("axios"),require("io")):"function"==typeof define&&define.amd?define(["axios","io"],t):"object"==typeof exports?exports.TQMessageCenterEngine=t(require("axios"),require("io")):e.TQMessageCenterEngine=t(e.axios,e.io)}(window,function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(n(1)),s=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}var c={GET_MY_ROOMS_URL:"/msg/agent/api/getMyRooms",GET_ROOM_MEMBERS_URL:"/msg/agent/api/getRoomMembers",GET_OFFLINE_URL:"/msg/agent/api/getOfflineMsgs",GET_OFFLINE_BYTOKEN_URL:"/msg/agent/api/getOfflineMsgsByToken"},a=function(e){return"string"==typeof e?e:"object"==(void 0===e?"undefined":o(e))?JSON.stringify(e):void 0},p=function(e){var t=this;this.options=function(e,t){for(var n in t)e[n]=t[n];return e}({namespace:"com.tianque.message.user",clientNamespace:"",socketHost:"",apiHost:"",sendMsgUrl:"",clientId:"user1",transports:["websocket"],token:""},e),this.options.clientId=encodeURIComponent(this.options.clientId),["socketHost","apiHost","sendMsgUrl"].forEach(function(e){if(!t.options[e])throw new Error(e+" is empty!")});var n=this.options.clientNamespace?this.options.clientNamespace+"__namespace__"+this.options.clientId:this.options.clientId,o=this.options.socketHost+"/"+this.options.namespace+"?clientid="+n;o+=this.options.token?"&token="+this.options.token:"";var r={"force new connection":!0,transports:this.options.transports},p=s.default.connect(o,r),u=function(e){var t=i.default.create();return t.defaults.baseURL=e.apiHost,t.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),t.interceptors.response.use(function(e){return e.data.data},function(e){return Promise.reject(e)}),t}(this.options),l=function(e){return t.options.token?{info:e,token:t.options.token}:e};this.version=function(){return"1.4.2"},this.on=function(e,t){null!=p&&p.on(e,t)},this.disconnect=function(){null!=p&&p.disconnect()},this.isconnect=function(){return p.connected},this.login=function(e){null!=p&&p.emit("login",e)},this.logout=function(){null!=p&&p.emit("logout",t.options.clientId)},this.joinRoom=function(e){var n=e.room,o=void 0===n?"":n,i=e.msgContent,s=void 0===i?{}:i,r={mgsId:"1",namespace:t.options.namespace,clientNamespace:t.options.clientNamespace,sourceId:t.options.clientId,msgType:"join",room:o,msgContent:a(s)};return u.post(t.options.sendMsgUrl,l(r))},this.leaveRoom=function(e){var n=e.room,o=void 0===n?"":n,i=e.msgContent,s=void 0===i?{}:i,r={mgsId:"1",namespace:t.options.namespace,clientNamespace:t.options.clientNamespace,sourceId:t.options.clientId,msgType:"leave",room:o,msgContent:a(s)};return u.post(t.options.sendMsgUrl,l(r))},this.sendMessage=function(e){var n=e.room,o=void 0===n?"":n,i=e.targetClientId,s=void 0===i?[]:i,r=e.suportOffline,c=void 0!==r&&r,p=e.suportSendSuccessCheck,f=void 0!==p&&p,d=e.msgType,m=void 0===d?"chat":d,g=e.msgContent,y=void 0===g?{}:g,v={mgsId:"1",namespace:t.options.namespace,clientNamespace:t.options.clientNamespace,suportOffline:c,room:o,targetClientId:s,msgType:m,suportSendSuccessCheck:f,msgContent:a(y)};return u.post(t.options.sendMsgUrl,l(v))},this.getRoomMembers=function(e){var n=e.room,o=void 0===n?"":n,i={namespace:t.options.namespace,clientNamespace:t.options.clientNamespace,clientId:t.options.clientId,room:o};return u.post(c.GET_ROOM_MEMBERS_URL,i)},this.getMyRooms=function(){var e={namespace:t.options.namespace,clientNamespace:t.options.clientNamespace,clientId:t.options.clientId};return u.post(c.GET_MY_ROOMS_URL,e)},this.getOfflineMsgs=function(){var e={namespace:t.options.namespace,clientNamespace:t.options.clientNamespace,userId:t.options.clientId},n=t.options.token?c.GET_OFFLINE_BYTOKEN_URL:c.GET_OFFLINE_URL;return u.post(n,e)}};p.EVENT_TYPES={CONNECT:"connect",DISCONNECT:"disconnect",USER_DISCONNECTED:"userDisconnected",JOINED:"joined",LEAVED:"leaved"},p.APIS=c,t.default=p,e.exports=t.default},function(t,n){t.exports=e},function(e,n){e.exports=t}])});
\ No newline at end of file
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TQMessageCenterEngine=t():e.TQMessageCenterEngine=t()}(window,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var s=t[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(o,s,function(t){return e[t]}.bind(null,s));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=r(n(1)),i=r(n(2));function r(e){return e&&e.__esModule?e:{default:e}}console.log("axios",s.default),console.log("io",i.default);var c={GET_MY_ROOMS_URL:"/msg/agent/api/getMyRooms",GET_ROOM_MEMBERS_URL:"/msg/agent/api/getRoomMembers",GET_OFFLINE_URL:"/msg/agent/api/getOfflineMsgs",GET_OFFLINE_BYTOKEN_URL:"/msg/agent/api/getOfflineMsgsByToken"},a=function(e){return"string"==typeof e?e:"object"==(void 0===e?"undefined":o(e))?JSON.stringify(e):void 0},p=function(e){var t=this;this.options=function(e,t){for(var n in t)e[n]=t[n];return e}({namespace:"com.tianque.message.user",clientNamespace:"",socketHost:"",apiHost:"",sendMsgUrl:"",clientId:"user1",transports:["websocket"],token:""},e),this.options.clientId=encodeURIComponent(this.options.clientId),["socketHost","apiHost","sendMsgUrl"].forEach(function(e){if(!t.options[e])throw new Error(e+" is empty!")});var n=this.options.clientNamespace?this.options.clientNamespace+"__namespace__"+this.options.clientId:this.options.clientId,o=this.options.socketHost+"/"+this.options.namespace+"?clientid="+n;o+=this.options.token?"&token="+this.options.token:"";var r={"force new connection":!0,transports:this.options.transports},p=i.default.connect(o,r),u=function(e){var t=s.default.create();return t.defaults.baseURL=e.apiHost,t.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),t.interceptors.response.use(function(e){return e.data.data},function(e){return Promise.reject(e)}),t}(this.options),l=function(e){return t.options.token?{info:e,token:t.options.token}:e};this.version=function(){return"1.4.2"},this.on=function(e,t){null!=p&&p.on(e,t)},this.disconnect=function(){null!=p&&p.disconnect()},this.isconnect=function(){return p.connected},this.login=function(e){null!=p&&p.emit("login",e)},this.logout=function(){null!=p&&p.emit("logout",t.options.clientId)},this.joinRoom=function(e){var n=e.room,o=void 0===n?"":n,s=e.msgContent,i=void 0===s?{}:s,r={mgsId:"1",namespace:t.options.namespace,clientNamespace:t.options.clientNamespace,sourceId:t.options.clientId,msgType:"join",room:o,msgContent:a(i)};return u.post(t.options.sendMsgUrl,l(r))},this.leaveRoom=function(e){var n=e.room,o=void 0===n?"":n,s=e.msgContent,i=void 0===s?{}:s,r={mgsId:"1",namespace:t.options.namespace,clientNamespace:t.options.clientNamespace,sourceId:t.options.clientId,msgType:"leave",room:o,msgContent:a(i)};return u.post(t.options.sendMsgUrl,l(r))},this.sendMessage=function(e){var n=e.room,o=void 0===n?"":n,s=e.targetClientId,i=void 0===s?[]:s,r=e.suportOffline,c=void 0!==r&&r,p=e.suportSendSuccessCheck,f=void 0!==p&&p,d=e.msgType,m=void 0===d?"chat":d,g=e.msgContent,y=void 0===g?{}:g,v={mgsId:"1",namespace:t.options.namespace,clientNamespace:t.options.clientNamespace,suportOffline:c,room:o,targetClientId:i,msgType:m,suportSendSuccessCheck:f,msgContent:a(y)};return u.post(t.options.sendMsgUrl,l(v))},this.getRoomMembers=function(e){var n=e.room,o=void 0===n?"":n,s={namespace:t.options.namespace,clientNamespace:t.options.clientNamespace,clientId:t.options.clientId,room:o};return u.post(c.GET_ROOM_MEMBERS_URL,s)},this.getMyRooms=function(){var e={namespace:t.options.namespace,clientNamespace:t.options.clientNamespace,clientId:t.options.clientId};return u.post(c.GET_MY_ROOMS_URL,e)},this.getOfflineMsgs=function(){var e={namespace:t.options.namespace,clientNamespace:t.options.clientNamespace,userId:t.options.clientId},n=t.options.token?c.GET_OFFLINE_BYTOKEN_URL:c.GET_OFFLINE_URL;return u.post(n,e)}};p.EVENT_TYPES={CONNECT:"connect",DISCONNECT:"disconnect",USER_DISCONNECTED:"userDisconnected",JOINED:"joined",LEAVED:"leaved"},p.APIS=c,t.default=p,e.exports=t.default},function(e,t){e.exports=axios},function(e,t){e.exports=io}])});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment