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

+ 10 - 1
application/index/controller/Register.php

@@ -119,7 +119,8 @@ class Register extends Common
         $appid = trim(input("post.appid/s", ''));
         $appuid = trim(input("post.appuid/s", ''));
         $token = trim(input("post.token/s", ''));
-        $nowuid = (empty($appuid) || empty($appuid)) ? uniqid('anon_') : $appid . '_' . $appuid;
+        $nowuid = (empty($appuid)) ? uniqid('anon_') : $appuid;
+        $nowuid = $appid . $nowuid;
 
         if (!empty($nowuid) && !empty($token)) {
             $old = Db::name('accounts')->where(['account_name' => $nowuid, 'tokenvip' => $token])->find();
@@ -140,6 +141,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]);
+            }
+        }
+
         NEWUSERLABLE:
         $now = time();
         $token = md5(uniqid() . rand(10000, 50000));