Commit f2caf526 authored by yinxiaoling's avatar yinxiaoling

固定登录用户ces

parent 4f6dd1dc
......@@ -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 BaseController
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 = ['username'=>'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);
}
......
......@@ -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(
......
......@@ -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数据
......
......@@ -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';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment