<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                pc端介紹。 前端資源文件位于Applications\webApp\public目錄中,其中dist目錄存放的js和css的壓縮版本文件,static存放的原版文件。下面的地址都是基于Applications\webApp\public的。 PC端主要js文件為static/js/socket.js此文件暴露一個Layui.socket出來,本插件主要通過layui.socket進行websocket連接和實現所有邏輯。使用時只需要在html頁面加入相關配置參數然后引入/public/static/js/common.js即可使用。common.js會調用socket.js然后自動完成初始化。 示例: ``` <script> var im_config = { token: { url:''//第一步的token請求接口地址 ,type:'post'//請求方式 ,dataType:'json' //請求格式類型,一般為json } ,url_domain : ' ' //webserver地址(非80/443端口需要帶著端口號) http://或https://開頭 ,dataType:"jsonp" //ajax請求接口(不包括上傳文件和圖片data獲取接口及token接口)返回格式默認json 不跨域可不填 這里一般會跨域無需改動 ,socketHost:'', //webSocket連接地址 即gateway地址(需要帶著端口號),gateway服務器開啟ssl以wss://開頭,未開啟以ws://開頭 } function myDefined(layui,layer,layim,$,socket){ //自定義js處理請寫在這里 可直接使用layui;lay;socket和$ 注:jQuery版本為jQuery1.11最穩定的一個版本 } </script> <!--開發時引入static/js/common.js線上環境建議引入壓縮版文件dist/js/common.js--> <script src="webserver地址域名(非80/443端口需要帶著端口號)/public/static/js/common.js" charset="utf-8"></script> ``` 其中im_config支持以下參數: ``` //獲取websocket憑證地址 token:{ url:'' } //初始化接口 , init: { url: '/im/getMyInfo' , data: {} } //獲取群員接口(已自動集成無需更改) , members: { url: '/im/getGroupUser' //接口地址 , type: 'post' //默認get,一般可不填 , data: {} //額外參數 } //上傳圖片接口,若不開啟圖片上傳,設為false即可 , uploadImage: { url: "/im/upImg" //上傳地址 webserver自有地址為 /im/upImg ,up_way:"up" //上傳方式 up上傳到自有服務器 qiniu上傳到七牛云 custom自定義第三方存儲 ,data:{} //上傳時附帶參數 ,data_url:false //附帶參數請求地址格式{url:"請求地址",type:"請求method",dataType:'返回數據格式建議json/jsonp'} 接口返回格式: {code:0,message:'',data:{'':""}} code0成功 code 1失敗 message錯誤信息 data上傳附帶的參數 會傳給done回調函數 ,done:false //自定義上傳完成處理處理函數 函數返回格式{code:0,message:'',data{src:''}} code0成功 code 1失敗 message錯誤信息 data.src文件件完整地址 ,error:false //上傳失敗函數接收三個參數 index 當前文件的索引 , upload 重新上傳的方法 , e XMLHttpRequest 對象 } //上傳文件接口,若不開啟文件上傳,設為false即可 , uploadFile: { url: '/im/upFile' //上傳地址 webserver自有地址為 /im/upFile ,up_way:"up" //上傳方式 up上傳到自有服務器 qiniu上傳到七牛云 custom自定義第三方存儲 ,data:{} //上傳時附帶參數 ,data_url:false //附帶參數請求地址格式{url:"請求地址",type:"請求method",dataType:'返回數據格式建議json/jsonp'} 接口返回格式: {code:0,message:'',data:{'':""}} code0成功 code 1失敗 message錯誤信息 data上傳附帶的參數 會傳給done回調函數 ,done:false //自定義上傳完成處理處理函數 函數返回格式{code:0,message:'',data{src:''}} code0成功 code 1失敗 message錯誤信息 data.src文件件完整地址 ,error:false //上傳失敗函數接收三個參數 index 當前文件的索引 , upload 重新上傳的方法 , e XMLHttpRequest 對象 } //獲取消息盒子個數(已自動集成無需更改) , messageBox: { url: "/im/getMsgNum" , type: 'post' } //修改簽名接口(已自動集成無需更改) , editSign: { url: "/im/editSign" , type: 'post' } //修改在線狀態接口(已自動集成無需更改) , editStatus: { url: "/im/editStatus" , type: 'post' } ,addGroup:{ //申請添加群組(已自動集成無需更改) url:'/im/addGroup' , type:'post' } , groupMemberMenu: { //獲取群組成員右鍵菜單(已自動集成無需更改) url: "/im/groupMemberMenu" , type: 'post' } , editGroupdescribe: { //修改群名片(已自動集成無需更改) url: '/im/editGroupdescribe' , type: 'post' } , memberGag: { //禁言(已自動集成無需更改) url: '/im/memberGag' , type: 'post' } , cancelGag: { //取消禁言(已自動集成無需更改) url: '/im/cancelGag' , type: 'post' } , setAdmin: { //設為管理(已自動集成無需更改) url: '/im/setAdmin' , type: 'post' } , removeAdmin: { //取消管理(已自動集成無需更改) url: '/im/removeAdmin' , type: 'post' } , leaveGroup: { //離開該群組(已自動集成無需更改) url: '/im/leaveGroup' , type: 'post' }, addFriend:{ //申請添加好友(已自動集成無需更改) url:'/im/addFriend' , type:'post' }, editDescribe: { //修改好友備注(已自動集成無需更改) url: '/im/editDescribe' , type: 'post' } , moveFriend: { //移動好友分組(已自動集成無需更改) url: '/im/moveFriend' , type: 'post' } , removeFriend: { //刪除好友(已自動集成無需更改) url: '/im/removeFriend' , type: 'post' } , addFriendGroup: { //添加好友分組(已自動集成無需更改) url: '/im/addFriendGroup' , type: 'post' } , editFriendGroup: { //修改好友分組(已自動集成無需更改) url: '/im/editFriendGroup' , type: 'post' } , delFriendGroup: { //刪除好友分組(已自動集成無需更改) url: '/im/delFriendGroup' , type: 'post' } , Information: { //查看資料地址(已自動集成無需更改) url: '/im/delFriendGroup' , type: 'post' } , msgbox: '/index/msgbox' //消息盒子頁面地址, , find: '/index/find' //發現頁面地址,若不開啟,剔除該項即可 , chatLog: '/im/chatlog' //聊天記錄頁面地址,若不開啟,剔除該項即可 //常規設置 , isVoice: true//是否播放聲音 , voicePath: "/publice/voice/default.mp3"//聲音提醒文件位置 相對于Applications/webApp //,brief: true //是否簡約模式(若開啟則不顯示主面板) , title: 'WebIM' //自定義主面板最小化時的標題 //,right: '100px' //主面板相對瀏覽器右側距離 //,minRight: '90px' //聊天面板最小化時相對瀏覽器右側距離 , initSkin: '3.jpg' //1-5 設置初始背景 //,skin: ['aaa.jpg'] //新增皮膚 ,isfriend: true//是否開啟好友 默認true ,isgroup: true//是否開啟群組 默認true , min: true //是否始終最小化主面板,默認false , notice: true //是否開啟桌面消息提醒,默認true , voice: false //關閉layim自帶聲音 , socketHost: '' //webSocket鏈接地址 以ws://或wss://開頭 , url_domain :''//webserver地址(非80/443端口需要帶著端口號) http://或https://開頭 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看