Commit 23203efb 23203efbca01292a433a01bde96fa9244f0a31d5 by lemon

分享链接用户信息

1 parent 78ad3909
......@@ -99,11 +99,12 @@ if (!function_exists('crc64')) {
if (!function_exists('getToken')) {
/**
* @param $key
* @return void
* @return array|string|string[]
*/
function getToken($key){
$key = mt_rand();
$hash = hash_hmac("sha1", $v . mt_rand() . time(), $key, true);
$token = str_replace('=', '', strtr(base64_encode($hash), '+/', '-_'));
$key = mt_rand();
$hash = hash_hmac("sha1", mt_rand() . time(), $key, true);
return str_replace('=', '', strtr(base64_encode($hash), '+/', '-_'));
}
}
......
......@@ -186,9 +186,7 @@ class PropertyTrackService extends Service
];
$token = getToken(mt_rand());
RedisClient::instance()->set("");
RedisClient::instance()->set($token, json_encode($info), null, null, 86400);
return Response::success();
}
......
......@@ -18,11 +18,11 @@ Route::group(["prefix"=>"property", "middleware"=>['auth.identifier']], function
Route::get('/track/show', 'PropertyTrackController@show');
Route::get('/track/pending', 'PropertyTrackController@pending');
Route::get('/track/file', 'PropertyTrackController@file');
Route::post('/track/shareCreate', 'PropertyTrackController@shareCreate');
});
Route::group(["prefix"=>"property"], function (){
Route::get('/track/share', 'PropertyTrackController@share');
Route::post('/track/shareCreate', 'PropertyTrackController@shareCreate');
Route::get('/track/shareCheck', 'PropertyTrackController@shareCheck');
Route::get('/track/shareUser', 'PropertyTrackController@shareUser');
});
......