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
96ada89a
authored
Nov 21, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录页判断
parent
e2796ff9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
.env.example
+1
-0
app/Admin/Controllers/AuthController.php
+7
-1
No files found.
.env.example
View file @
96ada89a
...
...
@@ -3,6 +3,7 @@ APP_ENV=local
APP_KEY=base64:X9/EwE4Bb65OLiZ54TizbwXD0cceNHFPTLNvP1xJQrY=
APP_DEBUG=true
APP_URL=http://localhost
APP_STORE_URL=https://药店域名
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
...
...
app/Admin/Controllers/AuthController.php
View file @
96ada89a
...
...
@@ -16,11 +16,17 @@ class AuthController extends BaseAuthController
public
function
getLogin
(
Content
$content
)
{
// 获取请求域名
$requestDomain
=
request
()
->
host
();
// 不带协议|不带端口
// env中配置的药店端域名
$parsedUrl
=
parse_url
(
env
(
'APP_STORE_URL'
));
$appStoreUrl
=
$parsedUrl
[
'host'
];
// 获取角色参数
$role
=
request
()
->
get
(
'role'
);
// 根据角色参数决定登录页面
if
(
$role
===
'store'
)
{
if
(
(
$requestDomain
==
$appStoreUrl
)
||
(
$role
===
'store'
)
)
{
$this
->
view
=
'admin.loginstore'
;
// 店铺管理员登录页面
}
else
{
$this
->
view
=
'admin.login'
;
// 默认管理员登录页面
...
...
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