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
c9a148b0
authored
Nov 19, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
退出修改
parent
3346a624
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
app/Admin/Controllers/AuthController.php
+25
-0
No files found.
app/Admin/Controllers/AuthController.php
View file @
c9a148b0
...
...
@@ -4,6 +4,7 @@
use
App\Models\AdminUsers
;
use
App\Services\SmsService
;
use
Dcat\Admin\Admin
;
use
Dcat\Admin\Http\Controllers\AuthController
as
BaseAuthController
;
use
Dcat\Admin\Layout\Content
;
use
Illuminate\Http\Request
;
...
...
@@ -93,6 +94,30 @@ public function postLogin(Request $request)
]);
}
/**
* User logout.
*
* @return Redirect|string
*/
public
function
getLogout
(
Request
$request
)
{
$isPharmacy
=
Admin
::
user
()
->
isRole
(
'pharmacy'
);
$this
->
guard
()
->
logout
();
$request
->
session
()
->
invalidate
();
$path
=
admin_url
(
'auth/login'
);
// 如果是店铺角色,则追加参数,跳转到店铺登录页
if
(
$isPharmacy
)
{
$path
=
admin_url
(
'auth/login?role=store'
);
}
if
(
$request
->
pjax
())
{
return
"<script>location.href = '
$path
';</script>"
;
}
return
redirect
(
$path
);
}
// 药店管理员角色登录使用
public
function
getLoginSmsCode
(
Request
$request
)
{
...
...
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