Download the PHP package glz/nvwa-core without Composer
On this page you can find all versions of the php package glz/nvwa-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download glz/nvwa-core
More information about glz/nvwa-core
Files in glz/nvwa-core
Download glz/nvwa-core
More information about glz/nvwa-core
Files in glz/nvwa-core
Please rate this library. Is it a good library?
Informations about the package nvwa-core
nvwaCommon.NvwaApi
负责远程调用相关的接口
nvwaCommon.NvwaApi.NvwaUic
负责远程取回用户信息相关的接口
服务器端使用方法
1. 引入NvwaUic
执行
2. 设置app secret
修改.env文件,增加内容:
3. 给某个controller添加回调方法:
客户端检查到用户未登陆时,会引导用户到服务器
客户端使用方法:
1. 引入NvwaUic
执行
2. 设置中间件
修改,修改变量,给这个成员变量添加一项:
3. 在路由中引用中间件:
在routes里,引用这个middleware,示例如下:
4.设置认证服务器的地址,密钥:
请在.env中设置这一项:
注意,密钥和用户认证的服务端应该相同。
5.在您的代码中取得用户信息
只需要调用即能得到RemoteUser的实例(存储了当前存入的用户信息);
示例代码:
客户端的临时方法
有时没有联网,或是服务器端有故障 ,怎么办呢? 也有办法,让客户端并不实时到服务器去校验. 步聚如下:
1. 确保引入了nvwa-common:
2. 设置.env文件,以开启假用户模式:
好了,现在在你的代码里启用 就总是能返回一个用户对象了.
All versions of nvwa-core with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.5.9
snoopy/snoopy Version >=1.0
firebase/php-jwt Version >=3.0
vlucas/phpdotenv Version ~2.2
snoopy/snoopy Version >=1.0
firebase/php-jwt Version >=3.0
vlucas/phpdotenv Version ~2.2
The package glz/nvwa-core contains the following files
Loading the files please wait ....