小更新
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
"topthink/think-orm": "^2.0.28",
|
||||
"topthink/think-view": "^1.0",
|
||||
"overtrue/wechat": "~4.0",
|
||||
"xin/helper": "^1.0",
|
||||
"sent/think-auth": "^1.1",
|
||||
"sent/think-jwt": "^1.0.0",
|
||||
"sent/tree": "^1.0.0"
|
||||
@@ -51,13 +50,5 @@
|
||||
"@php think service:discover",
|
||||
"@php think vendor:publish"
|
||||
]
|
||||
},
|
||||
"repositories":
|
||||
{
|
||||
"packagist":
|
||||
{
|
||||
"type": "composer",
|
||||
"url": "https://packagist.phpcomposer.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
config/jwt.php
Normal file
17
config/jwt.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'secret' => env('JWT_SECRET'),
|
||||
//Asymmetric key
|
||||
'public_key' => env('JWT_PUBLIC_KEY'),
|
||||
'private_key' => env('JWT_PRIVATE_KEY'),
|
||||
'password' => env('JWT_PASSWORD'),
|
||||
//JWT time to live
|
||||
'ttl' => env('JWT_TTL', 60),
|
||||
//Refresh time to live
|
||||
'refresh_ttl' => env('JWT_REFRESH_TTL', 20160),
|
||||
//JWT hashing algorithm
|
||||
'algo' => env('JWT_ALGO', 'HS256'),
|
||||
|
||||
'blacklist_storage' => sent\jwt\provider\storage\Tp6::class,
|
||||
];
|
||||
@@ -12,13 +12,31 @@ use think\facade\Route;
|
||||
|
||||
Route::rule('/', 'Index/index');
|
||||
Route::rule('search', 'Index/search');
|
||||
Route::rule('lists', 'Index/lists');
|
||||
Route::rule('detail', 'Index/detail');
|
||||
Route::rule('category', 'Index/category');
|
||||
Route::rule('topic-:id', 'Index/topic');
|
||||
|
||||
Route::group('admin', function(){
|
||||
Route::group('admin', function () {
|
||||
Route::rule('/', 'admin.Index/index');
|
||||
Route::rule('login', 'admin.Index/login');
|
||||
Route::rule('logout', 'admin.Index/logout');
|
||||
Route::rule(':controller/:function', 'admin.:controller/:function');
|
||||
});
|
||||
|
||||
Route::group('user', function () {
|
||||
Route::rule('/', 'admin.Index/index');
|
||||
Route::rule('login', 'user.Index/login');
|
||||
Route::rule('logout', 'user.Index/logout');
|
||||
Route::rule('register', 'user.Index/register');
|
||||
Route::rule(':controller/:function', 'user.:controller/:function');
|
||||
});
|
||||
|
||||
Route::group('api', function () {
|
||||
Route::rule('/', 'admin.Index/index');
|
||||
Route::rule('login', 'api.Index/login');
|
||||
Route::rule('register', 'api.Index/register');
|
||||
Route::rule(':controller/:function', 'api.:controller/:function');
|
||||
});
|
||||
|
||||
Route::miss('Index/miss');
|
||||
Reference in New Issue
Block a user