Compare commits
No commits in common. "5da2c5a92e5796d8e668a3f8357538b3077b76d7" and "ae43bd3afebe7bc565499d3b892c2fc5e728d436" have entirely different histories.
5da2c5a92e
...
ae43bd3afe
@ -1,42 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Reliese Model.
|
|
||||||
* Date: Sun, 29 Jul 2018 08:54:26 +0000.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace App;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model as Eloquent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class Admin
|
|
||||||
*
|
|
||||||
* @property string $ID
|
|
||||||
* @property string $password
|
|
||||||
* @property string $name
|
|
||||||
* @property string $nick_name
|
|
||||||
* @property string $phone_number
|
|
||||||
* @property \Carbon\Carbon $created_at
|
|
||||||
* @property \Carbon\Carbon $updated_at
|
|
||||||
*
|
|
||||||
* @package App
|
|
||||||
*/
|
|
||||||
class Admin extends Eloquent
|
|
||||||
{
|
|
||||||
protected $connection = 'mysql';
|
|
||||||
protected $table = 'admin';
|
|
||||||
protected $primaryKey = 'ID';
|
|
||||||
public $incrementing = false;
|
|
||||||
|
|
||||||
protected $hidden = [
|
|
||||||
'password'
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $fillable = [
|
|
||||||
'password',
|
|
||||||
'name',
|
|
||||||
'nick_name',
|
|
||||||
'phone_number'
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Exceptions;
|
|
||||||
|
|
||||||
use Exception;
|
|
||||||
|
|
||||||
class UserNotFoundException extends Exception
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
@ -1,65 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use Validator;
|
|
||||||
use App\Receiver;
|
|
||||||
|
|
||||||
class ReceiverController extends Controller
|
|
||||||
{
|
|
||||||
public function loginPage()
|
|
||||||
{
|
|
||||||
return view('receiver.login');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function loginProcess()
|
|
||||||
{
|
|
||||||
$input = request()->all();
|
|
||||||
|
|
||||||
//輸入資料驗證
|
|
||||||
$rules = [
|
|
||||||
'email'=>[
|
|
||||||
'required',
|
|
||||||
'email',
|
|
||||||
],
|
|
||||||
'password'=>[
|
|
||||||
'required',
|
|
||||||
'min:6'
|
|
||||||
],
|
|
||||||
];
|
|
||||||
$validate = Validator::make($input,$rules);
|
|
||||||
if($validate->fails()){
|
|
||||||
return redirect('/receiver/login')
|
|
||||||
->withErrors($validate)->withInput();
|
|
||||||
}
|
|
||||||
//驗證通過,巷資料庫查詢使用者是否存在
|
|
||||||
$User = Receiver::where('email',$input['email'])->firstOrFail();
|
|
||||||
$isPasswordCorrect = $input['password'] == $User->password;
|
|
||||||
if(!$isPasswordCorrect){
|
|
||||||
//failed -> 導向至登入畫面(附帶錯誤訊息)
|
|
||||||
$error_msg = [
|
|
||||||
'msg'=>['密碼錯誤']
|
|
||||||
];
|
|
||||||
return redirect('/receiver/login')->withErrors($error_msg)
|
|
||||||
->withInput();
|
|
||||||
}
|
|
||||||
//Pass->紀錄session
|
|
||||||
/* $record = [
|
|
||||||
'user_id'=>$User->RID,
|
|
||||||
'role_id'=>'Receiver'
|
|
||||||
]; */
|
|
||||||
//session()->put($record);
|
|
||||||
// $binds = [
|
|
||||||
// 'name'=>$User->nickname
|
|
||||||
// ];
|
|
||||||
// $name = $User->nickname;
|
|
||||||
session()->put('user_id',$User->RID);
|
|
||||||
return redirect('/');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function logout()
|
|
||||||
{
|
|
||||||
session()->forget('user_id');
|
|
||||||
return redirect('/');
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,7 +3,6 @@
|
|||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@ -14,7 +13,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
Schema::defaultStringLength(191);
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
|
|
||||||
class CreateAdminTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::create('Admin', function (Blueprint $table) {
|
|
||||||
$table->string('ID');
|
|
||||||
$table->string('password');
|
|
||||||
$table->string('name');
|
|
||||||
$table->string('nick_name');
|
|
||||||
$table->string('phone_number');
|
|
||||||
$table->primary('ID');
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('admin');
|
|
||||||
}
|
|
||||||
}
|
|
@ -11,6 +11,6 @@ class DatabaseSeeder extends Seeder
|
|||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
|
// $this->call(UsersTableSeeder::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
|
|
||||||
<div class=" alert alert-danger" role="alert">
|
|
||||||
<ul>
|
|
||||||
@if($errors AND count($errors))
|
|
||||||
@foreach($errors->all() as $err)
|
|
||||||
<li>{{$err}}</li>
|
|
||||||
@endForeach
|
|
||||||
@endif
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
@ -1,7 +1,5 @@
|
|||||||
@extends('layout.app')
|
@extends('layout.app')
|
||||||
|
|
||||||
@section('title','部落客媒合系統')
|
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<button class="btn btn-primary">我想成為KOL</button>
|
<button class="btn btn-primary">我想成為KOL</button>
|
||||||
<button class="btn btn-primary">我想成為品牌/代理商</button>
|
<button class="btn btn-primary">我想成為品牌/代理商</button>
|
||||||
|
@ -4,17 +4,30 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<title>@yield('title')</title>
|
<title>部落客媒合系統</title>
|
||||||
<link rel="stylesheet" href="/css/app.css">
|
<link rel="stylesheet" href="/css/app.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||||
<a class="navbar-brand" href="/">部落客媒合系統</a>
|
<a class="navbar-brand" href="#">部落客媒合系統</a>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
@include('layout.navbar')
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
|
<ul class="navbar-nav ml-auto">
|
||||||
|
<li class="nav-item active">
|
||||||
|
<a class="nav-link" href="#">KOL登入<span class="sr-only">(current)</span></a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">品牌/代理商登入</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">後台登入</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
@yield('content')
|
@yield('content')
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
<title>@yield('title')</title>
|
|
||||||
<link rel="stylesheet" href="/css/app.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
|
||||||
<a class="navbar-brand" href="/">部落客媒合系統</a>
|
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
|
||||||
</nav>
|
|
||||||
<div class="mt-3">
|
|
||||||
@yield('content')
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script src="/js/app.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,22 +0,0 @@
|
|||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
||||||
<ul class="navbar-nav ml-auto">
|
|
||||||
@if(session()->has('user_id'))
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#">{{session()->get('user_id')}},您好</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="/receiver/logout">登出</a>
|
|
||||||
</li>
|
|
||||||
@else
|
|
||||||
<li class="nav-item active">
|
|
||||||
<a class="nav-link" href="/receiver/login">KOL登入<span class="sr-only">(current)</span></a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#">品牌/代理商登入</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#">後台登入</a>
|
|
||||||
</li>
|
|
||||||
@endif
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
@ -1,21 +0,0 @@
|
|||||||
@extends('layout.login')
|
|
||||||
|
|
||||||
@section('title','KOL登入')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
|
|
||||||
@include('components.validationErrorMsg')
|
|
||||||
<form action="" method="POST">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="InputEmail1">帳號</label>
|
|
||||||
<input type="email" name="email" value="{{old('email')}}" class="form-control" id="InputEmail1" aria-describedby="emailHelp" placeholder="請輸入電子郵件地址">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="InputPassword1">密碼</label>
|
|
||||||
<input type="password" name="password" value="{{old('password')}}" class="form-control" id="InputPassword1" placeholder="請輸入密碼">
|
|
||||||
</div>
|
|
||||||
<button type="submit" class="btn btn-primary btn-lg">登入</button>
|
|
||||||
<input type="button" class="btn btn-default btn-lg" value="取消">
|
|
||||||
{!! csrf_field() !!}
|
|
||||||
</form>
|
|
||||||
@endsection
|
|
@ -25,14 +25,13 @@ Route::get('/', 'HomeController@index');
|
|||||||
// Route::get('/dashbord', '');
|
// Route::get('/dashbord', '');
|
||||||
// });
|
// });
|
||||||
//
|
//
|
||||||
//接案者相關url
|
// //接案者相關url
|
||||||
Route::group(['prefix' => 'receiver'], function () {
|
// Route::group(['prefix' => 'receiver'], function () {
|
||||||
Route::get('/login', 'ReceiverController@loginPage');
|
// Route::get('/login', '');
|
||||||
Route::post('/login', 'ReceiverController@loginProcess');
|
// Route::post('/login', '');
|
||||||
Route::get('/logout','ReceiverController@logout');
|
// Route::get('/register', '');
|
||||||
// Route::get('/register', '');
|
// Route::post('/register', '');
|
||||||
// Route::post('/register', '');
|
// });
|
||||||
});
|
|
||||||
//
|
//
|
||||||
// //發案者相關url
|
// //發案者相關url
|
||||||
// Route::group(['prefix' => 'casebuilder'], function () {
|
// Route::group(['prefix' => 'casebuilder'], function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user