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

uni-one-login

v1.0.12

Published

阿里云三大运营商一键登录

Downloads

6

Readme

Install

项目中提前安装好 阿里云相关sdk manifest.json相关配置 具体案例参考: https://ext.dcloud.net.cn/plugin?spm=a2c4g.11186623.0.0.67039a7crUNMOr&id=4297

$ npm install uni-one-login

API



import { uniOneLogin, setAuthSDKInfo, quitLoginPage, hideLoginLoading } from 'uni-one-login'

// 具体案例详见 https://ext.dcloud.net.cn/plugin?spm=a2c4g.11186623.0.0.67039a7crUNMOr&id=4297 

// 设置秘钥与获取状态code(详见下链接) 
async getResultCode(){
   const secretKey = 'uDC+IlZh7l3ysP6uCqlgpOIJJazBTVXPG746PSNrOA7TQ98GIA0d5/WmbRv1Jg+JwH1mqkqwDDMaMOLcdI5iZsFPPS0tGL3mptZlBH171r9/2KVIIz4/2uuR9qWdCwwtF0nE8KTsnXRIpkngd1E2BekFZwVKqdEy3wn78qT+5CuVA36PsQzdBZmQtEh5KkP3V5anK2gh64h66aFpqmlTfwXU+4o0VbmQBhlLHiQHwdHszVy07RK2R8PdlXhMPCdNJ/4QThg/mAxkAQoL+HAYP0m443eyTMZXbE6rQHGMBh2BNyFpCRrzrw=='

  await setAuthSDKInfo(secretKey)
}

// 获取token  fullscreenStyle-》全屏  alertStyle-》弹屏  sheetStyle-》底部弹  buildFullscreenAndImageBg-》全屏(原生图片背景)   alertAndImageBgStyle-》弹窗(原生图片背景)
// sheetAndGifBgStyle-》 底部弹窗(原生GIF背景)

async goLogin() { 
            const myConfig = {
                presentType: 'alertStyle', // 打开方式
                option: { // 配置参数 文字 样式等 具体配置看上边链接
                    uiConfig: {
                        setAppPrivacyOne: {
                            title: '用户协议',
                            url: 'https://www.taobao.com'
                        },
                        setAppPrivacyTwo: {
                            title: '隐私政策',
                            url: 'https://www.taobao.com'
                        },
                        setBackgroundUi: { // 背景图片
                            backgroundColor: '#081223',
                            imageUrl: 'https://cnnho-static.oss-cn-shanghai.aliyuncs.com/image/lizanPlanet/jxhw/images/default/no_feedback.png'
                        }
                    },
                    // widgets:{  // 授权页自定义元素

                    // }
                }
            }

            const [err, res] = await uniOneLogin(myConfig)
            if (err) { // 错误以及点击其他自定义元素
                const { widgetId } = err
                switch (widgetId) {
                    case 'otherLogin': // 其他登陆方式
                        uni.navigateTo({
                            url: '/pages/index/login/index'
                        })
                        break
                    default:
                        console.log('你猜::', widgetId)
                        break
                }
                console.log('errerrerr', err)
                return
            }
            console.log('resresresresres:::获取的token ', res)
        }


// 关闭一键登录弹框
quitLoginPage()

// 隐藏loading 解决安卓机未主动
hideLoginLoading()