From 72947a4e3d3ef650718405885ac082f11af77e02 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 22 Oct 2019 10:54:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0user=5Ftoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Model/UserModel.class.php | 3 ++- Application/Sdk/Controller/UserController.class.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Model/UserModel.class.php b/Application/Admin/Model/UserModel.class.php index e031fb6a..8197b06c 100644 --- a/Application/Admin/Model/UserModel.class.php +++ b/Application/Admin/Model/UserModel.class.php @@ -1051,7 +1051,7 @@ class UserModel extends Model{ } } - public function login_sdk($account,$password,$type=1,$game_id,$game_name,$sdk_version){ + public function login_sdk($account,$password,$type=1,$game_id,$game_name,$sdk_version){ $map['account'] = $account; /* 获取用户数据 */ $user = $this->where($map)->find(); @@ -1077,6 +1077,7 @@ class UserModel extends Model{ $data["login_time"] = NOW_TIME; $data["login_ip"] = get_client_ip(); $data["token"] = $this->generateToken($uid,$account,$password); + $data["user_token"] = $this->generateToken($uid,$account,$password); if($user_fgame_id){ $model->save($data); }else{ diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index d8a701d5..e18a448e 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -273,6 +273,7 @@ class UserController extends BaseController "sex" => $user_res["sex"] ? $user_res["sex"] : 0, "is_platform" => $platform, "token" => $result['token'], + "user_token" => $user_res['user_token'], "OTP_token" => think_encrypt(json_encode(array('uid' => $user["user_id"], 'time' => time())), 1), 'is_uc' => 0, "is_open_small_account" => C('IS_OPEN_SMALL_ACCOUNT'),