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),
'commission_first_time_enable' => config('v2board.commission_first_time_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' => [
'safe_mode_enable' => (int)config('v2board.safe_mode_enable', 0),

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\User;
use App\Utils\Dict;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
@ -12,7 +13,8 @@ class CommController extends Controller
return response([
'data' => [
'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\Models\User;
use App\Services\TelegramService;
use App\Utils\Dict;
use Illuminate\Http\Request;
use App\Models\Ticket;
use App\Models\TicketMessage;
@ -152,6 +153,15 @@ class TicketController extends Controller
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'));
$limit = config('v2board.commission_withdraw_limit', 100);
if ($limit > ($user->commission_balance / 100)) {
@ -169,13 +179,7 @@ class TicketController extends Controller
DB::rollback();
abort(500, '工单创建失败');
}
$methodText = [
'alipay' => '支付宝',
'paypal' => '贝宝(Paypal)',
'usdt' => 'USDT',
'btc' => '比特币'
];
$message = "提现方式:{$methodText[$request->input('withdraw_method')]}\r\n提现账号:{$request->input('withdraw_account')}\r\n";
$message = "提现方式:{$request->input('withdraw_method')}\r\n提现账号:{$request->input('withdraw_account')}\r\n";
$ticketMessage = TicketMessage::create([
'user_id' => $request->session()->get('id'),
'ticket_id' => $ticket->id,

View File

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

View File

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

View File

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

View File

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