Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Cong.Zhao
/
musician-api.hikoon.com
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
78ad3909
...
78ad3909ff3d2e39ea4c6d84203f58aa703eba77
authored
2022-12-05 17:17:27 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
分享链接用户信息
1 parent
126c721f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
app/Helper/Helpers.php
app/Services/PropertyTrackService.php
app/Helper/Helpers.php
View file @
78ad390
...
...
@@ -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
),
'+/'
,
'-_'
));
}
}
...
...
app/Services/PropertyTrackService.php
View file @
78ad390
...
...
@@ -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
();
}
...
...
Please
register
or
sign in
to post a comment