K7

K7Blog

须知少年凌云志 曾许人间第一流.
proton
telegram

蓝天采集解密jwt密文函数插件

<?php
namespace plugin\func\process;

/**
 * JWT解密
 */
class DejwtDejwt{
	
    /**
     * jwt解密
     */
    public function dejwt($val){
        try {
            $temp = explode(".",$val);
                for ($i = 0; $i < count($temp); $i++) {
                    if (count($temp)-1>$i) {
                        $temp[$i] = base64_decode($temp[$i]);
                    }
                }
                return $temp[1];
            } catch (Exception $error) {
                return '{"error":"error"}';
            }

    }
}
?>
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.