New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tf-weixin

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tf-weixin

微信封装

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

微信接口封装

// 引入
import { wxInject, isWeixin, wxInvoke } from "tf-weixin";

// 判断是否微信
alert(isWeixin);

// 一般在刚进入页面的时候,注入微信相关sign信息
wxInject("url", { appId: "xxxx", secret: "yyyy" });

// 一般在点击某个按钮,调用微信相关接口
document.body.addEventListener("click", function() {
    wxInvoke("scanQRCode")
        .then(data => {
            console.log(data);
        })
        .catch(e => {
            console.log(e);
        });
});

FAQs

Package last updated on 10 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts