
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
wxsdk-handler
Advanced tools
基于jweixin的一个工具包,可用于日常html开发。 同时也可以用于vue中。
import wxHandler from "wxsdk-handler";
Vue.use(wxHandler, {
appid: xxx,
server: "xxx"
} );
this.$wx.share().auth();
import wxHandler from "wxsdk-handler";
new wxHandler({
appid: xxx,
server: xxx
}).share().auth();
一般情况下,调用share会自动请求并将相应配置输入wxsdk。 如果需要自定义则:
const wx = new wxHandler();
const wxsdk = wx.wxsdk;
wxsdk.ready(()=>{
wxsdk.updateAppMessageShareData();
...
});
wx.auth();
import wxHandler from "wxsdk-handler";
Vue.use(wxHandler, { options } );
import wxHandler from "wxsdk-handler";
new wxHandler({ options });
选项的优先级如下:优先级高的将会覆盖低的配置
wx.js > options.config > 默认 config
在你的项目根目录下创建 wx.js
module.exports = {
appid: "xxxx",
server: "http://localhost/",
path: "wx/sign",
};
将你的 wx.js 文件路径加入到或直接导入到configFile
options: {
configFile: require("./../wx.js"),
//or
configFile: "wx.js path (must absolute path)"
}
options: {
config: {
appid: "xxxx",
server: "http://localhost/",
path: "wx/sign",
}
};
wx.share({
title: "",
desc: ""
....
},()=>{
console.log('plugin is ready to use')
});
wx.auth();
默认: null
微信配置文件的路径或本身
默认: false
是否启用debug模式
默认: location.href
网页的首页地址
默认: http://localhost
后端签名接口的域名
默认: null
插件将会自动请求后端签名接口
接口的地址为域名+请求路径
默认: null
微信sdk的appid
默认: snsapi_userinfo
两个配置属性:snsapi_base/snsapi_userinfo
默认: ()=>{ console.log("wx plugin is ready!"); }
wxsdk加载完毕后的回调函数
默认:
"updateAppMessageShareData"
"updateTimelineShareData"
微信sdk的请求接口名称列表
默认: document.title
微信分享的标题
默认: title
微信分享的描述
默认: location.href
微信分享的地址
默认: null
微信分享的缩略图
默认: null
微信分享成功的回调函数
默认: null
微信分享失败的回调函数
默认: null
微信分享取消的回调函数
默认: null
微信分享按钮点击的回调函数
默认: null
微信分享接口调用完成时候的回调函数
FAQs
h5-微信封装工具
The npm package wxsdk-handler receives a total of 6 weekly downloads. As such, wxsdk-handler popularity was classified as not popular.
We found that wxsdk-handler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.