Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aic_duty_strategy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yinxiaoling
aic_duty_strategy
Commits
9211204c
Commit
9211204c
authored
May 19, 2020
by
yinxiaoling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多个用户可登录代码修改
parent
dd3fa044
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
10 deletions
+20
-10
LoginApiController.php
app/Http/Controllers/LoginApiController.php
+2
-2
Tool.php
app/Http/Controllers/Tool.php
+13
-2
StrategySetController.php
app/Http/Controllers/strategy/StrategySetController.php
+5
-5
StrategyService.php
app/Service/StrategyService.php
+0
-1
No files found.
app/Http/Controllers/LoginApiController.php
View file @
9211204c
...
...
@@ -24,11 +24,11 @@ class LoginApiController extends Controller
} */
//固定登录用户
//$allowLoginUser = ['user_name'=>'yxl001','user_sn'=>'SYSUSER|9da548a2e392a679eb274a0b2abeb627','parent_sn'=>'ljs'];
$allowLoginUser
=
$this
->
getAllowLoginUser
();
if
(
empty
(
$param
[
'username'
])
||
empty
(
$param
[
'password'
]
)){
return
$this
->
errorWithInfo
(
'用户名、密码必填'
,
401
);
}
if
(
$param
[
'username'
]
!=
$allowLoginUser
[
'user_name'
]){
//固定登录用户
$allowLoginUser
=
$this
->
getAllowLoginUser
(
$param
[
'username'
],
'user_name'
);
if
(
!
$allowLoginUser
&&
$param
[
'username'
]
!=
$allowLoginUser
[
'user_name'
]){
//固定登录用户
return
$this
->
errorWithInfo
(
'用户名不正确'
,
401
);
}
...
...
app/Http/Controllers/Tool.php
View file @
9211204c
...
...
@@ -6,12 +6,23 @@ use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route; */
trait
Tool
{
public
function
getAllowLoginUser
(){
public
function
getAllowLoginUser
(
$filedValue
=
''
,
$filed
=
'user_sn'
){
//return ['user_name'=>'yxl001','user_sn'=>'SYSUSER|9da548a2e392a679eb274a0b2abeb627','parent_sn'=>'ljs'];
return
[
if
(
empty
(
$filedValue
)){
return
false
;
}
//$allowLoginUser = ['yxl001','yxl002'];
$loginUserInfo
=
[
[
'user_name'
=>
'yxl001'
,
'user_sn'
=>
'SYSUSER|9da548a2e392a679eb274a0b2abeb627'
,
'parent_sn'
=>
'ljs'
],
[
'user_name'
=>
'yxl002'
,
'user_sn'
=>
'SYSUSER|a15f5d51a8b0156d14f2d8ad2d39e111'
,
'parent_sn'
=>
'ljs'
],
];
foreach
(
$loginUserInfo
as
$k
=>
$v
){
if
(
$v
[
$filed
]
==
$filedValue
){
return
$v
;
}
}
return
false
;
}
public
function
getAllowProjects
(
$style
=
0
){
$projectInfo
=
[[
'sn'
=>
'projects|a3a4259352c8e964ad6ea6c5ee8a7208'
,
'name'
=>
'liuy-转人工测试'
],[
'sn'
=>
'projects|17a71649f886bce050d637e86a3c85e8'
,
'name'
=>
'小贷-测试林俊生'
]];
...
...
app/Http/Controllers/strategy/StrategySetController.php
View file @
9211204c
...
...
@@ -44,9 +44,7 @@ class StrategySetController extends Controller
}
public
function
store
(
Request
$request
,
StrategyService
$StrategyService
){
try
{
$allowLoginUser
=
$this
->
getAllowLoginUser
();
try
{
$validator
=
Validator
::
make
(
$request
->
all
(),
[
'strategy_name'
=>
'required|max:30'
,
'user_sn'
=>
'required'
,
...
...
@@ -91,6 +89,8 @@ class StrategySetController extends Controller
$params
[
'total'
]
=
$successTotal
;
}
$allowLoginUser
=
$this
->
getAllowLoginUser
(
$request
->
user_sn
);
$strategySn
=
$this
->
uidd
();
$params
[
'strategy_sn'
]
=
$strategySn
;
$params
[
'user_name'
]
=
$allowLoginUser
[
'user_name'
];
...
...
@@ -127,8 +127,8 @@ class StrategySetController extends Controller
}
}
//子账号列表
public
function
getUsersList
(
){
$usersInfo
=
$this
->
getAllowLoginUser
(
);
public
function
getUsersList
(
Request
$request
){
$usersInfo
=
$this
->
getAllowLoginUser
(
$request
->
user_sn
);
return
$this
->
successWithInfo
(
$usersInfo
);
}
//项目列表
...
...
app/Service/StrategyService.php
View file @
9211204c
...
...
@@ -330,7 +330,6 @@ class StrategyService
//创建任务
public
function
createdTask
(
$strategySn
=
''
){
$userInfo
=
$this
->
getAllowLoginUser
();
$today
=
date
(
'Y-m-d'
);
$whereArr
=
[[
'is_created'
,
0
],[
'call_date'
,
$today
],[
'created_fail_number'
,
'<='
,
'3'
]];
if
(
empty
(
$strategySn
)){
...
...
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