update: config

This commit is contained in:
tokumeikoi 2021-01-08 01:33:11 +09:00
parent 633b9ad912
commit a55647ab7a
7 changed files with 35 additions and 18 deletions

View File

@ -47,7 +47,8 @@ class ConfigController extends Controller
'invite_never_expire' => config('v2board.invite_never_expire', 0), 'invite_never_expire' => config('v2board.invite_never_expire', 0),
'commission_first_time_enable' => config('v2board.commission_first_time_enable', 1), 'commission_first_time_enable' => config('v2board.commission_first_time_enable', 1),
'commission_auto_check_enable' => config('v2board.commission_auto_check_enable', 1), 'commission_auto_check_enable' => config('v2board.commission_auto_check_enable', 1),
'commission_withdraw_limit' => config('v2board.commission_withdraw_limit', 100) 'commission_withdraw_limit' => config('v2board.commission_withdraw_limit', 100),
'commission_withdraw_method' => config('v2board.commission_withdraw_method', Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT)
], ],
'site' => [ 'site' => [
'safe_mode_enable' => (int)config('v2board.safe_mode_enable', 0), 'safe_mode_enable' => (int)config('v2board.safe_mode_enable', 0),

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\User; namespace App\Http\Controllers\User;
use App\Utils\Dict;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
@ -12,7 +13,8 @@ class CommController extends Controller
return response([ return response([
'data' => [ 'data' => [
'isTelegram' => (int)config('v2board.telegram_bot_enable', 0), 'isTelegram' => (int)config('v2board.telegram_bot_enable', 0),
'stripePk' => config('v2board.stripe_pk_live') 'stripePk' => config('v2board.stripe_pk_live'),
'withdraw_methods' => config('v2board.commission_withdraw_method', Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT)
] ]
]); ]);
} }

View File

@ -8,6 +8,7 @@ use App\Http\Requests\User\TicketWithdraw;
use App\Jobs\SendTelegramJob; use App\Jobs\SendTelegramJob;
use App\Models\User; use App\Models\User;
use App\Services\TelegramService; use App\Services\TelegramService;
use App\Utils\Dict;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Models\Ticket; use App\Models\Ticket;
use App\Models\TicketMessage; use App\Models\TicketMessage;
@ -152,6 +153,15 @@ class TicketController extends Controller
public function withdraw(TicketWithdraw $request) public function withdraw(TicketWithdraw $request)
{ {
if (!in_array(
$request->input('withdraw_method'),
config(
'v2board.commission_withdraw_method',
Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT
)
)) {
abort(500, '不支持的提现方式');
}
$user = User::find($request->session()->get('id')); $user = User::find($request->session()->get('id'));
$limit = config('v2board.commission_withdraw_limit', 100); $limit = config('v2board.commission_withdraw_limit', 100);
if ($limit > ($user->commission_balance / 100)) { if ($limit > ($user->commission_balance / 100)) {
@ -169,13 +179,7 @@ class TicketController extends Controller
DB::rollback(); DB::rollback();
abort(500, '工单创建失败'); abort(500, '工单创建失败');
} }
$methodText = [ $message = "提现方式:{$request->input('withdraw_method')}\r\n提现账号:{$request->input('withdraw_account')}\r\n";
'alipay' => '支付宝',
'paypal' => '贝宝(Paypal)',
'usdt' => 'USDT',
'btc' => '比特币'
];
$message = "提现方式:{$methodText[$request->input('withdraw_method')]}\r\n提现账号:{$request->input('withdraw_account')}\r\n";
$ticketMessage = TicketMessage::create([ $ticketMessage = TicketMessage::create([
'user_id' => $request->session()->get('id'), 'user_id' => $request->session()->get('id'),
'ticket_id' => $ticket->id, 'ticket_id' => $ticket->id,

View File

@ -23,6 +23,7 @@ class ConfigSave extends FormRequest
'commission_first_time_enable' => 'in:0,1', 'commission_first_time_enable' => 'in:0,1',
'commission_auto_check_enable' => 'in:0,1', 'commission_auto_check_enable' => 'in:0,1',
'commission_withdraw_limit' => 'nullable|numeric', 'commission_withdraw_limit' => 'nullable|numeric',
'commission_withdraw_method' => 'nullable|array',
// site // site
'stop_register' => 'in:0,1', 'stop_register' => 'in:0,1',
'email_verify' => 'in:0,1', 'email_verify' => 'in:0,1',
@ -34,7 +35,7 @@ class ConfigSave extends FormRequest
'try_out_plan_id' => 'integer', 'try_out_plan_id' => 'integer',
'try_out_hour' => 'numeric', 'try_out_hour' => 'numeric',
'email_whitelist_enable' => 'in:0,1', 'email_whitelist_enable' => 'in:0,1',
'email_whitelist_suffix' => '', 'email_whitelist_suffix' => 'nullable|array',
'email_gmail_limit_enable' => 'in:0,1', 'email_gmail_limit_enable' => 'in:0,1',
'recaptcha_enable' => 'in:0,1', 'recaptcha_enable' => 'in:0,1',
'recaptcha_key' => '', 'recaptcha_key' => '',

View File

@ -14,7 +14,7 @@ class TicketWithdraw extends FormRequest
public function rules() public function rules()
{ {
return [ return [
'withdraw_method' => 'required|in:alipay,paypal,usdt,btc', 'withdraw_method' => 'required',
'withdraw_account' => 'required' 'withdraw_account' => 'required'
]; ];
} }

View File

@ -15,4 +15,9 @@ class Dict
'yeah.net', 'yeah.net',
'foxmail.com' 'foxmail.com'
]; ];
CONST WITHDRAW_METHOD_WHITELIST_DEFAULT = [
'支付宝',
'USDT',
'Paypal'
];
} }

View File

@ -1,11 +1,14 @@
port: 8890 port: 7890
socks-port: 8891 socks-port: 7891
allow-lan: false # redir-port: 7892
# tproxy-port: 7893
# mixed-port: 7890
allow-lan: true
bind-address: "*"
mode: rule mode: rule
log-level: info log-level: info
external-controller: 127.0.0.1:9091 external-controller: 127.0.0.1:9090
experimental:
ignore-resolve-fail: true
dns: dns:
enable: true enable: true
# listen: 0.0.0.0:53 # listen: 0.0.0.0:53
@ -18,15 +21,16 @@ dns:
fake-ip-range: 198.18.0.1/16 fake-ip-range: 198.18.0.1/16
use-hosts: true use-hosts: true
nameserver: nameserver:
- https://dns.alidns.com/dns-query
- https://doh.pub/dns-query - https://doh.pub/dns-query
fallback: fallback:
- tls://1.0.0.1:853 - tls://1.0.0.1:853
- https://cloudflare-dns.com/dns-query
- https://dns.google/dns-query - https://dns.google/dns-query
fallback-filter: fallback-filter:
geoip: true geoip: true
ipcidr: ipcidr:
- 240.0.0.0/4 - 240.0.0.0/4
- 0.0.0.0/32
proxies: proxies: