Showing
6 changed files
with
32 additions
and
7 deletions
| ... | @@ -57,14 +57,17 @@ class UserController extends Controller | ... | @@ -57,14 +57,17 @@ class UserController extends Controller |
| 57 | return Response::fail('',500,$validator->errors()); | 57 | return Response::fail('',500,$validator->errors()); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | + | ||
| 60 | try{ | 61 | try{ |
| 61 | $redis = Redis::connection(); | 62 | $redis = Redis::connection(); |
| 62 | 63 | ||
| 63 | if ($redis->get($request->email) !== $request->verify_code){ | 64 | if ($redis->get($request->email) !== $request->verify_code){ |
| 64 | return Response::fail('verify code failed',500); | 65 | return Response::fail('verify code failed',500); |
| 65 | } | 66 | } |
| 67 | + $data = $validator->validated(); | ||
| 68 | + $data['password'] = bcrypt($data['password']); | ||
| 66 | 69 | ||
| 67 | - $user = User::query()->create($validator->validated()); | 70 | + $user = User::query()->create($data); |
| 68 | 71 | ||
| 69 | $token = $user->createToken($user->email)->plainTextToken; | 72 | $token = $user->createToken($user->email)->plainTextToken; |
| 70 | 73 | ||
| ... | @@ -88,6 +91,6 @@ class UserController extends Controller | ... | @@ -88,6 +91,6 @@ class UserController extends Controller |
| 88 | 91 | ||
| 89 | SendVerificationMessage::dispatch($request->email); | 92 | SendVerificationMessage::dispatch($request->email); |
| 90 | 93 | ||
| 91 | - return Response::success('','发送成功'); | 94 | + return Response::success(['message'=>'发送成功'],'send success'); |
| 92 | } | 95 | } |
| 93 | } | 96 | } | ... | ... |
| ... | @@ -41,7 +41,7 @@ class SendVerificationMessage implements ShouldQueue | ... | @@ -41,7 +41,7 @@ class SendVerificationMessage implements ShouldQueue |
| 41 | 41 | ||
| 42 | $redis = Redis::connection(); | 42 | $redis = Redis::connection(); |
| 43 | 43 | ||
| 44 | - $redis->setex($this->email,$code,1800); //过期时间30分钟 | 44 | + $redis->setex($this->email,1800,$code); //过期时间30分钟 |
| 45 | 45 | ||
| 46 | Mail::to($this->email)->send(new SendVerifyCode($code)); | 46 | Mail::to($this->email)->send(new SendVerifyCode($code)); |
| 47 | } | 47 | } | ... | ... |
| ... | @@ -16,6 +16,10 @@ class AlterOneUsersTable extends Migration | ... | @@ -16,6 +16,10 @@ class AlterOneUsersTable extends Migration |
| 16 | Schema::table('users', function (Blueprint $table) { | 16 | Schema::table('users', function (Blueprint $table) { |
| 17 | 17 | ||
| 18 | $table->string('email')->after('mobile')->nullable()->comment('邮箱'); | 18 | $table->string('email')->after('mobile')->nullable()->comment('邮箱'); |
| 19 | + | ||
| 20 | + $table->string('avatar')->nullable()->change(); | ||
| 21 | + | ||
| 22 | + $table->string('state')->default(1)->change(); | ||
| 19 | }); | 23 | }); |
| 20 | } | 24 | } |
| 21 | 25 | ... | ... |
resources/lang/zh_CN/admin-make-video.php
0 → 100755
| 1 | +<?php | ||
| 2 | +return [ | ||
| 3 | + 'labels' => [ | ||
| 4 | + 'AdminMakeVideo' => 'AdminMakeVideo', | ||
| 5 | + 'admin-make-video' => 'AdminMakeVideo', | ||
| 6 | + ], | ||
| 7 | + 'fields' => [ | ||
| 8 | + 'poem_id' => '一言id', | ||
| 9 | + 'type' => '类型', | ||
| 10 | + 'video_url' => '视频地址', | ||
| 11 | + 'images_url' => '图片地址', | ||
| 12 | + 'bg_music' => '是否背景音', | ||
| 13 | + 'bgm_url' => '背景音地址', | ||
| 14 | + 'feel' => '有感', | ||
| 15 | + 'temp_id' => '模板id', | ||
| 16 | + 'thumbnail' => '封面图', | ||
| 17 | + 'thumbnail_url' => '封面图地址', | ||
| 18 | + ], | ||
| 19 | + 'options' => [ | ||
| 20 | + ], | ||
| 21 | +]; |
| ... | @@ -18,6 +18,7 @@ Route::prefix('v1')->namespace('App\Http\Controllers\V1')->group(function (Route | ... | @@ -18,6 +18,7 @@ Route::prefix('v1')->namespace('App\Http\Controllers\V1')->group(function (Route |
| 18 | /** 用户账密登录*/ | 18 | /** 用户账密登录*/ |
| 19 | $api->post('/login', 'UserController@login'); | 19 | $api->post('/login', 'UserController@login'); |
| 20 | $api->post('/register', 'UserController@register'); | 20 | $api->post('/register', 'UserController@register'); |
| 21 | + $api->post('/verify', 'UserController@verify'); | ||
| 21 | }); | 22 | }); |
| 22 | 23 | ||
| 23 | Route::prefix('v1')->namespace('App\Http\Controllers\V1')->group(function (Router $api){ | 24 | Route::prefix('v1')->namespace('App\Http\Controllers\V1')->group(function (Router $api){ | ... | ... |
| ... | @@ -24,10 +24,6 @@ Route::get('/', function () { | ... | @@ -24,10 +24,6 @@ Route::get('/', function () { |
| 24 | return view('welcome'); | 24 | return view('welcome'); |
| 25 | }); | 25 | }); |
| 26 | 26 | ||
| 27 | -Route::get('/phpinfo', function () { | ||
| 28 | - phpinfo(); | ||
| 29 | -}); | ||
| 30 | - | ||
| 31 | 27 | ||
| 32 | Route::get('/create_overlay', function () { | 28 | Route::get('/create_overlay', function () { |
| 33 | header ('Content-Type: image/png'); | 29 | header ('Content-Type: image/png'); | ... | ... |
-
Please register or login to post a comment