A8DOG

A8DOG

随便写写,记录折腾过程!
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.