接口验证之不需验证和需要验证用户token的情况

发布于 2021-10-19 14:23:43

不需验证用户token的情况:
// 验证api_token
$tokenRes = $this->checkToken(0);
if($tokenRes['status'] == 400){ // 400返回错误描述
datamsg(LOSE,$tokenRes['mess'],$tokenRes['data']);
}

需要验证用户token的情况:
// 验证api_token
$tokenRes = $this->checkToken();
if($tokenRes['status'] == 400){ // 400返回错误描述
datamsg(LOSE,$tokenRes['mess'],$tokenRes['data']);
}else{ // 成功则返回$user_id
$user_id = $tokenRes['user_id'];
}

0 条评论

发布
问题

官网
微信

官方微信