[PHP] 純文本查看 復(fù)制代碼
public function hook_exit_output($output){//所有接口方法執(zhí)行結(jié)束,x3.5ver1.8版本新增
/**
* 所有接口方法使用時(shí),觸發(fā)此操作!
* @param string $output 執(zhí)行結(jié)果
* 接收$output參數(shù),無需返回值,如無退出操作,則進(jìn)行下一步日志入庫。
*/
$output = json_encode($output,JSON_UNESCAPED_SLASHES);//將數(shù)組轉(zhuǎn)換成文本,如果要return返回?cái)?shù)據(jù),請將$output轉(zhuǎn)換成數(shù)組后再返回?cái)?shù)據(jù)。json_decode($output, true)
echo '這里是正常返回的值:'.$output;
echo ' </br>--------------------------------------------</<br>';
echo '這里是base64加密后返回的值:'. base64_encode($output); //base64加密后返回的值
exit();//直接退出,則實(shí)現(xiàn)日志不入庫。如果要替換原來的$output,return $output; 返回即可。
}[PHP] 純文本查看 復(fù)制代碼
這里是正常返回的值:
{"code":200,"result":"OK","count":20,"data":{"uid":"14","username":"demo","email":"demo@email.xinxiuvip.com","credits":"110224","jiaoyi":"11115","groupid":"15","grouptitle":"\u8bba\u575b\u5143\u8001","groupexpiry":"0","adminid":"0","safe":"","code":"","token":"9524CLusOhFpepQ4J9CDgalFCFepSkbwUSJry1ZKsRWUk5roMFNTRMnGOJZKkHbMHoNQ7w","sgin":"C372726D-D2946EBD-A120EA4F-106EA0B7","dateline":"1730546987","phone":"123123","qq":"31584DB55485A5DA17334471FEBB0040","douyin":"","weixin":"123","status":"0","remarks":""},"sqltime":"0.476s"}
--------------------------------------------
這里是base64加密后返回的值:
eyJjb2RlIjoyMDAsInJlc3VsdCI6Ik9LIiwiY291bnQiOjIwLCJkYXRhIjp7InVpZCI6IjE0IiwidXNlcm5hbWUiOiJkZW1vIiwiZW1haWwiOiJkZW1vQGVtYWlsLnhpbnhpdXZpcC5jb20iLCJjcmVkaXRzIjoiMTEwMjI0Iiwiamlhb3lpIjoiMTExMTUiLCJncm91cGlkIjoiMTUiLCJncm91cHRpdGxlIjoiXHU4YmJhXHU1NzViXHU1MTQzXHU4MDAxIiwiZ3JvdXBleHBpcnkiOiIwIiwiYWRtaW5pZCI6IjAiLCJzYWZlIjoiIiwiY29kZSI6IiIsInRva2VuIjoiOTUyNENMdXNPaEZwZXBRNEo5Q0RnYWxGQ0ZlcFNrYndVU0pyeTFaS3NSV1VrNXJvTUZOVFJNbkdPSlpLa0hiTUhvTlE3dyIsInNnaW4iOiJDMzcyNzI2RC1EMjk0NkVCRC1BMTIwRUE0Ri0xMDZFQTBCNyIsImRhdGVsaW5lIjoiMTczMDU0Njk4NyIsInBob25lIjoiMTIzMTIzIiwicXEiOiIzMTU4NERCNTU0ODVBNURBMTczMzQ0NzFGRUJCMDA0MCIsImRvdXlpbiI6IiIsIndlaXhpbiI6IjEyMyIsInN0YXR1cyI6IjAiLCJyZW1hcmtzIjoiIn0sInNxbHRpbWUiOiIwLjQ3NnMifQ=="