namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
class MobileController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function login(Request $request)
{
if($request->ajax()){
$validate = Validator::make($request->all(),[
'work_num'=>"required|max:11",
'password'=>"required"
],[
'work_num.required'=>"工号不可为空",
'work_num.max'=>"工号长度有误",
'password.required'=>"密码不可为空"
]);
if($validate->fails()){
return response()->json($validate->messages());
}
}else{
return view('mobile.index');
}
}
}