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
126c721f
...
126c721fb5b9feabf1772ef4a99ff77cc62ea6a6
authored
2022-12-05 16:50:12 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
分享链接用户信息
1 parent
df5643c3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletions
app/Helper/ErrorCode.php
app/Services/PropertyTrackService.php
routes/property.php
app/Helper/ErrorCode.php
View file @
126c721
...
...
@@ -35,7 +35,9 @@ class ErrorCode
const
INVALID_TIMESTAMP
=
40016
;
const
INVALID_NONCE
=
40017
;
const
MISSING_PARAMS
=
41000
;
const
URL_CHECK_FAIL
=
42000
;
const
URL_FAIL
=
42000
;
const
URL_CHECK_FAIL
=
42001
;
/**
* @var string[]
...
...
app/Services/PropertyTrackService.php
View file @
126c721
...
...
@@ -12,6 +12,7 @@ use App\Models\Legal\PropertyTrack;
use
App\Models\Legal\PropertyTrackFile
;
use
App\Models\Legal\StakeholderContract
;
use
App\Models\Legal\Treaty
;
use
App\Models\Legal\User
;
use
App\Models\Musician\AppCompany
;
use
App\Models\Musician\AppCompanyUser
;
use
Carbon\Carbon
;
...
...
@@ -144,6 +145,28 @@ class PropertyTrackService extends Service
}
/**
* @return \Illuminate\Http\JsonResponse
*/
public
function
shareUser
()
{
$share
=
PropertyShare
::
query
()
->
where
([
'share_url_hash'
=>
crc64
(
$this
->
request
->
input
(
'share_url'
))])
->
first
();
if
(
empty
(
$share
))
{
return
Response
::
error
(
ErrorCode
::
URL_FAIL
);}
//找不到此链接
$data
=
[
'from'
=>
$share
->
from
,
'name'
=>
''
];
if
(
$share
->
from
)
{
$record
=
AppCompany
::
query
()
->
where
([
'company_id'
=>
$share
->
user_id
])
->
select
([
'company_name as name'
])
->
first
();
}
else
{
$record
=
User
::
query
()
->
where
([
'user_id'
=>
$share
->
user_id
])
->
select
([
'name'
])
->
first
();
}
$record
&&
$data
[
'name'
]
=
$record
->
name
;
return
Response
::
success
(
$data
);
}
/**
* 验证分享登录有效期
* @return \Illuminate\Http\JsonResponse
*/
...
...
routes/property.php
View file @
126c721
...
...
@@ -24,6 +24,7 @@ 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