Comments (2)
附上解决方法:
/Api/User/User.php
添加
use App\Domain\User\UserSession as UserSessionDomain;
然后在原来检测登陆状态处替换
public function checkSession()
{
$Common = new UserSessionCommon();
$user = \PhalApi\DI()->user;
$is_login = $Common->isLogin();
return array('is_login' => $is_login);
}
from phalapi.
这是因为,user是一个内置的插件,高版本才发布的。
di注册代码位置在:
https://github.com/phalapi/phalapi/blob/master-2x/plugins/phalapi_user.php
同时,如果需要启动插件,还需要修改 https://github.com/phalapi/phalapi/blob/master-2x/config/di.php
把以下代码注释去掉:
// 加载plugins目录下的第三方应用初始化文件
// foreach (glob(API_ROOT . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . '*.php') as $pluginFile) {
// include_once $pluginFile;
// }
from phalapi.
Related Issues (20)
- 多个过滤器共同协作 HOT 1
- 源码中需要保留哪些版权信息? HOT 1
- 2-15.0版,部署在非public路径下需要自己更改代码中的文件路径 HOT 1
- MYSQL8.0 报错 HOT 2
- DataApi通用数据接口可以增加对表主键的包容性
- 修改字段后不能登录后台! HOT 2
- 用dblib连接sqlserver失败 HOT 1
- http://dev.phalapi.net/portal/ 系统频繁,请重新登录
- 参数中把+过滤了,这个是否能更改呢? HOT 1
- 支持php8吗 HOT 1
- 源码直接下载后运行就提示Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.1.3". HOT 1
- composer.json license描述与LICENSE不一致
- getClientIp 方法获取IP不唯一 HOT 1
- phalApi生成postman文档
- 数据库配置时,主键有不止1个,该如何配置?
- \PhalApi\Tool::getClientIp()兼容问题
- request::getService() 优化建议
- PhalApi开源接口框架存在xss漏洞 HOT 1
- 数据库查询默认必带id列,体验不好
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phalapi.