PHP 简单Token校验

/**
 * api token校验
 * $token  token 字符串
 * $path 当前访问路径
 * 
 */
public function checkToken($token,$path){
	$token_server = md5(strtolower($path.date("YmdH").C("tokenstr")));

	if(!strcasecmp($token,$token_server)){
		return true;
	}else{
		$this->setReturnValue(0, 'token 验证失败', null);
	}
}

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Back To Top

鄂ICP备17008157号-1