You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
866 B
30 lines
866 B
<?php |
|
require '../idapi_config.php'; |
|
require '../idapi_function.php'; |
|
require '../idapi_class_getuser.php'; |
|
|
|
header("Content-Type: application/json; charset=utf-8"); |
|
|
|
// sid |
|
$getSid = htmlspecialchars($_GET['sid']); |
|
if($getSid){ |
|
$re_getcode = json_decode(CallInterface(API_URL.'/v1/user/getUserCode?sid='.$getSid,'GET'),true); |
|
if($re_getcode['status']===1){ |
|
$fr_id_auth = $re_getcode['data']['code']; |
|
$sid_ckauth = id_CKdecrypt($fr_id_auth); |
|
$sid_ckauthinfo = $sid_ckauth['client']; |
|
|
|
setcookie('fr_access_token',$sid_ckauth['access_token'],time()+3600*24*365,'/'); |
|
setcookie('fr_uid',$sid_ckauthinfo['uid'],time()+3600*24*365,'/'); |
|
setcookie('fr_appid',$sid_ckauthinfo['appid'],time()+3600*24*365,'/'); |
|
setcookie('fr_id_auth',$fr_id_auth,time()+3600*24*365,'/'); |
|
} |
|
else{ |
|
$return_json = json_encode($re_getcode); |
|
echo $return_json; |
|
} |
|
} |
|
|
|
|
|
?> |
|
|
|
|