wx-jssdk
微信h5开发工具库集合
createWxJssdk
基于wx-jssdk-ts微信公众平台SDK
- [x] updateAppMessageShareData
- [x] updateTimelineShareData
- [x] scanQRCode
// wxJssdk.ts
import { createWxJssdk } from "@bluenest/wx-jssdk";
const wxJssdk = createWxJssdk({
config: async (current) => {
// your getConfig method
const config = await getConfig();
return config;
},
});
export default wxJssdk;
// how to use
wxJssdk.updateAppMessageShareData(options)
wxJssdk.updateTimelineShareData(options)
createWxOauth
微信网页开发 /网页授权
// wxOauth.ts
import { createWxOauth } from "@bluenest/wx-jssdk";
const wxOauth = createWxOauth({
appId: "YOUR_APPID",
scope: "snsapi_userinfo",
accessToken: async (code) => {
// your accessToken method
const { data } = await accessToken(options);
// handle openId/unionId/userInfo
},
});
export default wxOauth;
// how to use
wxOauth.oauth()
ShareGuide组件
微信h5引导分享组件
- [x] 组件
- [x] 测试用例