This commit is contained in:
spirit 2019-12-05 23:31:33 +08:00
parent e8e5630907
commit 14055ede78
1 changed files with 3 additions and 2 deletions

View File

@ -440,13 +440,14 @@ function get_qq_avatar(){
$qq_number = openssl_decrypt($encrypted, 'aes-128-cbc', $sakura_privkey, 0);
preg_match('/^\d{3,}$/', $qq_number, $matches);
$imgurl='https://q2.qlogo.cn/headimg_dl?dst_uin='.$matches[0].'&spec=100';
if(akina_option('qq_avatar_link')=='type_1'){
if(akina_option('qq_avatar_link')=='type_2'){
$imgdata = file_get_contents($imgurl);
header("Content-type: image/jpeg");
header("Cache-Control: max-age=86400");
echo $imgdata;
}else{
$response = new WP_REST_Response();
$response->set_status(302);
$response->set_status(301);
$response->header('Location', $imgurl);
return $response;
}