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 🙏

© 2026 – Pkg Stats / Ryan Hefner

com.wingjoy.login

v0.3.0

Published

登录模块

Readme

使用说明:

HttpHandler:

  • Login_UId:快速登录方式 - ID登录,在本地有记录时使用,用来不显示登录方式选择页面,玩家快速登录。
  • Login_YouKe:游客登录方式。
  • Login_Telephone:手机号码登录方式,参数为手机号码、验证码。
  • SmsCodeRequest:验证码请求,参数为手机号码。
  • SendAuthentication:实名认证,参数为姓名、身份证号码。

快速接入登录流程:

1.登录

if (LoadData.Instance.GetUserId != 0)
{
	HttpHandler.Instance().Login_UId(loginResult:(int code) =>
	{
		switch(code)
		{
			case 0:		//进入游戏
				break;
			case 100:	//需要实名认证
				break;
			case 101:	//不能进入游戏
				break;
			//~~~其他问题~~~
		}
	});		//快速登录
}
else
{
	HttpHandler.Instance().Login_YouKe(loginResult:(int code) =>
	{
		switch(code)
		{
			case 0:		//进入游戏
				break;
			case 100:	//需要实名认证
				break;
			case 101:	//不能进入游戏
				break;
			//~~~其他问题~~~
		}
	});	//注册账号并获得ID
}

HttpHandler.Instace().Login_Telephone(phoneNumber, smsCode, loginResult:(int code) =>
{
	switch(code)
	{
		case 0:		//进入游戏
			break;
		case 100:	//需要实名认证
			break;
		case 101:	//不能进入游戏
			break;
		//~~~其他问题~~~
	}
});

2.实名认证

HttpHandler.Instance().SmsCodeRequest(phoneNumber, result:(int code) =>
{
	switch(code)
	{
		case 4:		//手机号码不对
			break;
	}
});	//短信请求

HttpHandler.Instance().SendAuthentication(name, idCard, authResult:(int code) =>
{
	switch(code)
	{
		case 0:		//进入游戏
			break;
		case 101:	//不能进入游戏
			break;
	}
});	//发送实名认证信息

3.网络检测(可选)

- 重写INetCheck接口方法: HttpHandler.SetNetCheck(INetCheck checker)
- 调用RetryNetConnect进行网络连接验证,无网络连接ShowNetWarning,有网络连接HideNetWarning

ShowNetWarning()
{
	//没有网络连接弹窗提示
}

HideNetWarning()
{
	//隐藏窗口
}

HttpHandler.Instance().RetryNetConnect()

离线方式本地判断:

可以在LoginFail(code:1)的时候调用OfflineHandler.StartOfflineLogin(Action loginResult)。

本地计算:

  • OfflineHandler.CalAge(string idCard):根据身份证计算年龄并返回
  • OfflineHandler.CheckEnterSession(int age):根据年龄判断当前能否进入游戏, 0:可以进入游戏 1:不能进入游戏

格式验证方法:

  • LoginData.RegexPhone:手机验证
  • LoginData.RegexIdCard:身份证验证