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
f2caf526
Commit
f2caf526
authored
May 15, 2020
by
yinxiaoling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
固定登录用户ces
parent
4f6dd1dc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
LoginApiController.php
app/Http/Controllers/LoginApiController.php
+5
-5
Tool.php
app/Http/Controllers/Tool.php
+4
-0
StrategySetController.php
app/Http/Controllers/strategy/StrategySetController.php
+4
-2
StrategySet.php
app/Models/StrategySet.php
+1
-1
No files found.
app/Http/Controllers/LoginApiController.php
View file @
f2caf526
...
...
@@ -5,12 +5,12 @@ namespace App\Http\Controllers;
use
Illuminate\Http\Request
;
use
App\Http\models\users
;
use
Illuminate\Support\Facades\Log
;
use
App\Http\Controllers\BaseController
;
use
App\User
;
use
Illuminate\Support\Facades\DB
;
class
LoginApiController
extends
Base
Controller
class
LoginApiController
extends
Controller
{
use
Tool
;
public
function
index
(
Request
$request
){
$param
=
$request
->
except
(
'url'
);
$url
=
$request
->
url
;
...
...
@@ -22,12 +22,12 @@ class LoginApiController extends BaseController
return $this->errorWithInfo('url验证不通过', 401);
} */
//固定登录用户
$allowLoginUser
=
[
'user
name'
=>
'yxl001'
,
'user_sn'
=>
'SYSUSER|9da548a2e392a679eb274a0b2abeb627'
,
'parent_sn'
=>
'ljs'
];
//$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
[
'username'
]){
//固定登录用户
if
(
$param
[
'username'
]
!=
$allowLoginUser
[
'user
_
name'
]){
//固定登录用户
return
$this
->
errorWithInfo
(
'用户名不正确'
,
401
);
}
...
...
app/Http/Controllers/Tool.php
View file @
f2caf526
...
...
@@ -6,6 +6,10 @@ use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route; */
trait
Tool
{
public
function
getAllowLoginUser
(){
return
[
'user_name'
=>
'yxl001'
,
'user_sn'
=>
'SYSUSER|9da548a2e392a679eb274a0b2abeb627'
,
'parent_sn'
=>
'ljs'
];
}
public
function
success
()
{
return
response
()
->
json
(
...
...
app/Http/Controllers/strategy/StrategySetController.php
View file @
f2caf526
...
...
@@ -21,6 +21,8 @@ class StrategySetController extends Controller
}
public
function
store
(
Request
$request
,
StrategyService
$StrategyService
){
$allowLoginUser
=
$this
->
getAllowLoginUser
();
$validator
=
Validator
::
make
(
$request
->
all
(),
[
'strategy_name'
=>
'required|max:30'
,
'user_sn'
=>
'required'
,
...
...
@@ -61,8 +63,8 @@ class StrategySetController extends Controller
$strategySn
=
$this
->
uidd
();
$params
[
'strategy_sn'
]
=
$strategySn
;
$params
[
'user_name'
]
=
'yxl002'
;
$params
[
'parent_sn'
]
=
'ljs'
;
$params
[
'user_name'
]
=
$allowLoginUser
[
'user_name'
]
;
$params
[
'parent_sn'
]
=
$allowLoginUser
[
'parent_sn'
]
;
$StrategySet
=
new
StrategySet
(
$params
);
$setReturn
=
$StrategySet
->
save
();
if
(
$setReturn
){
//策略保存成功,处理excel数据
...
...
app/Models/StrategySet.php
View file @
f2caf526
...
...
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class
StrategySet
extends
Model
{
protected
$fillable
=
[
'call_number'
,
'strategy_sn'
,
'strategy_name'
,
'user_sn'
,
'user_name'
,
'parent_sn'
,
'project_sn'
,
'day_type'
,
'frequency_type'
,
'call_time_set'
];
protected
$fillable
=
[
'call_number'
,
'strategy_sn'
,
'strategy_name'
,
'user_sn'
,
'user_name'
,
'parent_sn'
,
'project_sn'
,
'day_type'
,
'frequency_type'
,
'call_time_set'
,
'disabled'
];
protected
$table
=
'strategy_set'
;
...
...
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