leslin / thinkphp5-restfulapi Goto Github PK
View Code? Open in Web Editor NEWrestful-api风格接口 APP接口 APP接口权限 oauth2.0 接口版本管理 接口鉴权
License: Other
restful-api风格接口 APP接口 APP接口权限 oauth2.0 接口版本管理 接口鉴权
License: Other
做成组件
在Oauth 类的certification方法中看到检测令牌不存在就返回错误信息了。
public static function certification($data = []){
$getCacheAccessToken = Cache::get(self::$accessTokenPrefix . $data['access_token']); //获取缓存access_token
Log::record($getCacheAccessToken,'notice');
**if(!$getCacheAccessToken){
return self::returnMsg(401,'fail',"access_token不存在或为空");
}**
if($getCacheAccessToken['client']['appid'] !== $data['appid']){
return self::returnMsg(401,'fail',"appid错误"); //appid与缓存中的appid不匹配
}
return $data;
}
客户端对请求是不是还要做什么判断啊 如果返回的是过期还要去刷新吗 那客户端每次ajax请求都要重复写一段去判断是否过期刷新的代码吗
请问appid和appsecret怎么分配的??
请问可以做Token JWT支持吗
我可以重置thinkphp文件夹的git地址来更新官方的最新代码不?
刷新token逻辑有问题
{"code":402,"message":"Invalid1 authentication credentials.123"}
{"code":402,"message":"Invalid1 authentication credentials."}
只是点赞 (^__^)
刷新令牌和 重新调用token 处理代码简洁些外有什么区别吗? 不断的获取token 不就是在刷新了吗? 我现在有个疑问是重复获取token的时候怎么让之前生成的,没有过期的, token 失效呢? 只能等2个小时吗? 或者写个中控服务 判断是否重复获取token?
您好,我的浏览器输入http://localhost/tp5test/public/index.php/v1/user,
报错:The requested URL /tp5test/public/index.php/v1/user was not found on this server.
我的好像少了文件,start.php,console.php
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.