如何在每次注册时为申请人生成自动令牌 [英] How to generate automatic tokens for applicants on each registration

查看:89
本文介绍了如何在每次注册时为申请人生成自动令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要护照系统的代码生成代码。

一天内只能提供50个代币,而第51个注册人应该在第二天获得第一个代币......

请尽快重播...

Need the Token generation code for passport system.
only 50 tokens should be given in a single day,and the 51st registering person should get the first token for the next day...
Please replay As soon as possible...

推荐答案

跟踪生成的令牌(或至少计数数据库(或文件系统中的某个位置)生成的令牌)。然后在每天50个用户之后停止令牌生成。



这是一个开销,但它将确保只有50个用户登录到您的应用程序。



存储内存也可以实现,但是如果您的应用程序崩溃或重新启动就有风险,这个计数可能会丢失。
Keep a track of tokens generated (or atleast count of tokens generated) in the database (or somewhere on the file system). Then stop token generation after 50 users per day.

Its an overhead, but it will ensure only a fifty users login to you application.

Storing in-memory can also be implemented, but it is risky as if your application crashes or restarts, this count could be lost.


这篇关于如何在每次注册时为申请人生成自动令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆