Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵增煜
/
tzt-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6d1f9aca
authored
Nov 20, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
药店登录
parent
fd428f13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
app/Admin/Controllers/AuthController.php
+3
-4
No files found.
app/Admin/Controllers/AuthController.php
View file @
6d1f9aca
...
...
@@ -55,16 +55,15 @@ public function postLogin(Request $request)
return
$this
->
validationErrorsResponse
(
$validator
);
}
$user
=
AdminUsers
::
where
([
'username'
=>
$credentials
[
'username'
]])
->
first
();
$user
=
AdminUsers
::
w
ith
(
'roles'
)
->
w
here
([
'username'
=>
$credentials
[
'username'
]])
->
first
();
if
(
isset
(
$user
->
is_block
)
&&
$user
->
is_block
)
{
return
$this
->
validationErrorsResponse
([
$this
->
username
()
=>
'账号异常,请联系管理员!'
,
]);
}
// 检查用户角色是否为 pharmacy
// if ($role === 'store' && $user && $user->role === 'pharmacy') {
if
(
$role
===
'store'
)
{
$isPharmacy
=
$user
->
roles
->
pluck
(
'slug'
)
->
contains
(
'pharmacy'
);
if
(
$role
===
'store'
&&
$user
&&
$isPharmacy
)
{
// 验证短信验证码
$verificationCode
=
$request
->
input
(
'verification_code'
);
// 假设您有一个方法来验证短信验证码
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment