Commit 78ad3909 78ad3909ff3d2e39ea4c6d84203f58aa703eba77 by lemon

分享链接用户信息

1 parent 126c721f
......@@ -95,3 +95,15 @@ if (!function_exists('crc64')) {
return sprintf($format, $crc);
}
}
if (!function_exists('getToken')) {
/**
* @param $key
* @return void
*/
function getToken($key){
$key = mt_rand();
$hash = hash_hmac("sha1", $v . mt_rand() . time(), $key, true);
$token = str_replace('=', '', strtr(base64_encode($hash), '+/', '-_'));
}
}
......
......@@ -4,6 +4,7 @@ namespace App\Services;
use App\Helper\CosHelper;
use App\Helper\ErrorCode;
use App\Helper\RedisClient;
use App\Helper\Response;
use App\Models\Legal\Contract;
use App\Models\Legal\PropertyShare;
......@@ -135,7 +136,7 @@ class PropertyTrackService extends Service
'share_url_hash'=> $share_url_hash,
'expire_time' => date('Y-m-d H:i:s', $expire_time),
'from' => $this->request->input('from'),
'user_id' => $this->request->input('user_id'), //用户
'user_id' => $this->request->input('from') ? $this->request->get('identifier')->company_id : $this->request->input('user_id'), //用户
'created_at' => $this->now,
])) {
return Response::success(['url'=>$share]);
......@@ -145,7 +146,7 @@ class PropertyTrackService extends Service
}
/**
* @return \Illuminate\Http\JsonResponse
* @return \Illuminate\Http\JsonResponse|mixed
*/
public function shareUser()
{
......@@ -179,7 +180,15 @@ class PropertyTrackService extends Service
}
//验证成功 - 生成token
$info = [
'track_id' => $res->pf_id,
'id' => $res->id,
];
$token = getToken(mt_rand());
RedisClient::instance()->set("");
return Response::success();
}
......