vali 6 年之前
父節點
當前提交
824d2b78e4
共有 1 個文件被更改,包括 8 次插入7 次删除
  1. 8 7
      application/index/controller/Register.php

+ 8 - 7
application/index/controller/Register.php

@@ -130,6 +130,14 @@ class Register extends Common
             }
         }
 
+        if ($nowuid) {
+            $old = Db::name('accounts')->where(['account_name' => $nowuid])->find();
+            if ($old) {
+                Db::name('accounts')->where(['account_name' => $nowuid])->update(['last_login_time' => time()]);
+                return json(['code' => 1, 'data' => ['id' => $old['id'], 'name' => $nowuid, 'token' => $old['tokenvip']], 'msg' => '注册成功', 'tutype' => 1]);
+            }
+        }
+
         if ($token) {
             $old = db('accounts')->where(['token' => $token])->find();
             if ($old) {
@@ -141,13 +149,6 @@ class Register extends Common
             }
         }
 
-        if ($nowuid) {
-            $old = Db::name('accounts')->where(['account_name' => $nowuid])->find();
-            if ($old) {
-                Db::name('accounts')->where(['account_name' => $nowuid])->update(['last_login_time' => time()]);
-                return json(['code' => 1, 'data' => ['id' => $old['id'], 'name' => $nowuid, 'token' => $old['tokenvip']], 'msg' => '注册成功', 'tutype' => 1]);
-            }
-        }
 
         NEWUSERLABLE:
         $now = time();