func.php 496 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: dell
  5. * Date: 2016/2/18
  6. * Time: 17:47
  7. */
  8. class func
  9. {
  10. const auth_code_expire = 5; // 单位:分钟
  11. const token_expire = 1200; // 单位:分钟
  12. // 生成验证码key
  13. public static function gen_auth_code_key($mobile)
  14. {
  15. return 'mobile_auth_code:' . $mobile;
  16. }
  17. // 生成token的key
  18. public static function gen_token_key($token)
  19. {
  20. return 'token:' . $token;
  21. }
  22. }