zhangguidong 2 gadi atpakaļ
vecāks
revīzija
fd566d4311
2 mainītis faili ar 25 papildinājumiem un 2 dzēšanām
  1. 2 2
      application/common/model/User.php
  2. 23 0
      config/jwt.php

+ 2 - 2
application/common/model/User.php

@@ -44,9 +44,9 @@ class User Extends Model
         if (!empty($session_key['session_key'])) {
             $openid = $session_key['openid'];
             //数据库是否已注册
-            $user = Db::name('q_user')
+            $user = Db::name('q_member')
                 ->where('openid',$openid)
-                ->where('is_del',1)
+                ->where('is_deleted',1)
                 ->find();
             if ($user){
                 $token = JWT::encode($user,config('jwt.key'));

+ 23 - 0
config/jwt.php

@@ -0,0 +1,23 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ThinkAdmin
+// +----------------------------------------------------------------------
+// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// +----------------------------------------------------------------------
+// | 官方网站: http://demo.thinkadmin.top
+// +----------------------------------------------------------------------
+// | 开源协议 ( https://mit-license.org )
+// +----------------------------------------------------------------------
+// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
+// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
+// +----------------------------------------------------------------------
+
+return [
+    'key' => 'hdl@39ajj$', //自定义key的值
+    'lat' => time(),   // 签发时间
+    'nbf' => time(),   // 生效时间
+    'exp' => time()+24 * 3600 , // 过期时间
+
+
+];