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

carbon-auth

v1.0.8

Published

碳帐户应用授权组件

Downloads

13

Readme

对接方式1--html文件引入

加入script
<script type="module" >  //引入类型为module  
    import AuthJDK from  '/carbonAuth.min.js'  //引入模块路径  
    window.onload=()=>{  
    var authRef =new AuthJDK({  
            host:”碳帐户域名”, //  默认不传指向生产,调试输入“https://authtest.tgct.com.cn”  
            id:'authlogin',  //事件绑定对象对应的domID,会往dom对象中塞个图标通过点击事件来触发弹窗
            iconPath:"",  //自定义img图标地址 ,不传则用默认图标
            params:{
                   redirect:’’,   //重定向地址,默认获取当前页面地址,授权完成后会后拼接code=xxxxxx,PC端通过postmessage方式回调   
                    roleType:’’ //权限类型,0:为普通用户,1为管理用户,
                    authType :’’ //授权类型  ‘login’为登录授权,‘address’为地址授权。现阶段只有两种,
                    appKey:’’ //对接统一碳帐户分配的维一值,请与相关对接人员获取
                    openId:’’ //上次登录授权获取的缓存标识,以免每次授权都要重新登录
            },
             callback(data){  //适用过PC端父子窗口传输信息,与redirect互斥,  
                   //弹窗登录成功回调返回对象{code:xxx,openId:xxx} ,登录失败或关闭弹窗不触发, 
                   //地址授权没有返回值
            }  
        })  
      }  
      //如果没有绑定id。则可通过authRef.open()打开弹窗
</script>  
在html中使用:
<html>
......
<span id="authlogin"></span>
......
</html>

Vue2组件引入


<script>
//命今行运行 npm install carbon-auth 安装依赖 或 直接引入文件
import AuthJDK from  'carbon-auth'  //引入模块路径  
//或将文件放入项目下如/assets/js/
import AuthJDK from ‘@/assets/js/carbonAuth.min.js’
//建议在vue生命周期mounted里使用
export default {
    data(){
        authRef=null
    },
    methods:{
        ......
        clickFn(){
            this.authRef.open()
        }
        ......
    },
    mounted(){  
        this.authref =new AuthJDK({  
                host:”碳帐户域名”, //  默认不传指向生产,调试输入“https://authtest.tgct.com.cn”  
                id:'authlogin',  //事件绑定对象对应的domID,会往dom对象中塞个图标通过点击事件来触发弹窗
                iconPath:"",  //自定义img图标地址 ,不传则用默认图标
                params:{
                       redirect:’’,   //重定向地址,默认获取当前页面地址,授权完成后会后拼接code=xxxxxx,PC端通过postmessage方式回调   
                        roleType:’’ //权限类型,0:为普通用户,1为管理用户,
                        authType :’’ //授权类型  ‘login’为登录授权,‘address’为地址授权。现阶段只有两种,
                        appKey:’’ //对接统一碳帐户分配的维一值,请与相关对接人员获取
                        openId:’’ //上次登录授权获取的缓存标识,以免每次授权都要重新登录
                },
                 callback(data){  //适用过PC端父子窗口传输信息,与redirect互斥,  
                       //弹窗登录成功回调返回对象{code:xxx,openId:xxx} ,登录失败或关闭弹窗不触发, 
                       //地址授权没有返回值
                }  
            })  
          }  
      } 
 }
</script>

Vue3组件引入

<script setup>
//命今行运行 npm install carbon-auth 安装依赖 或 直接引入文件
import AuthJDK from  'carbon-auth'  //引入模块路径  
//或将文件放入项目下如/assets/js/
import AuthJDK from ‘@/assets/js/carbonAuth.min.js’
//建议在vue生命周期mounted里使用
const authRef=ref()

const clickFn =()=>{
    authRef.value.open()
}

onMounted(()=>{
    authRef.value =new AuthJDK({  
            host:”碳帐户域名”, //  默认不传指向生产,调试输入“https://authtest.tgct.com.cn”  
            id:'authlogin',  //事件绑定对象对应的domID,会往dom对象中塞个图标通过点击事件来触发弹窗
            iconPath:"",  //自定义img图标地址 ,不传则用默认图标
            params:{
                   redirect:’’,   //重定向地址,默认获取当前页面地址,授权完成后会后拼接code=xxxxxx,PC端通过postmessage方式回调   
                    roleType:’’ //权限类型,0:为普通用户,1为管理用户,
                    authType :’’ //授权类型  ‘login’为登录授权,‘address’为地址授权。现阶段只有两种,
                    appKey:’’ //对接统一碳帐户分配的维一值,请与相关对接人员获取
                    openId:’’ //上次登录授权获取的缓存标识,以免每次授权都要重新登录
            },
             callback(data){  //适用过PC端父子窗口传输信息,与redirect互斥,  
                   //弹窗登录成功回调返回对象{code:xxx,openId:xxx} ,登录失败或关闭弹窗不触发, 
                   //地址授权没有返回值
            }  
        })  
   } 
})
</script>