增加user_token

master
tpingzhang 5 years ago
parent 65fea2e0a8
commit 72947a4e3d

@ -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; $map['account'] = $account;
/* 获取用户数据 */ /* 获取用户数据 */
$user = $this->where($map)->find(); $user = $this->where($map)->find();
@ -1077,6 +1077,7 @@ class UserModel extends Model{
$data["login_time"] = NOW_TIME; $data["login_time"] = NOW_TIME;
$data["login_ip"] = get_client_ip(); $data["login_ip"] = get_client_ip();
$data["token"] = $this->generateToken($uid,$account,$password); $data["token"] = $this->generateToken($uid,$account,$password);
$data["user_token"] = $this->generateToken($uid,$account,$password);
if($user_fgame_id){ if($user_fgame_id){
$model->save($data); $model->save($data);
}else{ }else{

@ -273,6 +273,7 @@ class UserController extends BaseController
"sex" => $user_res["sex"] ? $user_res["sex"] : 0, "sex" => $user_res["sex"] ? $user_res["sex"] : 0,
"is_platform" => $platform, "is_platform" => $platform,
"token" => $result['token'], "token" => $result['token'],
"user_token" => $user_res['user_token'],
"OTP_token" => think_encrypt(json_encode(array('uid' => $user["user_id"], 'time' => time())), 1), "OTP_token" => think_encrypt(json_encode(array('uid' => $user["user_id"], 'time' => time())), 1),
'is_uc' => 0, 'is_uc' => 0,
"is_open_small_account" => C('IS_OPEN_SMALL_ACCOUNT'), "is_open_small_account" => C('IS_OPEN_SMALL_ACCOUNT'),

Loading…
Cancel
Save