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

nx-xcx-login-gyl

v0.1.5

Published

微信开发商登录组件

Downloads

13

Readme

nx-xcx-login-gyl

农信开发商小程序登录组件:

  • 集成手机号登录(微信)

使用

  • 在小程序根目录上执行 npm init 或 yarn init
  • 使用 npm install nx-xcx-login-gyl --save 安装小程序npm
  • 使用 npm install nx-xcx-utils --save 安装配置库
  • 勾选 详情-》本地设置 下的使用npm模块
  • 点击菜单 工具-》构建npm
  • 在使用的页面的 json 文件 usingComponents 节点下添加 "nx-xcx-login-gyl": "nx-xcx-login-gyl"

登录参数配置

  • 相关文档 https://www.npmjs.com/package/nx-xcx-utils
  • 在app.js里
   import { configLogin } from 'nx-xcx-utils';

   configLogin({
      env: 1, //环境信息,根据此配置将请求信息推送至不同的采集站,1:测试 2:预生产 3:正式
      loginPage: '登录页地址',
      failPage: '授权失败地址,ex:授权取消',
      systemId: 1,
      channel: '短信通道',
      theme: '主题配置'
   });
  • 页面中配置登录拦截
   import { logout, getLoginUser, logout, loginBehavior } from 'nx-xcx-utils';

   behaviors: [loginBehavior] // 放置于data同级处,标识页面需要登录

   // 获取登录用户
   // 如果已经登录,直接从stoge里获取用户信息
   // 如果用户未登录,先使用wx.login获取code,然后接口查询,如果用户已经绑定过,根据用户信息进行会话设置并返回,如果flag为false,则返回null,如果flag为true则reject
   getLoginUser(flag: boolean = false): Promise<LoginUser>

   getLoginUserSync(): LoginUser | null // 获取登录用户信息(同步方法),仅从stoge里获取

   // 退出
   // flag为false是仅清理stoge中用户信息,flag为true时除清理stoge中用户信息外还将解绑微信, webview中会话信息请自行清理
   logout(flag: boolean = false): Promise<boolean>
  • theme 主题(可选),可用值及对应色值 theme_sc #ff0023 theme_zx #ff2c71 theme_egg #f5cf49 theme_black #262a2f theme_gray #47525d theme_blue #2d86fe theme_green #22d7bb theme_orange #ff9600

参数说明

  • title 授权页标题,请填写小程序所属产品名称
  • icon 授权页图标,请使用小程序所属产品图标
  • retUrl 授权取消时回退页面,应该配置为小程序登录前页面(需要非登录状态可访问,不然可能造成重定向问题),由拦截器根据当前地址决定,做为动态参数传入登录页