getAuth(); $id_ckauthinfo = $id_ckauth['client']; //刷新access_token if($id_ckauthinfo['uid'] && time() > $id_ckauth['expires_time']){ $id_ckuser = id_CKdecrypt($get_cookie); $id_ckuserinfo = $id_ckuser['client']; $data = '&appid='.$id_ckuserinfo['appid'].'&uid='.$id_ckuserinfo['uid'].'&refresh_token='.$id_ckuser['refresh_token']; $re_login = CallInterface(API_URL.'/v1/token/refresh/'.$data,'GET'); $jsonarr = json_decode($re_login,true); if($jsonarr['message']=='success'){ $new_json = json_encode($jsonarr['data'],JSON_UNESCAPED_UNICODE); $u_data = id_aes_encrypt($new_json, API_KEY); header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); setcookie('fr_id_auth',$u_data,time()+3600*24*14,'/'); }else{ setcookie('fr_id_auth','',0,'/'); } $str['code']=200; $str['message']='success'; $str['data']['access_token'] = $jsonarr['data']['access_token']; $str['data']['appid'] = $jsonarr['data']['client']['appid']; $str['data']['uid'] = $jsonarr['data']['client']['uid']; $str['data']['ref'] = 1; $return_json = json_encode($str); echo $return_json; }else{ $run_json = array ( 'access_token' => $id_ckauth['access_token'], 'appid' => $id_ckauthinfo['appid'], 'uid' => $id_ckauth['client']['uid'], ); echo json_encode($run_json); } ?>