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
23203efb
...
23203efbca01292a433a01bde96fa9244f0a31d5
authored
2022-12-05 17:21:55 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
分享链接用户信息
1 parent
78ad3909
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
app/Helper/Helpers.php
app/Services/PropertyTrackService.php
routes/property.php
app/Helper/Helpers.php
View file @
23203ef
...
...
@@ -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
),
'+/'
,
'-_'
));
}
}
...
...
app/Services/PropertyTrackService.php
View file @
23203ef
...
...
@@ -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
();
}
...
...
routes/property.php
View file @
23203ef
...
...
@@ -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'
);
});
...
...
Please
register
or
sign in
to post a comment