diff --git a/app/Http/Controllers/Admin/ConfigController.php b/app/Http/Controllers/Admin/ConfigController.php index 0270762e..f3d1a829 100755 --- a/app/Http/Controllers/Admin/ConfigController.php +++ b/app/Http/Controllers/Admin/ConfigController.php @@ -19,16 +19,16 @@ class ConfigController extends Controller return response([ 'data' => [ 'invite' => [ - 'invite_force' => (int)config('v2board.invite_force', env('V2BOARD_INVITE_FORCE')), - 'invite_commission' => config('v2board.invite_commission', env('V2BOARD_INVITE_COMMISSION')), - 'invite_gen_limit' => config('v2board.invite_gen_limit', env('V2BOARD_INVITE_GEN_LIMIT')), - 'invite_never_expire' => config('v2board.invite_never_expire', env('V2BOARD_NEVER_EXPIRE')) + 'invite_force' => (int)config('v2board.invite_force', 0), + 'invite_commission' => config('v2board.invite_commission', 10), + 'invite_gen_limit' => config('v2board.invite_gen_limit', 5), + 'invite_never_expire' => config('v2board.invite_never_expire', 0) ], 'site' => [ - 'stop_register' => (int)config('v2board.stop_register', env('V2BOARD_STOP_REGISTER')), - 'email_verify' => (int)config('v2board.email_verify', env('V2BOARD_EMAIL_VERIFY')), - 'app_name' => config('v2board.app_name', env('APP_NAME')), - 'app_url' => config('v2board.app_url', env('APP_URL')) + 'stop_register' => (int)config('v2board.stop_register', 0), + 'email_verify' => (int)config('v2board.email_verify', 0), + 'app_name' => config('v2board.app_name', 'V2Board'), + 'app_url' => config('v2board.app_url') ], 'pay' => [ // alipay diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index 920fd82b..189510b0 100755 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -72,7 +72,7 @@ class OrderController extends Controller $order->total_amount = $plan[$request->input('cycle')]; if ($user->invite_user_id) { $order->invite_user_id = $user->invite_user_id; - $order->commission_balance = $order->total_amount * (config('v2board.invite_commission', env('V2BOARD_INVITE_COMMISSION')) / 100); + $order->commission_balance = $order->total_amount * (config('v2board.invite_commission', 10) / 100); } if (!$order->save()) { abort(500, '订单创建失败'); @@ -180,7 +180,7 @@ class OrderController extends Controller $gateway->setNotifyUrl(config('v2board.app_url', env('APP_URL')) . '/api/v1/guest/order/alipayNotify'); $request = $gateway->purchase(); $request->setBizContent([ - 'subject' => config('v2board.app_name') . ' - 订阅', + 'subject' => config('v2board.app_name', 'V2Board') . ' - 订阅', 'out_trade_no' => $tradeNo, 'total_amount' => $totalAmount / 100 ]); diff --git a/app/Http/Controllers/Passport/CommController.php b/app/Http/Controllers/Passport/CommController.php index ec8b6f43..db012e62 100644 --- a/app/Http/Controllers/Passport/CommController.php +++ b/app/Http/Controllers/Passport/CommController.php @@ -13,7 +13,7 @@ class CommController extends Controller { public function isEmailVerify () { return response([ - 'data' => (int)config('v2board.email_verify', env('V2BOARD_EMAIL_VERIFY')) ? 1 : 0 + 'data' => (int)config('v2board.email_verify', 0) ? 1 : 0 ]); } @@ -24,12 +24,12 @@ class CommController extends Controller abort(500, '验证码已发送,请过一会在请求'); } $code = rand(100000, 999999); - $subject = config('v2board.app_name', 'V2Panel') . '邮箱验证码'; + $subject = config('v2board.app_name', 'V2Board') . '邮箱验证码'; Mail::send( 'mail.sendEmailVerify', [ 'code' => $code, - 'name' => config('v2board.app_name', 'V2Panel') + 'name' => config('v2board.app_name', 'V2Board') ], function ($message) use($email, $subject) { $message->to($email)->subject($subject); diff --git a/app/Http/Controllers/Passport/RegisterController.php b/app/Http/Controllers/Passport/RegisterController.php index 7984d4ef..bf7fb8b5 100755 --- a/app/Http/Controllers/Passport/RegisterController.php +++ b/app/Http/Controllers/Passport/RegisterController.php @@ -15,15 +15,15 @@ use App\Models\InviteCode; class RegisterController extends Controller { public function index (RegisterIndex $request) { - if ((int)config('v2board.stop_register', env('V2BOARD_STOP_REGISTER'))) { + if ((int)config('v2board.stop_register', 0)) { abort(500, '本站已关闭注册'); } - if ((int)config('v2board.invite_force', env('V2BOARD_INVITE_FOCE'))) { + if ((int)config('v2board.invite_force', 0)) { if (empty($request->input('invite_code'))) { abort(500, '必须使用邀请码才可以注册'); } } - if ((int)config('v2board.email_verify', env('V2BOARD_EMAIL_VERIFY'))) { + if ((int)config('v2board.email_verify', 0)) { $redisKey = 'sendEmailVerify:' . $request->input('email'); if (empty($request->input('email_code'))) { abort(500, '邮箱验证码不能为空'); @@ -63,7 +63,7 @@ class RegisterController extends Controller if (!$user->save()) { abort(500, '注册失败'); } - if ((int)config('v2board.email_verify', env('V2BOARD_EMAIL_VERIFY'))) { + if ((int)config('v2board.email_verify', 0)) { Redis::del($redisKey); } return response()->json([ diff --git a/routes/web.php b/routes/web.php index 325048f0..b41251c2 100755 --- a/routes/web.php +++ b/routes/web.php @@ -13,7 +13,7 @@ Route::get('/', function () { return view('app', [ - 'title' => config('v2board.app_name', env('APP_NAME')), - 'theme' => config('v2board.app_theme', env('V2BOARD_APP_THEME')) + 'title' => config('v2board.app_name', 'V2Board'), + 'theme' => config('v2board.app_theme', 1) ]); });