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

cw-utils

v1.0.1

Published

**历史版本** 版本号 | 发布日期 | 说明 ----- | ---------- | ------ 1.0.0 | 2021.12.27 | 注册页授权分享及部分业务逻辑融合 1.0.1 | 2021.12.30 | 声网相关内容

Downloads

1

Readme

cocos人物注册页面微信授权分享工具

历史版本
版本号 | 发布日期 | 说明 ----- | ---------- | ------ 1.0.0 | 2021.12.27 | 注册页授权分享及部分业务逻辑融合 1.0.1 | 2021.12.30 | 声网相关内容

1.安装

直接用<script>引入

在常规的前端页面中可使用<script>标签引入,此时会被注册为一个全局变量wxUtil,请通过该对象进行相关的配置

<script type="text/javascript" src="./x.x.x/xxx.js"></script> 
<script>
// 微信相关
cUtil.wxUtil.config({
  appid: 'xxx',
  redirect_uri: 'https://xxx.xxx.xxx',
  ...
})
// 声网相关
cUtil.sceneUtil.configAgora()
...
</script>

2.模块

完整模块为/dist/main,包含微信和声网的全部服务

单独打包出/dist/wxUtil、/dist/sceneUtil可下载至本地项目使用

NPM

npm install c-utils --save
import cUtil from 'c-utils'

// 微信相关
cUtil.wxUtil.config({
  appid: 'xxx',
  redirect_uri: 'https://xxx.xxx.xxx',
  ...
})
// 声网相关
cUtil.sceneUtil.configAgora()
...

原始办法

由于公司没有私服gitlab也没有配置ssh,可以将该项目克隆到node_modules

git clone https://gitlab.wdabuliu.com/w-fe/wx-utils.git

2.配置项(微信)

wxUtil.config(Object)

参数(Object)

属性 | 类型 | 默认值 | 必填 | 说明 ------------ | ---------- | -------------------- | ----- | ------ appid | String | 'wx9212f982819232cc' | 是 | 公众号appId redirect_uri | String | window.location.href | 是 | 授权回调url(最好指定一下省的我处理query参数) response_type | String | 'code' | 否 | 授权返回参数名 scope | String | 'snsapi_base' | 否 | 授权类型:snsapi_base:静默授权/snsapi_userinfo:基本信息授权,

2.1.公用方法

2.1.1授权配置

wxUtil.config({
    ...
})

2.1.2授权方法

wxUtil.wxOauth()

2.1.3获取人物信息

wxUtil.getUserInfo()

2.1.4保存人物信息

wxUtil.saveUserInfo()

3.配置项(声网)

暂无

3.1.公用方法

3.1.1配置方法,获取服务端参数

sceneUtil.configAgora()

3.1.2加入房间

sceneUtil.joinRoom()

3.1.3离开房间

sceneUtil.leaveRoom()

3.1.4调节音量(播放音量)

sceneUtil.setRemoteUserVolume()

3.1.5调节音量(采集音量)

sceneUtil.setLocalAudioTrackVolume()