npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

plugins-huansi-im-ui

v1.0.7

Published

IM 通讯 插件

Downloads

4

Readme

IM 服务插件 plugins-huansi-im-ui

简介

基于vue 2.6.11。功能,聊天、通讯录、发送即消息等。需要配合接口服务运行。

安装插件

# 使用npm 

npm i plugins-huansi-im-ui --save

安装依赖

//需要安装依赖包 package.json
"mqtt": "^4.3.7",

使用插件

    //引入 外抛方法
    import {handleSend, registerIM} from "plugins-huansi-im-ui";

    methods: {
        //初始化IM通讯
        registerI() {
            let IM_TOKEN = 'eyJhbGciOiJSUzI1NiIsImtpZCI6IjFCQzIzNkNFNUZDRkY2ODBGQjdFRTcwNjNGQzAxQUY3IiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE2NDQ1NjEwNTAsImV4cCI6MTY0NDU2NDY1MCwiaXNzIjoiaHR0cHM6Ly90ZXN0LWhhbmd6aG91Lm9hdXRoLnNhYXMuaHVhbnNpLm5ldCIsImF1ZCI6WyJVc2VyUmlnaHQiLCJodHRwczovL3Rlc3QtaGFuZ3pob3Uub2F1dGguc2Fhcy5odWFuc2kubmV0L3Jlc291cmNlcyJdLCJjbGllbnRfaWQiOiJ3ZWItY29tbW9uLWxvY2FsaG9zdCBjbGllbnQiLCJzdWIiOiIxNDgxODE5OTU5Njk0ODA3MDQxIiwiYXV0aF90aW1lIjoxNjQ0NTYxMDQ5LCJpZHAiOiJsb2NhbCIsInByZWZlcnJlZF91c2VybmFtZSI6IjE4NjE2OTM4ODI0IiwibmFtZSI6Indtd3giLCJ0ZW5hbnRfaWQiOiIxNDc2Nzg3Njg2MTY4NzI3NTUyIiwidGVuYW50X2NvZGUiOiJjc3p3aHp3aGR0ZCIsImlzX2FkbWluIjpmYWxzZSwic2lkIjoiNzE4NjVGQzBFRUZERDUzRjkyNzdGQzk4REUyQTc4M0QiLCJpYXQiOjE2NDQ1NjEwNTAsInNjb3BlIjpbIm9wZW5pZCIsInByb2ZpbGUiLCJVc2VyUmlnaHQiXSwiYW1yIjpbInB3ZCJdfQ.iM6_o1U7boJ_odOyw6LJ_qdQp4vbyTsxtZo6Zk53X6dO3ShqjR9z2nOke5q4RYjPUWrMcxCONtHKAQfgc7MzJmSTPAVt313e6U4fBakIGsW003DNyQ3gf8VxjCN8KqsRsPGpS6bcqFNpjWp2FBq3vBbbS8wRfQamWPa_PdB279_Uhdz_Ra6o-Q7BtAYGv8xSntUfVbi9veo8mfPsilPGodjkIxL4SY_-WKQim3aKucbqGEQ0qw_yc96C6vVqHI9IaMblB3iMHmnkS7lorE_y1gIaO1hyIctxwmapFP1QT-hc_WDvQpzhxXfN6shvxHMyLwK3zGU3yDK2vF7BcXKd3g'
            let IM_API_URL = 'http://im-service.test.huansi.net'
            let IM_BROKER_URL = 'ws://ws.dev.huansi.net/mqtt'

            registerIM(IM_TOKEN, IM_API_URL, IM_BROKER_URL, this.returnMessage)
        },

        //回调 消息接收
        returnMessage(message) {
            // debugger;
            console.log('---handle message:' + JSON.stringify(message))
        },

        //发送消息
        sendMessage() {
            let toContactId = '1' //接收消息的联系人ID
            let message = {
                type: 'text',
                content: '消息测试-1',
            }
            handleSend(toContactId, message, this.next)
        },

        //回调 发送消息返回状态
        next(status) {
            if (status) {
                console.log('---send message wrong:' + status)
            } else {
                console.log('---send message success:' + status)
            }
        }
    }