mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update: language more
This commit is contained in:
parent
a5532490ba
commit
ee2ca23487
@ -8,6 +8,7 @@ use App\Services\UserService;
|
|||||||
use App\Utils\Clash;
|
use App\Utils\Clash;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Models\Server;
|
use App\Models\Server;
|
||||||
|
use Illuminate\Support\Facades\File;
|
||||||
use Symfony\Component\Yaml\Yaml;
|
use Symfony\Component\Yaml\Yaml;
|
||||||
|
|
||||||
class AppController extends Controller
|
class AppController extends Controller
|
||||||
@ -25,7 +26,13 @@ class AppController extends Controller
|
|||||||
$serverService = new ServerService();
|
$serverService = new ServerService();
|
||||||
$servers = $serverService->getAvailableServers($user);
|
$servers = $serverService->getAvailableServers($user);
|
||||||
}
|
}
|
||||||
$config = Yaml::parseFile(base_path() . '/resources/rules/app.clash.yaml');
|
$defaultConfig = base_path() . '/resources/rules/app.clash.yaml';
|
||||||
|
$customConfig = base_path() . '/resources/rules/custom.app.clash.yaml';
|
||||||
|
if (File::exists($customConfig)) {
|
||||||
|
$config = Yaml::parseFile($customConfig);
|
||||||
|
} else {
|
||||||
|
$config = Yaml::parseFile($defaultConfig);
|
||||||
|
}
|
||||||
$proxy = [];
|
$proxy = [];
|
||||||
$proxies = [];
|
$proxies = [];
|
||||||
|
|
||||||
@ -84,62 +91,4 @@ class AppController extends Controller
|
|||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function config(Request $request)
|
|
||||||
{
|
|
||||||
if (empty($request->input('server_id'))) {
|
|
||||||
abort(500, '参数错误');
|
|
||||||
}
|
|
||||||
$user = $request->user;
|
|
||||||
if ($user->expired_at < time() && $user->expired_at !== NULL) {
|
|
||||||
abort(500, '订阅计划已过期');
|
|
||||||
}
|
|
||||||
$server = Server::where('show', 1)
|
|
||||||
->where('id', $request->input('server_id'))
|
|
||||||
->first();
|
|
||||||
if (!$server) {
|
|
||||||
abort(500, '服务器不存在');
|
|
||||||
}
|
|
||||||
$json = json_decode(self::CLIENT_CONFIG);
|
|
||||||
//socks
|
|
||||||
$json->inbound->port = (int)self::SOCKS_PORT;
|
|
||||||
//http
|
|
||||||
$json->inboundDetour[0]->port = (int)self::HTTP_PORT;
|
|
||||||
//other
|
|
||||||
$json->outbound->settings->vnext[0]->address = (string)$server->host;
|
|
||||||
$json->outbound->settings->vnext[0]->port = (int)$server->port;
|
|
||||||
$json->outbound->settings->vnext[0]->users[0]->id = (string)$user->uuid;
|
|
||||||
$json->outbound->settings->vnext[0]->users[0]->alterId = (int)$server->alter_id;
|
|
||||||
$json->outbound->settings->vnext[0]->remark = (string)$server->name;
|
|
||||||
$json->outbound->streamSettings->network = $server->network;
|
|
||||||
if ($server->networkSettings) {
|
|
||||||
switch ($server->network) {
|
|
||||||
case 'tcp':
|
|
||||||
$json->outbound->streamSettings->tcpSettings = json_decode($server->networkSettings);
|
|
||||||
break;
|
|
||||||
case 'kcp':
|
|
||||||
$json->outbound->streamSettings->kcpSettings = json_decode($server->networkSettings);
|
|
||||||
break;
|
|
||||||
case 'ws':
|
|
||||||
$json->outbound->streamSettings->wsSettings = json_decode($server->networkSettings);
|
|
||||||
break;
|
|
||||||
case 'http':
|
|
||||||
$json->outbound->streamSettings->httpSettings = json_decode($server->networkSettings);
|
|
||||||
break;
|
|
||||||
case 'domainsocket':
|
|
||||||
$json->outbound->streamSettings->dsSettings = json_decode($server->networkSettings);
|
|
||||||
break;
|
|
||||||
case 'quic':
|
|
||||||
$json->outbound->streamSettings->quicSettings = json_decode($server->networkSettings);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($request->input('is_global')) {
|
|
||||||
$json->routing->settings->rules[0]->outboundTag = 'proxy';
|
|
||||||
}
|
|
||||||
if ($server->tls) {
|
|
||||||
$json->outbound->streamSettings->security = "tls";
|
|
||||||
}
|
|
||||||
die(json_encode($json, JSON_UNESCAPED_UNICODE));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class AuthController extends Controller
|
|||||||
$recaptcha = new ReCaptcha(config('v2board.recaptcha_key'));
|
$recaptcha = new ReCaptcha(config('v2board.recaptcha_key'));
|
||||||
$recaptchaResp = $recaptcha->verify($request->input('recaptcha_data'));
|
$recaptchaResp = $recaptcha->verify($request->input('recaptcha_data'));
|
||||||
if (!$recaptchaResp->isSuccess()) {
|
if (!$recaptchaResp->isSuccess()) {
|
||||||
abort(500, '验证码有误');
|
abort(500, __('Invalid code is incorrect'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((int)config('v2board.email_whitelist_enable', 0)) {
|
if ((int)config('v2board.email_whitelist_enable', 0)) {
|
||||||
@ -32,36 +32,36 @@ class AuthController extends Controller
|
|||||||
$request->input('email'),
|
$request->input('email'),
|
||||||
config('v2board.email_whitelist_suffix', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT))
|
config('v2board.email_whitelist_suffix', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT))
|
||||||
) {
|
) {
|
||||||
abort(500, '邮箱后缀不处于白名单中');
|
abort(500, __('Email suffix is not in the Whitelist'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((int)config('v2board.email_gmail_limit_enable', 0)) {
|
if ((int)config('v2board.email_gmail_limit_enable', 0)) {
|
||||||
$prefix = explode('@', $request->input('email'))[0];
|
$prefix = explode('@', $request->input('email'))[0];
|
||||||
if (strpos($prefix, '.') !== false || strpos($prefix, '+') !== false) {
|
if (strpos($prefix, '.') !== false || strpos($prefix, '+') !== false) {
|
||||||
abort(500, '不支持Gmail别名邮箱');
|
abort(500, __('Gmail alias is not supported'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((int)config('v2board.stop_register', 0)) {
|
if ((int)config('v2board.stop_register', 0)) {
|
||||||
abort(500, '本站已关闭注册');
|
abort(500, __('Registration has closed'));
|
||||||
}
|
}
|
||||||
if ((int)config('v2board.invite_force', 0)) {
|
if ((int)config('v2board.invite_force', 0)) {
|
||||||
if (empty($request->input('invite_code'))) {
|
if (empty($request->input('invite_code'))) {
|
||||||
abort(500, '必须使用邀请码才可以注册');
|
abort(500, __('You must use the invitation code to register'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((int)config('v2board.email_verify', 0)) {
|
if ((int)config('v2board.email_verify', 0)) {
|
||||||
if (empty($request->input('email_code'))) {
|
if (empty($request->input('email_code'))) {
|
||||||
abort(500, '邮箱验证码不能为空');
|
abort(500, __('Email verification code cannot be empty'));
|
||||||
}
|
}
|
||||||
if (Cache::get(CacheKey::get('EMAIL_VERIFY_CODE', $request->input('email'))) !== $request->input('email_code')) {
|
if (Cache::get(CacheKey::get('EMAIL_VERIFY_CODE', $request->input('email'))) !== $request->input('email_code')) {
|
||||||
abort(500, '邮箱验证码有误');
|
abort(500, __('Incorrect email verification code'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$email = $request->input('email');
|
$email = $request->input('email');
|
||||||
$password = $request->input('password');
|
$password = $request->input('password');
|
||||||
$exist = User::where('email', $email)->first();
|
$exist = User::where('email', $email)->first();
|
||||||
if ($exist) {
|
if ($exist) {
|
||||||
abort(500, '邮箱已存在系统中');
|
abort(500, __('Email already exists'));
|
||||||
}
|
}
|
||||||
$user = new User();
|
$user = new User();
|
||||||
$user->email = $email;
|
$user->email = $email;
|
||||||
@ -74,7 +74,7 @@ class AuthController extends Controller
|
|||||||
->first();
|
->first();
|
||||||
if (!$inviteCode) {
|
if (!$inviteCode) {
|
||||||
if ((int)config('v2board.invite_force', 0)) {
|
if ((int)config('v2board.invite_force', 0)) {
|
||||||
abort(500, '邀请码无效');
|
abort(500, __('Invalid invitation code'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$user->invite_user_id = $inviteCode->user_id ? $inviteCode->user_id : null;
|
$user->invite_user_id = $inviteCode->user_id ? $inviteCode->user_id : null;
|
||||||
@ -97,7 +97,7 @@ class AuthController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$user->save()) {
|
if (!$user->save()) {
|
||||||
abort(500, '注册失败');
|
abort(500, __('Register failed'));
|
||||||
}
|
}
|
||||||
if ((int)config('v2board.email_verify', 0)) {
|
if ((int)config('v2board.email_verify', 0)) {
|
||||||
Cache::forget(CacheKey::get('EMAIL_VERIFY_CODE', $request->input('email')));
|
Cache::forget(CacheKey::get('EMAIL_VERIFY_CODE', $request->input('email')));
|
||||||
@ -116,18 +116,18 @@ class AuthController extends Controller
|
|||||||
|
|
||||||
$user = User::where('email', $email)->first();
|
$user = User::where('email', $email)->first();
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
abort(500, '用户名或密码错误');
|
abort(500, __('Incorrect email or password'));
|
||||||
}
|
}
|
||||||
if (!Helper::multiPasswordVerify(
|
if (!Helper::multiPasswordVerify(
|
||||||
$user->password_algo,
|
$user->password_algo,
|
||||||
$password,
|
$password,
|
||||||
$user->password)
|
$user->password)
|
||||||
) {
|
) {
|
||||||
abort(500, '用户名或密码错误');
|
abort(500, __('Incorrect email or password'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->banned) {
|
if ($user->banned) {
|
||||||
abort(500, '该账户已被停止使用');
|
abort(500, __('Your account has been suspended'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
@ -165,14 +165,14 @@ class AuthController extends Controller
|
|||||||
$key = CacheKey::get('TEMP_TOKEN', $request->input('verify'));
|
$key = CacheKey::get('TEMP_TOKEN', $request->input('verify'));
|
||||||
$userId = Cache::get($key);
|
$userId = Cache::get($key);
|
||||||
if (!$userId) {
|
if (!$userId) {
|
||||||
abort(500, '令牌有误');
|
abort(500, __('Token error'));
|
||||||
}
|
}
|
||||||
$user = User::find($userId);
|
$user = User::find($userId);
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
abort(500, '用户不存在');
|
abort(500, __('The user does not '));
|
||||||
}
|
}
|
||||||
if ($user->banned) {
|
if ($user->banned) {
|
||||||
abort(500, '该账户已被停止使用');
|
abort(500, __('Your account has been suspended'));
|
||||||
}
|
}
|
||||||
$request->session()->put('email', $user->email);
|
$request->session()->put('email', $user->email);
|
||||||
$request->session()->put('id', $user->id);
|
$request->session()->put('id', $user->id);
|
||||||
@ -190,7 +190,7 @@ class AuthController extends Controller
|
|||||||
{
|
{
|
||||||
$user = User::where('token', $request->input('token'))->first();
|
$user = User::where('token', $request->input('token'))->first();
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
abort(500, '令牌有误');
|
abort(500, __('Token error'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$code = Helper::guid();
|
$code = Helper::guid();
|
||||||
@ -208,7 +208,7 @@ class AuthController extends Controller
|
|||||||
->where('password', $authData[1])
|
->where('password', $authData[1])
|
||||||
->first();
|
->first();
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
abort(500, '令牌有误');
|
abort(500, __('Token error'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$code = Helper::guid();
|
$code = Helper::guid();
|
||||||
@ -241,16 +241,16 @@ class AuthController extends Controller
|
|||||||
public function forget(AuthForget $request)
|
public function forget(AuthForget $request)
|
||||||
{
|
{
|
||||||
if (Cache::get(CacheKey::get('EMAIL_VERIFY_CODE', $request->input('email'))) !== $request->input('email_code')) {
|
if (Cache::get(CacheKey::get('EMAIL_VERIFY_CODE', $request->input('email'))) !== $request->input('email_code')) {
|
||||||
abort(500, '邮箱验证码有误');
|
abort(500, __('Incorrect email verification code'));
|
||||||
}
|
}
|
||||||
$user = User::where('email', $request->input('email'))->first();
|
$user = User::where('email', $request->input('email'))->first();
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
abort(500, '该邮箱不存在系统中');
|
abort(500, __('This email is not registered in the system'));
|
||||||
}
|
}
|
||||||
$user->password = password_hash($request->input('password'), PASSWORD_DEFAULT);
|
$user->password = password_hash($request->input('password'), PASSWORD_DEFAULT);
|
||||||
$user->password_algo = NULL;
|
$user->password_algo = NULL;
|
||||||
if (!$user->save()) {
|
if (!$user->save()) {
|
||||||
abort(500, '重置失败');
|
abort(500, __('Reset failed'));
|
||||||
}
|
}
|
||||||
Cache::forget(CacheKey::get('EMAIL_VERIFY_CODE', $request->input('email')));
|
Cache::forget(CacheKey::get('EMAIL_VERIFY_CODE', $request->input('email')));
|
||||||
return response([
|
return response([
|
||||||
|
@ -47,15 +47,15 @@ class CommController extends Controller
|
|||||||
$recaptcha = new ReCaptcha(config('v2board.recaptcha_key'));
|
$recaptcha = new ReCaptcha(config('v2board.recaptcha_key'));
|
||||||
$recaptchaResp = $recaptcha->verify($request->input('recaptcha_data'));
|
$recaptchaResp = $recaptcha->verify($request->input('recaptcha_data'));
|
||||||
if (!$recaptchaResp->isSuccess()) {
|
if (!$recaptchaResp->isSuccess()) {
|
||||||
abort(500, '验证码有误');
|
abort(500, __('Invalid code is incorrect'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$email = $request->input('email');
|
$email = $request->input('email');
|
||||||
if (Cache::get(CacheKey::get('LAST_SEND_EMAIL_VERIFY_TIMESTAMP', $email))) {
|
if (Cache::get(CacheKey::get('LAST_SEND_EMAIL_VERIFY_TIMESTAMP', $email))) {
|
||||||
abort(500, '验证码已发送,请过一会再请求');
|
abort(500, __('Email verification code has been sent, please request again later'));
|
||||||
}
|
}
|
||||||
$code = rand(100000, 999999);
|
$code = rand(100000, 999999);
|
||||||
$subject = config('v2board.app_name', 'V2Board') . '邮箱验证码';
|
$subject = config('v2board.app_name', 'V2Board') . __('Email verification code');
|
||||||
|
|
||||||
SendEmailJob::dispatch([
|
SendEmailJob::dispatch([
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
|
@ -11,25 +11,25 @@ class CouponController extends Controller
|
|||||||
public function check(Request $request)
|
public function check(Request $request)
|
||||||
{
|
{
|
||||||
if (empty($request->input('code'))) {
|
if (empty($request->input('code'))) {
|
||||||
abort(500, __('user.coupon.check.coupon_not_empty'));
|
abort(500, __('Coupon cannot be empty'));
|
||||||
}
|
}
|
||||||
$coupon = Coupon::where('code', $request->input('code'))->first();
|
$coupon = Coupon::where('code', $request->input('code'))->first();
|
||||||
if (!$coupon) {
|
if (!$coupon) {
|
||||||
abort(500, __('user.coupon.check.coupon_invalid'));
|
abort(500, __('Invalid coupon'));
|
||||||
}
|
}
|
||||||
if ($coupon->limit_use <= 0 && $coupon->limit_use !== NULL) {
|
if ($coupon->limit_use <= 0 && $coupon->limit_use !== NULL) {
|
||||||
abort(500, __('user.coupon.check.coupon_not_available_by_number'));
|
abort(500, __('This coupon is no longer available'));
|
||||||
}
|
}
|
||||||
if (time() < $coupon->started_at) {
|
if (time() < $coupon->started_at) {
|
||||||
abort(500, __('user.coupon.check.coupon_not_available_by_time'));
|
abort(500, __('This coupon has not yet started'));
|
||||||
}
|
}
|
||||||
if (time() > $coupon->ended_at) {
|
if (time() > $coupon->ended_at) {
|
||||||
abort(500, __('user.coupon.check.coupon_expired'));
|
abort(500, __('This coupon has expired'));
|
||||||
}
|
}
|
||||||
if ($coupon->limit_plan_ids) {
|
if ($coupon->limit_plan_ids) {
|
||||||
$limitPlanIds = json_decode($coupon->limit_plan_ids);
|
$limitPlanIds = json_decode($coupon->limit_plan_ids);
|
||||||
if (!in_array($request->input('plan_id'), $limitPlanIds)) {
|
if (!in_array($request->input('plan_id'), $limitPlanIds)) {
|
||||||
abort(500, __('user.coupon.check.coupon_limit_plan'));
|
abort(500, __('The coupon code cannot be used for this subscription'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
|
@ -14,7 +14,7 @@ class InviteController extends Controller
|
|||||||
public function save(Request $request)
|
public function save(Request $request)
|
||||||
{
|
{
|
||||||
if (InviteCode::where('user_id', $request->session()->get('id'))->where('status', 0)->count() >= config('v2board.invite_gen_limit', 5)) {
|
if (InviteCode::where('user_id', $request->session()->get('id'))->where('status', 0)->count() >= config('v2board.invite_gen_limit', 5)) {
|
||||||
abort(500, __('user.invite.save.invite_create_limit'));
|
abort(500, __('The maximum number of creations has been reached'));
|
||||||
}
|
}
|
||||||
$inviteCode = new InviteCode();
|
$inviteCode = new InviteCode();
|
||||||
$inviteCode->user_id = $request->session()->get('id');
|
$inviteCode->user_id = $request->session()->get('id');
|
||||||
|
@ -17,15 +17,15 @@ class KnowledgeController extends Controller
|
|||||||
->where('show', 1)
|
->where('show', 1)
|
||||||
->first()
|
->first()
|
||||||
->toArray();
|
->toArray();
|
||||||
if (!$knowledge) abort(500, __('user.knowledge.fetch.knowledge_not_exist'));
|
if (!$knowledge) abort(500, __('Article does not exist'));
|
||||||
$user = User::find($request->session()->get('id'));
|
$user = User::find($request->session()->get('id'));
|
||||||
$userService = new UserService();
|
$userService = new UserService();
|
||||||
if ($userService->isAvailable($user)) {
|
if ($userService->isAvailable($user)) {
|
||||||
$appleId = config('v2board.apple_id');
|
$appleId = config('v2board.apple_id');
|
||||||
$appleIdPassword = config('v2board.apple_id_password');
|
$appleIdPassword = config('v2board.apple_id_password');
|
||||||
} else {
|
} else {
|
||||||
$appleId = __('user.knowledge.fetch.apple_id_must_be_plan');
|
$appleId = __('No active subscription. Unable to use our provided Apple ID');
|
||||||
$appleIdPassword = __('user.knowledge.fetch.apple_id_must_be_plan');
|
$appleIdPassword = __('No active subscription. Unable to use our provided Apple ID');
|
||||||
$this->formatAccessData($knowledge['body']);
|
$this->formatAccessData($knowledge['body']);
|
||||||
}
|
}
|
||||||
$subscribeUrl = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user['token'];
|
$subscribeUrl = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user['token'];
|
||||||
@ -63,7 +63,7 @@ class KnowledgeController extends Controller
|
|||||||
function getBetween($input, $start, $end){$substr = substr($input, strlen($start)+strpos($input, $start),(strlen($input) - strpos($input, $end))*(-1));return $substr;}
|
function getBetween($input, $start, $end){$substr = substr($input, strlen($start)+strpos($input, $start),(strlen($input) - strpos($input, $end))*(-1));return $substr;}
|
||||||
$accessData = getBetween($body, '<!--access start-->', '<!--access end-->');
|
$accessData = getBetween($body, '<!--access start-->', '<!--access end-->');
|
||||||
if ($accessData) {
|
if ($accessData) {
|
||||||
$body = str_replace($accessData, '<div class="v2board-no-access">'. __('user.knowledge.formatAccessData.no_access') .'</div>', $body);
|
$body = str_replace($accessData, '<div class="v2board-no-access">'. __('You must have a valid subscription to view content in this area') .'</div>', $body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,12 +52,12 @@ class OrderController extends Controller
|
|||||||
->where('trade_no', $request->input('trade_no'))
|
->where('trade_no', $request->input('trade_no'))
|
||||||
->first();
|
->first();
|
||||||
if (!$order) {
|
if (!$order) {
|
||||||
abort(500, __('user.order.details.order_not_exist'));
|
abort(500, __('Order does not exist or has been paid'));
|
||||||
}
|
}
|
||||||
$order['plan'] = Plan::find($order->plan_id);
|
$order['plan'] = Plan::find($order->plan_id);
|
||||||
$order['try_out_plan_id'] = (int)config('v2board.try_out_plan_id');
|
$order['try_out_plan_id'] = (int)config('v2board.try_out_plan_id');
|
||||||
if (!$order['plan']) {
|
if (!$order['plan']) {
|
||||||
abort(500, __('user.order.details.plan_not_exist'));
|
abort(500, __('Subscription plan does not exist'));
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
'data' => $order
|
'data' => $order
|
||||||
@ -68,38 +68,38 @@ class OrderController extends Controller
|
|||||||
{
|
{
|
||||||
$userService = new UserService();
|
$userService = new UserService();
|
||||||
if ($userService->isNotCompleteOrderByUserId($request->session()->get('id'))) {
|
if ($userService->isNotCompleteOrderByUserId($request->session()->get('id'))) {
|
||||||
abort(500, __('user.order.save.exist_open_order'));
|
abort(500, __('You have an unpaid or pending order, please try again later or cancel it'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$plan = Plan::find($request->input('plan_id'));
|
$plan = Plan::find($request->input('plan_id'));
|
||||||
$user = User::find($request->session()->get('id'));
|
$user = User::find($request->session()->get('id'));
|
||||||
|
|
||||||
if (!$plan) {
|
if (!$plan) {
|
||||||
abort(500, __('user.order.save.plan_not_exist'));
|
abort(500, __('Subscription plan does not exist'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!$plan->show && !$plan->renew) || (!$plan->show && $user->plan_id !== $plan->id)) {
|
if ((!$plan->show && !$plan->renew) || (!$plan->show && $user->plan_id !== $plan->id)) {
|
||||||
if ($request->input('cycle') !== 'reset_price') {
|
if ($request->input('cycle') !== 'reset_price') {
|
||||||
abort(500, __('user.order.save.plan_stop_sell'));
|
abort(500, __('This subscription has been sold out, please choose another subscription'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$plan->renew && $user->plan_id == $plan->id && $request->input('cycle') !== 'reset_price') {
|
if (!$plan->renew && $user->plan_id == $plan->id && $request->input('cycle') !== 'reset_price') {
|
||||||
abort(500, __('user.order.save.plan_stop_renew'));
|
abort(500, __('This subscription cannot be renewed, please change to another subscription'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($plan[$request->input('cycle')] === NULL) {
|
if ($plan[$request->input('cycle')] === NULL) {
|
||||||
abort(500, __('user.order.save.plan_stop'));
|
abort(500, __('This payment cycle cannot be purchased, please choose another cycle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->input('cycle') === 'reset_price') {
|
if ($request->input('cycle') === 'reset_price') {
|
||||||
if ($user->expired_at <= time() || !$user->plan_id) {
|
if ($user->expired_at <= time() || !$user->plan_id) {
|
||||||
abort(500, __('user.order.save.plan_exist_not_buy_package'));
|
abort(500, __('Subscription has expired or no active subscription, unable to purchase Data Reset Package'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$plan->show && $plan->renew && !$userService->isAvailable($user)) {
|
if (!$plan->show && $plan->renew && !$userService->isAvailable($user)) {
|
||||||
abort(500, __('user.order.save.plan_expired'));
|
abort(500, __('This subscription has expired, please change to another subscription'));
|
||||||
}
|
}
|
||||||
|
|
||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
@ -115,7 +115,7 @@ class OrderController extends Controller
|
|||||||
$couponService = new CouponService($request->input('coupon_code'));
|
$couponService = new CouponService($request->input('coupon_code'));
|
||||||
if (!$couponService->use($order)) {
|
if (!$couponService->use($order)) {
|
||||||
DB::rollBack();
|
DB::rollBack();
|
||||||
abort(500, __('user.order.save.coupon_use_failed'));
|
abort(500, __('Coupon failed'));
|
||||||
}
|
}
|
||||||
$order->coupon_id = $couponService->getId();
|
$order->coupon_id = $couponService->getId();
|
||||||
}
|
}
|
||||||
@ -130,14 +130,14 @@ class OrderController extends Controller
|
|||||||
if ($remainingBalance > 0) {
|
if ($remainingBalance > 0) {
|
||||||
if (!$userService->addBalance($order->user_id, - $order->total_amount)) {
|
if (!$userService->addBalance($order->user_id, - $order->total_amount)) {
|
||||||
DB::rollBack();
|
DB::rollBack();
|
||||||
abort(500, __('user.order.save.insufficient_balance'));
|
abort(500, __('Insufficient balance'));
|
||||||
}
|
}
|
||||||
$order->balance_amount = $order->total_amount;
|
$order->balance_amount = $order->total_amount;
|
||||||
$order->total_amount = 0;
|
$order->total_amount = 0;
|
||||||
} else {
|
} else {
|
||||||
if (!$userService->addBalance($order->user_id, - $user->balance)) {
|
if (!$userService->addBalance($order->user_id, - $user->balance)) {
|
||||||
DB::rollBack();
|
DB::rollBack();
|
||||||
abort(500, __('user.order.save.insufficient_balance'));
|
abort(500, __('Insufficient balance'));
|
||||||
}
|
}
|
||||||
$order->balance_amount = $user->balance;
|
$order->balance_amount = $user->balance;
|
||||||
$order->total_amount = $order->total_amount - $user->balance;
|
$order->total_amount = $order->total_amount - $user->balance;
|
||||||
@ -146,7 +146,7 @@ class OrderController extends Controller
|
|||||||
|
|
||||||
if (!$order->save()) {
|
if (!$order->save()) {
|
||||||
DB::rollback();
|
DB::rollback();
|
||||||
abort(500, __('user.order.save.order_create_failed'));
|
abort(500, __('Failed to create order'));
|
||||||
}
|
}
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
@ -165,7 +165,7 @@ class OrderController extends Controller
|
|||||||
->where('status', 0)
|
->where('status', 0)
|
||||||
->first();
|
->first();
|
||||||
if (!$order) {
|
if (!$order) {
|
||||||
abort(500, __('user.order.checkout.order_not_exist_or_paid'));
|
abort(500, __('Order does not exist or has been paid'));
|
||||||
}
|
}
|
||||||
// free process
|
// free process
|
||||||
if ($order->total_amount <= 0) {
|
if ($order->total_amount <= 0) {
|
||||||
@ -178,7 +178,7 @@ class OrderController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$payment = Payment::find($method);
|
$payment = Payment::find($method);
|
||||||
if (!$payment || $payment->enable !== 1) abort(500, __('user.order.checkout.pay_method_not_use'));
|
if (!$payment || $payment->enable !== 1) abort(500, __('Payment method is not available'));
|
||||||
$paymentService = new PaymentService($payment->payment, $payment->id);
|
$paymentService = new PaymentService($payment->payment, $payment->id);
|
||||||
$result = $paymentService->pay([
|
$result = $paymentService->pay([
|
||||||
'trade_no' => $tradeNo,
|
'trade_no' => $tradeNo,
|
||||||
@ -200,7 +200,7 @@ class OrderController extends Controller
|
|||||||
->where('user_id', $request->session()->get('id'))
|
->where('user_id', $request->session()->get('id'))
|
||||||
->first();
|
->first();
|
||||||
if (!$order) {
|
if (!$order) {
|
||||||
abort(500, __('user.order.check.order_not_exist'));
|
abort(500, __('Order does not exist'));
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
'data' => $order->status
|
'data' => $order->status
|
||||||
@ -224,20 +224,20 @@ class OrderController extends Controller
|
|||||||
public function cancel(Request $request)
|
public function cancel(Request $request)
|
||||||
{
|
{
|
||||||
if (empty($request->input('trade_no'))) {
|
if (empty($request->input('trade_no'))) {
|
||||||
abort(500, __('user.order.cancel.params_wrong'));
|
abort(500, __('Invalid parameter'));
|
||||||
}
|
}
|
||||||
$order = Order::where('trade_no', $request->input('trade_no'))
|
$order = Order::where('trade_no', $request->input('trade_no'))
|
||||||
->where('user_id', $request->session()->get('id'))
|
->where('user_id', $request->session()->get('id'))
|
||||||
->first();
|
->first();
|
||||||
if (!$order) {
|
if (!$order) {
|
||||||
abort(500, __('user.order.cancel.order_not_exist'));
|
abort(500, __('Order does not exist'));
|
||||||
}
|
}
|
||||||
if ($order->status !== 0) {
|
if ($order->status !== 0) {
|
||||||
abort(500, __('user.order.cancel.only_cancel_pending_order'));
|
abort(500, __('You can only cancel pending orders'));
|
||||||
}
|
}
|
||||||
$orderService = new OrderService($order);
|
$orderService = new OrderService($order);
|
||||||
if (!$orderService->cancel()) {
|
if (!$orderService->cancel()) {
|
||||||
abort(500, __('user.order.cancel.cancel_failed'));
|
abort(500, __('Cancel failed'));
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
'data' => true
|
'data' => true
|
||||||
|
@ -14,7 +14,7 @@ class PlanController extends Controller
|
|||||||
$plan = Plan::where('id', $request->input('id'))
|
$plan = Plan::where('id', $request->input('id'))
|
||||||
->first();
|
->first();
|
||||||
if (!$plan) {
|
if (!$plan) {
|
||||||
abort(500, __('user.plan.fetch.plan_not_exist'));
|
abort(500, __('Subscription plan does not exist'));
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
'data' => $plan
|
'data' => $plan
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
namespace App\Http\Controllers\User;
|
namespace App\Http\Controllers\User;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\User;
|
||||||
use App\Services\TelegramService;
|
use App\Services\TelegramService;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class TelegramController extends Controller
|
class TelegramController extends Controller
|
||||||
{
|
{
|
||||||
@ -17,4 +19,9 @@ class TelegramController extends Controller
|
|||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function unbind(Request $request)
|
||||||
|
{
|
||||||
|
$user = User::where('user_id', $request->session()->get('id'))->first();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ class TicketController extends Controller
|
|||||||
->where('user_id', $request->session()->get('id'))
|
->where('user_id', $request->session()->get('id'))
|
||||||
->first();
|
->first();
|
||||||
if (!$ticket) {
|
if (!$ticket) {
|
||||||
abort(500, __('user.ticket.fetch.ticket_not_exist'));
|
abort(500, __('Ticket does not exist'));
|
||||||
}
|
}
|
||||||
$ticket['message'] = TicketMessage::where('ticket_id', $ticket->id)->get();
|
$ticket['message'] = TicketMessage::where('ticket_id', $ticket->id)->get();
|
||||||
for ($i = 0; $i < count($ticket['message']); $i++) {
|
for ($i = 0; $i < count($ticket['message']); $i++) {
|
||||||
@ -56,7 +56,7 @@ class TicketController extends Controller
|
|||||||
{
|
{
|
||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
if ((int)Ticket::where('status', 0)->where('user_id', $request->session()->get('id'))->count()) {
|
if ((int)Ticket::where('status', 0)->where('user_id', $request->session()->get('id'))->count()) {
|
||||||
abort(500, __('user.ticket.save.exist_other_open_ticket'));
|
abort(500, __('There are other unresolved tickets'));
|
||||||
}
|
}
|
||||||
$ticket = Ticket::create(array_merge($request->only([
|
$ticket = Ticket::create(array_merge($request->only([
|
||||||
'subject',
|
'subject',
|
||||||
@ -67,7 +67,7 @@ class TicketController extends Controller
|
|||||||
]));
|
]));
|
||||||
if (!$ticket) {
|
if (!$ticket) {
|
||||||
DB::rollback();
|
DB::rollback();
|
||||||
abort(500, __('user.ticket.save.ticket_create_failed'));
|
abort(500, __('Failed to open ticket'));
|
||||||
}
|
}
|
||||||
$ticketMessage = TicketMessage::create([
|
$ticketMessage = TicketMessage::create([
|
||||||
'user_id' => $request->session()->get('id'),
|
'user_id' => $request->session()->get('id'),
|
||||||
@ -76,7 +76,7 @@ class TicketController extends Controller
|
|||||||
]);
|
]);
|
||||||
if (!$ticketMessage) {
|
if (!$ticketMessage) {
|
||||||
DB::rollback();
|
DB::rollback();
|
||||||
abort(500, __('user.ticket.save.ticket_create_failed'));
|
abort(500, __('Failed to open ticket'));
|
||||||
}
|
}
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$this->sendNotify($ticket, $ticketMessage);
|
$this->sendNotify($ticket, $ticketMessage);
|
||||||
@ -88,22 +88,22 @@ class TicketController extends Controller
|
|||||||
public function reply(Request $request)
|
public function reply(Request $request)
|
||||||
{
|
{
|
||||||
if (empty($request->input('id'))) {
|
if (empty($request->input('id'))) {
|
||||||
abort(500, __('user.ticket.reply.params_wrong'));
|
abort(500, __('Invalid parameter'));
|
||||||
}
|
}
|
||||||
if (empty($request->input('message'))) {
|
if (empty($request->input('message'))) {
|
||||||
abort(500, __('user.ticket.reply.message_not_empty'));
|
abort(500, __('Message cannot be empty'));
|
||||||
}
|
}
|
||||||
$ticket = Ticket::where('id', $request->input('id'))
|
$ticket = Ticket::where('id', $request->input('id'))
|
||||||
->where('user_id', $request->session()->get('id'))
|
->where('user_id', $request->session()->get('id'))
|
||||||
->first();
|
->first();
|
||||||
if (!$ticket) {
|
if (!$ticket) {
|
||||||
abort(500, __('user.ticket.reply.ticket_not_exist'));
|
abort(500, __('Ticket does not exist'));
|
||||||
}
|
}
|
||||||
if ($ticket->status) {
|
if ($ticket->status) {
|
||||||
abort(500, __('user.ticket.reply.ticket_close_not_reply'));
|
abort(500, __('The ticket is closed and cannot be replied'));
|
||||||
}
|
}
|
||||||
if ($request->session()->get('id') == $this->getLastMessage($ticket->id)->user_id) {
|
if ($request->session()->get('id') == $this->getLastMessage($ticket->id)->user_id) {
|
||||||
abort(500, __('user.ticket.reply.wait_reply'));
|
abort(500, __('Please wait for the technical enginneer to reply'));
|
||||||
}
|
}
|
||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
$ticketMessage = TicketMessage::create([
|
$ticketMessage = TicketMessage::create([
|
||||||
@ -114,7 +114,7 @@ class TicketController extends Controller
|
|||||||
$ticket->last_reply_user_id = $request->session()->get('id');
|
$ticket->last_reply_user_id = $request->session()->get('id');
|
||||||
if (!$ticketMessage || !$ticket->save()) {
|
if (!$ticketMessage || !$ticket->save()) {
|
||||||
DB::rollback();
|
DB::rollback();
|
||||||
abort(500, __('user.ticket.reply.ticket_reply_failed'));
|
abort(500, __('Ticket reply failed'));
|
||||||
}
|
}
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$this->sendNotify($ticket, $ticketMessage);
|
$this->sendNotify($ticket, $ticketMessage);
|
||||||
@ -127,17 +127,17 @@ class TicketController extends Controller
|
|||||||
public function close(Request $request)
|
public function close(Request $request)
|
||||||
{
|
{
|
||||||
if (empty($request->input('id'))) {
|
if (empty($request->input('id'))) {
|
||||||
abort(500, __('user.ticket.close.params_wrong'));
|
abort(500, __('Invalid parameter'));
|
||||||
}
|
}
|
||||||
$ticket = Ticket::where('id', $request->input('id'))
|
$ticket = Ticket::where('id', $request->input('id'))
|
||||||
->where('user_id', $request->session()->get('id'))
|
->where('user_id', $request->session()->get('id'))
|
||||||
->first();
|
->first();
|
||||||
if (!$ticket) {
|
if (!$ticket) {
|
||||||
abort(500, __('user.ticket.close.ticket_not_exist'));
|
abort(500, __('Ticket does not exist'));
|
||||||
}
|
}
|
||||||
$ticket->status = 1;
|
$ticket->status = 1;
|
||||||
if (!$ticket->save()) {
|
if (!$ticket->save()) {
|
||||||
abort(500, __('user.ticket.close.close_failed'));
|
abort(500, __('Close failed'));
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
'data' => true
|
'data' => true
|
||||||
@ -163,15 +163,15 @@ class TicketController extends Controller
|
|||||||
Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT
|
Dict::WITHDRAW_METHOD_WHITELIST_DEFAULT
|
||||||
)
|
)
|
||||||
)) {
|
)) {
|
||||||
abort(500, __('user.ticket.withdraw.not_support_withdraw_method'));
|
abort(500, __('Unsupported withdrawal method'));
|
||||||
}
|
}
|
||||||
$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)) {
|
||||||
abort(500, __('user.ticket.withdraw.system_require_withdraw_limit', ['limit' => $limit]));
|
abort(500, __('The current required minimum withdrawal commission is', ['limit' => $limit]));
|
||||||
}
|
}
|
||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
$subject = __('user.ticket.withdraw.ticket_subject');
|
$subject = __('[Commission Withdrawal Request] This ticket is opened by the system');
|
||||||
$ticket = Ticket::create([
|
$ticket = Ticket::create([
|
||||||
'subject' => $subject,
|
'subject' => $subject,
|
||||||
'level' => 2,
|
'level' => 2,
|
||||||
@ -180,12 +180,12 @@ class TicketController extends Controller
|
|||||||
]);
|
]);
|
||||||
if (!$ticket) {
|
if (!$ticket) {
|
||||||
DB::rollback();
|
DB::rollback();
|
||||||
abort(500, __('user.ticket.withdraw.ticket_create_failed'));
|
abort(500, __('Failed to open ticket'));
|
||||||
}
|
}
|
||||||
$message = __('user.ticket.withdraw.ticket_message', [
|
$message = sprintf("%s\r\n%s",
|
||||||
'method' => $request->input('withdraw_method'),
|
__('Withdrawal method') . ":" . $request->input('withdraw_method'),
|
||||||
'account' => $request->input('withdraw_account')
|
__('Withdrawal account') . ":" . $request->input('withdraw_account')
|
||||||
]);
|
);
|
||||||
$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,
|
||||||
@ -193,7 +193,7 @@ class TicketController extends Controller
|
|||||||
]);
|
]);
|
||||||
if (!$ticketMessage) {
|
if (!$ticketMessage) {
|
||||||
DB::rollback();
|
DB::rollback();
|
||||||
abort(500, __('user.ticket.withdraw.ticket_create_failed'));
|
abort(500, __('Failed to open ticket'));
|
||||||
}
|
}
|
||||||
DB::commit();
|
DB::commit();
|
||||||
$this->sendNotify($ticket, $ticketMessage);
|
$this->sendNotify($ticket, $ticketMessage);
|
||||||
|
@ -29,19 +29,19 @@ class UserController extends Controller
|
|||||||
{
|
{
|
||||||
$user = User::find($request->session()->get('id'));
|
$user = User::find($request->session()->get('id'));
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
abort(500, __('user.user.changePassword.user_not_exist'));
|
abort(500, __('The user does not exist'));
|
||||||
}
|
}
|
||||||
if (!Helper::multiPasswordVerify(
|
if (!Helper::multiPasswordVerify(
|
||||||
$user->password_algo,
|
$user->password_algo,
|
||||||
$request->input('old_password'),
|
$request->input('old_password'),
|
||||||
$user->password)
|
$user->password)
|
||||||
) {
|
) {
|
||||||
abort(500, __('user.user.changePassword.old_password_wrong'));
|
abort(500, __('The old password is wrong'));
|
||||||
}
|
}
|
||||||
$user->password = password_hash($request->input('new_password'), PASSWORD_DEFAULT);
|
$user->password = password_hash($request->input('new_password'), PASSWORD_DEFAULT);
|
||||||
$user->password_algo = NULL;
|
$user->password_algo = NULL;
|
||||||
if (!$user->save()) {
|
if (!$user->save()) {
|
||||||
abort(500, __('user.user.changePassword.save_failed'));
|
abort(500, __('Save failed'));
|
||||||
}
|
}
|
||||||
$request->session()->flush();
|
$request->session()->flush();
|
||||||
return response([
|
return response([
|
||||||
@ -70,7 +70,7 @@ class UserController extends Controller
|
|||||||
])
|
])
|
||||||
->first();
|
->first();
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
abort(500, __('user.user.info.user_not_exist'));
|
abort(500, __('The user does not exist'));
|
||||||
}
|
}
|
||||||
$user['avatar_url'] = 'https://cdn.v2ex.com/gravatar/' . md5($user->email) . '?s=64&d=identicon';
|
$user['avatar_url'] = 'https://cdn.v2ex.com/gravatar/' . md5($user->email) . '?s=64&d=identicon';
|
||||||
return response([
|
return response([
|
||||||
@ -110,12 +110,12 @@ class UserController extends Controller
|
|||||||
])
|
])
|
||||||
->first();
|
->first();
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
abort(500, __('user.user.getSubscribe.user_not_exist'));
|
abort(500, __('The user does not exist'));
|
||||||
}
|
}
|
||||||
if ($user->plan_id) {
|
if ($user->plan_id) {
|
||||||
$user['plan'] = Plan::find($user->plan_id);
|
$user['plan'] = Plan::find($user->plan_id);
|
||||||
if (!$user['plan']) {
|
if (!$user['plan']) {
|
||||||
abort(500, __('user.user.getSubscribe.plan_not_exist'));
|
abort(500, __('Subscription plan does not exist'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$user['subscribe_url'] = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user['token'];
|
$user['subscribe_url'] = config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user['token'];
|
||||||
@ -129,12 +129,12 @@ class UserController extends Controller
|
|||||||
{
|
{
|
||||||
$user = User::find($request->session()->get('id'));
|
$user = User::find($request->session()->get('id'));
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
abort(500, __('user.user.resetSecurity.user_not_exist'));
|
abort(500, __('The user does not exist'));
|
||||||
}
|
}
|
||||||
$user->uuid = Helper::guid(true);
|
$user->uuid = Helper::guid(true);
|
||||||
$user->token = Helper::guid();
|
$user->token = Helper::guid();
|
||||||
if (!$user->save()) {
|
if (!$user->save()) {
|
||||||
abort(500, __('user.user.resetSecurity.reset_failed'));
|
abort(500, __('Reset failed'));
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
'data' => config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user->token
|
'data' => config('v2board.subscribe_url', config('v2board.app_url', env('APP_URL'))) . '/api/v1/client/subscribe?token=' . $user->token
|
||||||
@ -150,12 +150,12 @@ class UserController extends Controller
|
|||||||
|
|
||||||
$user = User::find($request->session()->get('id'));
|
$user = User::find($request->session()->get('id'));
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
abort(500, __('user.user.update.user_not_exist'));
|
abort(500, __('The user does not exist'));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$user->update($updateData);
|
$user->update($updateData);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
abort(500, __('user.user.update.save_failed'));
|
abort(500, __('Save failed'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return response([
|
return response([
|
||||||
@ -167,15 +167,15 @@ class UserController extends Controller
|
|||||||
{
|
{
|
||||||
$user = User::find($request->session()->get('id'));
|
$user = User::find($request->session()->get('id'));
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
abort(500, __('user.user.transfer.user_not_exist'));
|
abort(500, __('The user does not exist'));
|
||||||
}
|
}
|
||||||
if ($request->input('transfer_amount') > $user->commission_balance) {
|
if ($request->input('transfer_amount') > $user->commission_balance) {
|
||||||
abort(500, __('user.user.transfer.insufficient_commission_balance'));
|
abort(500, __('Insufficient commission balance'));
|
||||||
}
|
}
|
||||||
$user->commission_balance = $user->commission_balance - $request->input('transfer_amount');
|
$user->commission_balance = $user->commission_balance - $request->input('transfer_amount');
|
||||||
$user->balance = $user->balance + $request->input('transfer_amount');
|
$user->balance = $user->balance + $request->input('transfer_amount');
|
||||||
if (!$user->save()) {
|
if (!$user->save()) {
|
||||||
abort(500, __('user.user.transfer.transfer_failed'));
|
abort(500, __('Transfer failed'));
|
||||||
}
|
}
|
||||||
return response([
|
return response([
|
||||||
'data' => true
|
'data' => true
|
||||||
|
@ -23,11 +23,11 @@ class AuthForget extends FormRequest
|
|||||||
public function messages()
|
public function messages()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'email.required' => '邮箱不能为空',
|
'email.required' => __('Email can not be empty'),
|
||||||
'email.email' => '邮箱格式不正确',
|
'email.email' => __('Email format is incorrect'),
|
||||||
'password.required' => '密码不能为空',
|
'password.required' => __('Password can not be empty'),
|
||||||
'password.min' => '密码必须大于8位数',
|
'password.min' => __('Password must be greater than 8 digits'),
|
||||||
'email_code.required' => '邮箱验证码不能为空'
|
'email_code.required' => __('Email verification code cannot be empty')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,10 +22,10 @@ class AuthLogin extends FormRequest
|
|||||||
public function messages()
|
public function messages()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'email.required' => '邮箱不能为空',
|
'email.required' => __('Email can not be empty'),
|
||||||
'email.email' => '邮箱格式不正确',
|
'email.email' => __('Email format is incorrect'),
|
||||||
'password.required' => '密码不能为空',
|
'password.required' => __('Password can not be empty'),
|
||||||
'password.min' => '密码必须大于8位数'
|
'password.min' => __('Password must be greater than 8 digits')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,10 +22,10 @@ class AuthRegister extends FormRequest
|
|||||||
public function messages()
|
public function messages()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'email.required' => '邮箱不能为空',
|
'email.required' => __('Email can not be empty'),
|
||||||
'email.email' => '邮箱格式不正确',
|
'email.email' => __('Email format is incorrect'),
|
||||||
'password.required' => '密码不能为空',
|
'password.required' => __('Password can not be empty'),
|
||||||
'password.min' => '密码必须大于8位数'
|
'password.min' => __('Password must be greater than 8 digits')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,8 @@ class CommSendEmailVerify extends FormRequest
|
|||||||
public function messages()
|
public function messages()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'email.required' => '邮箱不能为空',
|
'email.required' => __('Email can not be empty'),
|
||||||
'email.email' => '邮箱格式不正确'
|
'email.email' => __('Email format is incorrect')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,9 @@ class OrderSave extends FormRequest
|
|||||||
public function messages()
|
public function messages()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'plan_id.required' => '套餐ID不能为空',
|
'plan_id.required' => __('Plan ID cannot be empty'),
|
||||||
'cycle.required' => '套餐周期不能为空',
|
'cycle.required' => __('Plan cycle cannot be empty'),
|
||||||
'cycle.in' => '套餐周期有误'
|
'cycle.in' => __('Wrong plan cycle')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,10 +23,10 @@ class TicketSave extends FormRequest
|
|||||||
public function messages()
|
public function messages()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'subject.required' => '工单主题不能为空',
|
'subject.required' => __('Ticket subject cannot be empty'),
|
||||||
'level.required' => '工单级别不能为空',
|
'level.required' => __('Ticket level cannot be empty'),
|
||||||
'level.in' => '工单级别格式不正确',
|
'level.in' => __('Incorrect ticket level format'),
|
||||||
'message.required' => '消息不能为空'
|
'message.required' => __('Message cannot be empty')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,8 @@ class TicketWithdraw extends FormRequest
|
|||||||
public function messages()
|
public function messages()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'withdraw_method.required' => '提现方式不能为空',
|
'withdraw_method.required' => __('The withdrawal method cannot be empty'),
|
||||||
'withdraw_method.in' => '提现方式不支持',
|
'withdraw_account.required' => __('The withdrawal account cannot be empty')
|
||||||
'withdraw_account.required' => '提现账号不能为空'
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,9 @@ class UserChangePassword extends FormRequest
|
|||||||
public function messages()
|
public function messages()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'old_password.required' => '旧密码不能为空',
|
'old_password.required' => __('Old password cannot be empty'),
|
||||||
'new_password.required' => '新密码不能为空',
|
'new_password.required' => __('New password cannot be empty'),
|
||||||
'new_password.min' => '密码必须大于8位数'
|
'new_password.min' => __('Password must be greater than 8 digits')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,9 +21,9 @@ class UserTransfer extends FormRequest
|
|||||||
public function messages()
|
public function messages()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'transfer_amount.required' => '划转金额不能为空',
|
'transfer_amount.required' => __('The transfer amount cannot be empty'),
|
||||||
'transfer_amount.integer' => __('user.user.transfer.params_wrong'),
|
'transfer_amount.integer' => __('The transfer amount parameter is wrong'),
|
||||||
'transfer_amount.min' => __('user.user.transfer.params_wrong')
|
'transfer_amount.min' => __('The transfer amount parameter is wrong')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,8 @@ class UserUpdate extends FormRequest
|
|||||||
public function messages()
|
public function messages()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'show.in' => '过期提醒格式不正确',
|
'show.in' => __('Incorrect format of expiration reminder'),
|
||||||
'renew.in' => '流量提醒格式不正确'
|
'renew.in' => __('Incorrect traffic alert format')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
public/assets/admin/umi.js
vendored
2
public/assets/admin/umi.js
vendored
File diff suppressed because one or more lines are too long
BIN
resources/.DS_Store
vendored
Normal file
BIN
resources/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
resources/lang/.DS_Store
vendored
Normal file
BIN
resources/lang/.DS_Store
vendored
Normal file
Binary file not shown.
86
resources/lang/en-US.json
Normal file
86
resources/lang/en-US.json
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
{
|
||||||
|
"Article does not exist": "Article does not exist",
|
||||||
|
"Cancel failed": "Cancel failed",
|
||||||
|
"Close failed": "Close failed",
|
||||||
|
"Coupon cannot be empty": "Coupon cannot be empty",
|
||||||
|
"Coupon failed": "Coupon failed",
|
||||||
|
"Currency conversion has timed out, please try again later": "Currency conversion has timed out, please try again later",
|
||||||
|
"Email already exists": "Email already exists",
|
||||||
|
"Email suffix is not in the Whitelist": "Email suffix is not in the Whitelist",
|
||||||
|
"Email verification code": "Email verification code",
|
||||||
|
"Email verification code cannot be empty": "Email verification code cannot be empty",
|
||||||
|
"Email verification code has been sent, please request again later": "Email verification code has been sent, please request again later",
|
||||||
|
"Failed to create order": "Failed to create order",
|
||||||
|
"Failed to open ticket": "Failed to open ticket",
|
||||||
|
"Gmail alias is not supported": "Gmail alias is not supported",
|
||||||
|
"Incorrect email or password": "Incorrect email or password",
|
||||||
|
"Incorrect email verification code": "Incorrect email verification code",
|
||||||
|
"Insufficient balance": "Insufficient balance",
|
||||||
|
"Insufficient commission balance": "Insufficient commission balance",
|
||||||
|
"Invalid code is incorrect": "Invalid code is incorrect",
|
||||||
|
"Invalid coupon": "Invalid coupon",
|
||||||
|
"Invalid invitation code": "Invalid invitation code",
|
||||||
|
"Invalid parameter": "Invalid parameter",
|
||||||
|
"Message cannot be empty": "Message cannot be empty",
|
||||||
|
"No active subscription. Unable to use our provided Apple ID": "No active subscription. Unable to use our provided Apple ID",
|
||||||
|
"Oops, there's a problem... Please refresh the page and try again later": "Oops, there's a problem... Please refresh the page and try again later",
|
||||||
|
"Order does not exist": "Order does not exist",
|
||||||
|
"Order does not exist or has been paid": "Order does not exist or has been paid",
|
||||||
|
"Payment failed. Please check your credit card information": "Payment failed. Please check your credit card information",
|
||||||
|
"Payment gateway request failed": "Payment gateway request failed",
|
||||||
|
"Payment method is not available": "Payment method is not available",
|
||||||
|
"Please wait for the technical enginneer to reply": "Please wait for the technical enginneer to reply",
|
||||||
|
"Register failed": "Register failed",
|
||||||
|
"Registration has closed": "Registration has closed",
|
||||||
|
"Reset failed": "Reset failed",
|
||||||
|
"Save failed": "Save failed",
|
||||||
|
"Subscription has expired or no active subscription, unable to purchase Data Reset Package": "Subscription has expired or no active subscription, unable to purchase Data Reset Package",
|
||||||
|
"Subscription plan does not exist": "Subscription plan does not exist",
|
||||||
|
"The coupon code cannot be used for this subscription": "The coupon code cannot be used for this subscription",
|
||||||
|
"The current required minimum withdrawal commission is": "The current required minimum withdrawal commission is",
|
||||||
|
"The maximum number of creations has been reached": "The maximum number of creations has been reached",
|
||||||
|
"The old password is wrong": "The old password is wrong",
|
||||||
|
"The ticket is closed and cannot be replied": "The ticket is closed and cannot be replied",
|
||||||
|
"The user does not exist": "The user does not exist",
|
||||||
|
"There are other unresolved tickets": "There are other unresolved tickets",
|
||||||
|
"This coupon has expired": "This coupon has expired",
|
||||||
|
"This coupon has not yet started": "This coupon has not yet started",
|
||||||
|
"This coupon is no longer available": "This coupon is no longer available",
|
||||||
|
"This email is not registered in the system": "This email is not registered in the system",
|
||||||
|
"This payment cycle cannot be purchased, please choose another cycle": "This payment cycle cannot be purchased, please choose another cycle",
|
||||||
|
"This subscription cannot be renewed, please change to another subscription": "This subscription cannot be renewed, please change to another subscription",
|
||||||
|
"This subscription has been sold out, please choose another subscription": "This subscription has been sold out, please choose another subscription",
|
||||||
|
"This subscription has expired, please change to another subscription": "This subscription has expired, please change to another subscription",
|
||||||
|
"Ticket does not exist": "Ticket does not exist",
|
||||||
|
"Ticket reply failed": "Ticket reply failed",
|
||||||
|
"Token error": "Token error",
|
||||||
|
"Transfer failed": "Transfer failed",
|
||||||
|
"Unsupported withdrawal": "Unsupported withdrawal",
|
||||||
|
"Unsupported withdrawal method": "Unsupported withdrawal method",
|
||||||
|
"Withdrawal account": "Withdrawal account",
|
||||||
|
"Withdrawal method": "Withdrawal method",
|
||||||
|
"You can only cancel pending orders": "You can only cancel pending orders",
|
||||||
|
"You have an unpaid or pending order, please try again later or cancel it": "You have an unpaid or pending order, please try again later or cancel it",
|
||||||
|
"You must have a valid subscription to view content in this area": "You must have a valid subscription to view content in this area",
|
||||||
|
"You must use the invitation code to register": "You must use the invitation code to register",
|
||||||
|
"Your account has been suspended": "Your account has been suspended",
|
||||||
|
"[Commission Withdrawal Request] This ticket is opened by the system": "[Commission Withdrawal Request] This ticket is opened by the system",
|
||||||
|
"Plan ID cannot be empty": "Plan ID cannot be empty",
|
||||||
|
"Plan cycle cannot be empty": "Plan cycle cannot be empty",
|
||||||
|
"Wrong plan cycle": "Wrong plan cycle",
|
||||||
|
"Ticket subject cannot be empty": "Ticket subject cannot be empty",
|
||||||
|
"Ticket level cannot be empty": "Ticket level cannot be empty",
|
||||||
|
"Incorrect ticket level format": "Incorrect ticket level format",
|
||||||
|
"The withdrawal method cannot be empty": "The withdrawal method cannot be empty",
|
||||||
|
"The withdrawal account cannot be empty": "The withdrawal account cannot be empty",
|
||||||
|
"Old password cannot be empty": "Old password cannot be empty",
|
||||||
|
"New password cannot be empty": "New password cannot be empty",
|
||||||
|
"Password must be greater than 8 digits": "Password must be greater than 8 digits",
|
||||||
|
"The transfer amount cannot be empty": "The transfer amount cannot be empty",
|
||||||
|
"The transfer amount parameter is wrong": "The transfer amount parameter is wrong",
|
||||||
|
"Incorrect format of expiration reminder": "Incorrect format of expiration reminder",
|
||||||
|
"Incorrect traffic alert format": "Incorrect traffic alert format",
|
||||||
|
"Email can not be empty": "Email can not be empty",
|
||||||
|
"Email format is incorrect": "Email format is incorrect",
|
||||||
|
"Password can not be empty": "Password can not be empty"
|
||||||
|
}
|
@ -1,37 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
'auth' => [
|
|
||||||
'register' => [
|
|
||||||
'verify_incorrect' => 'Invalid code is incorrect',
|
|
||||||
'email_suffix_not_in_whitelist' => 'Email suffix is not in the Whitelist',
|
|
||||||
'no_support_gmail_alias' => 'Gmail alias is not supported',
|
|
||||||
'close_register' => 'Registration has closed',
|
|
||||||
'must_use_invite_code' => 'You must use the invitation code to register',
|
|
||||||
'email_code_not_empty' => 'Email verification code cannot be empty',
|
|
||||||
'email_code_incorrect' => 'Incorrect email verification code',
|
|
||||||
'email_exist_system' => 'Email already exists',
|
|
||||||
'invalid_invite_code' => 'Invalid invitation code',
|
|
||||||
'register_failed' => 'Register failed'
|
|
||||||
],
|
|
||||||
'login' => [
|
|
||||||
'wrong_email_or_password' => 'Incorrect email or password',
|
|
||||||
'account_been_discontinued' => 'Your account has been suspended'
|
|
||||||
],
|
|
||||||
'getQuickLoginUrl' => [
|
|
||||||
'wrong_token' => 'Token error'
|
|
||||||
],
|
|
||||||
'forget' => [
|
|
||||||
'email_verification_code_incorrect' => 'Incorrect email verification code',
|
|
||||||
'email_not_exist_system' => 'This email is not registered in the system',
|
|
||||||
'reset_failed' => 'Reset failed'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'comm' => [
|
|
||||||
'sendEmailVerify' => [
|
|
||||||
'verification_code_incorrect' => 'Incorrect email verification code',
|
|
||||||
'code_sent_request_later' => 'Email verification code has been sent, please request again later',
|
|
||||||
'email_verification_code' => 'Email verification code'
|
|
||||||
]
|
|
||||||
]
|
|
||||||
];
|
|
@ -1,135 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
'user' => [
|
|
||||||
'changePassword' => [
|
|
||||||
'user_not_exist' => 'The user does not exist',
|
|
||||||
'old_password_wrong' => 'The old password is wrong',
|
|
||||||
'save_failed' => 'Save failed'
|
|
||||||
],
|
|
||||||
'info' => [
|
|
||||||
'user_not_exist' => 'The user does not exist'
|
|
||||||
],
|
|
||||||
'getSubscribe' => [
|
|
||||||
'user_not_exist' => 'The user does not exist',
|
|
||||||
'plan_not_exist' => 'Subscription plan does not exist',
|
|
||||||
],
|
|
||||||
'resetSecurity' => [
|
|
||||||
'user_not_exist' => 'The user does not exist',
|
|
||||||
'reset_failed' => 'Reset failed'
|
|
||||||
],
|
|
||||||
'update' => [
|
|
||||||
'user_not_exist' => 'The user does not exist',
|
|
||||||
'save_failed' => 'Save failed',
|
|
||||||
],
|
|
||||||
'transfer' => [
|
|
||||||
'user_not_exist' => 'The user does not exist',
|
|
||||||
'params_wrong' => 'Invalid parameter',
|
|
||||||
'insufficient_commission_balance' => 'Insufficient commission balance',
|
|
||||||
'transfer_failed' => 'Transfer failed'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'ticket' => [
|
|
||||||
'fetch' => [
|
|
||||||
'ticket_not_exist' => 'Ticket does not exist',
|
|
||||||
],
|
|
||||||
'save' => [
|
|
||||||
'exist_other_open_ticket' => 'There are other unresolved tickets',
|
|
||||||
'ticket_create_failed' => 'Failed to open ticket',
|
|
||||||
],
|
|
||||||
'reply' => [
|
|
||||||
'params_wrong' => 'Invalid parameter',
|
|
||||||
'message_not_empty' => 'Message cannot be empty',
|
|
||||||
'ticket_not_exist' => 'Ticket does not exist',
|
|
||||||
'ticket_close_not_reply' => 'The ticket is closed and cannot be replied',
|
|
||||||
'wait_reply' => 'Please wait for the technical enginneer to reply',
|
|
||||||
'ticket_reply_failed' => 'Ticket reply failed',
|
|
||||||
],
|
|
||||||
'close' => [
|
|
||||||
'params_wrong' => 'Invalid parameter',
|
|
||||||
'ticket_not_exist' => 'Ticket does not exist',
|
|
||||||
'close_failed' => 'Close failed',
|
|
||||||
],
|
|
||||||
'withdraw' => [
|
|
||||||
'not_support_withdraw_method' => 'Unsupported withdrawal method',
|
|
||||||
'system_require_withdraw_limit' => 'The current required minimum withdrawal commission is: ¥:limitCNY',
|
|
||||||
'ticket_subject' => '[Commission Withdrawal Request] This ticket is opened by the system',
|
|
||||||
'ticket_create_failed' => 'Failed to open ticket',
|
|
||||||
'ticket_message' => "Withdrawal method: :method\r\nPayment account: :account\r\n",
|
|
||||||
'not_support_withdraw' => 'Unsupported withdrawal'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'plan' => [
|
|
||||||
'fetch' => [
|
|
||||||
'plan_not_exist' => 'Subscription plan does not exist'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'order' => [
|
|
||||||
'details' => [
|
|
||||||
'order_not_exist' => 'Order does not exist',
|
|
||||||
'plan_not_exist' => 'Subscription plan does not exist',
|
|
||||||
],
|
|
||||||
'save' => [
|
|
||||||
'plan_not_exist' => 'Subscription plan does not exist',
|
|
||||||
'exist_open_order' => 'You have an unpaid or pending order, please try again later or cancel it',
|
|
||||||
'plan_stop_sell' => 'This subscription has been sold out, please choose another subscription',
|
|
||||||
'plan_stop_renew' => 'This subscription cannot be renewed, please change to another subscription',
|
|
||||||
'plan_stop' => 'This payment cycle cannot be purchased, please choose another cycle',
|
|
||||||
'plan_exist_not_buy_package' => 'Subscription has expired or no active subscription, unable to purchase Data Reset Package',
|
|
||||||
'plan_expired' => 'This subscription has expired, please change to another subscription',
|
|
||||||
'coupon_use_failed' => 'Invalid coupon',
|
|
||||||
'insufficient_balance' => 'Insufficient balance',
|
|
||||||
'order_create_failed' => 'Failed to create order'
|
|
||||||
],
|
|
||||||
'checkout' => [
|
|
||||||
'order_not_exist_or_paid' => 'Order does not exist or has been paid',
|
|
||||||
'pay_method_not_use' => 'Payment method is not available',
|
|
||||||
],
|
|
||||||
'check' => [
|
|
||||||
'order_not_exist' => 'Order does not exist'
|
|
||||||
],
|
|
||||||
'cancel' => [
|
|
||||||
'params_wrong' => 'Invalid parameter',
|
|
||||||
'order_not_exist' => 'Order does not exist',
|
|
||||||
'only_cancel_pending_order' => 'You can only cancel pending orders',
|
|
||||||
'cancel_failed' => 'Cancel failed',
|
|
||||||
],
|
|
||||||
'stripeAlipay' => [
|
|
||||||
'currency_convert_timeout' => 'Currency conversion has timed out, please try again later',
|
|
||||||
'gateway_request_failed' => 'Payment gateway request failed',
|
|
||||||
],
|
|
||||||
'stripeWepay' => [
|
|
||||||
'currency_convert_timeout' => 'Currency conversion has timed out, please try again later',
|
|
||||||
'gateway_request_failed' => 'Payment gateway request failed',
|
|
||||||
],
|
|
||||||
'stripeCard' => [
|
|
||||||
'currency_convert_timeout' => 'Currency conversion has timed out, please try again later',
|
|
||||||
'was_problem' => "Oops, there's a problem... Please refresh the page and try again later",
|
|
||||||
'deduction_failed' => 'Payment failed. Please check your credit card information'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'knowledge' => [
|
|
||||||
'fetch' => [
|
|
||||||
'knowledge_not_exist' => 'Article does not exist',
|
|
||||||
'apple_id_must_be_plan' => 'No active subscription. Unable to use our provided Apple ID'
|
|
||||||
],
|
|
||||||
'formatAccessData' => [
|
|
||||||
'no_access' => 'You must have a valid subscription to view content in this area'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'invite' => [
|
|
||||||
'save' => [
|
|
||||||
'invite_create_limit' => 'The maximum number of creations has been reached'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'coupon' => [
|
|
||||||
'check' => [
|
|
||||||
'coupon_not_empty' => 'Coupon cannot be empty',
|
|
||||||
'coupon_invalid' => 'Invalid coupon',
|
|
||||||
'coupon_not_available_by_number' => 'This coupon is no longer available',
|
|
||||||
'coupon_not_available_by_time' => 'This coupon has not yet started',
|
|
||||||
'coupon_expired' => 'This coupon has expired',
|
|
||||||
'coupon_limit_plan' => 'The coupon code cannot be used for this subscription'
|
|
||||||
]
|
|
||||||
]
|
|
||||||
];
|
|
86
resources/lang/zh-CN.json
Normal file
86
resources/lang/zh-CN.json
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
{
|
||||||
|
"The user does not exist": "该用户不存在",
|
||||||
|
"The old password is wrong": "旧密码有误",
|
||||||
|
"Save failed": "保存失败",
|
||||||
|
"Subscription plan does not exist": "订阅计划不存在",
|
||||||
|
"Reset failed": "重置失败",
|
||||||
|
"Invalid parameter": "参数错误",
|
||||||
|
"Insufficient commission balance": "推广佣金余额不足",
|
||||||
|
"Transfer failed": "划转失败",
|
||||||
|
"Ticket does not exist": "工单不存在",
|
||||||
|
"There are other unresolved tickets": "存在其它工单尚未处理",
|
||||||
|
"Failed to open ticket": "工单创建失败",
|
||||||
|
"Message cannot be empty": "消息不能为空",
|
||||||
|
"The ticket is closed and cannot be replied": "工单已关闭,无法回复",
|
||||||
|
"Please wait for the technical enginneer to reply": "请等待技术支持回复",
|
||||||
|
"Ticket reply failed": "工单回复失败",
|
||||||
|
"Close failed": "关闭失败",
|
||||||
|
"Unsupported withdrawal method": "不支持的提现方式",
|
||||||
|
"The current required minimum withdrawal commission is": "当前系统要求的最少提现佣金为:¥:limitCNY",
|
||||||
|
"[Commission Withdrawal Request] This ticket is opened by the system": "[提现申请] 本工单由系统发出",
|
||||||
|
"Withdrawal method": "提现方式",
|
||||||
|
"Withdrawal account": "提现账号",
|
||||||
|
"Unsupported withdrawal": "不支持提现",
|
||||||
|
"Order does not exist": "订单不存在",
|
||||||
|
"You have an unpaid or pending order, please try again later or cancel it": "您有未付款或开通中的订单,请稍后再试或将其取消",
|
||||||
|
"This subscription has been sold out, please choose another subscription": "该订阅已售罄,请更换其它订阅",
|
||||||
|
"This subscription cannot be renewed, please change to another subscription": "该订阅无法续费,请更换其它订阅",
|
||||||
|
"This payment cycle cannot be purchased, please choose another cycle": "该订阅周期无法进行购买,请选择其它周期",
|
||||||
|
"Subscription has expired or no active subscription, unable to purchase Data Reset Package": "订阅已过期或无有效订阅,无法购买重置包",
|
||||||
|
"This subscription has expired, please change to another subscription": "订阅已过期,请更换其它订阅",
|
||||||
|
"Coupon failed": "优惠券使用失败",
|
||||||
|
"Insufficient balance": "余额不足",
|
||||||
|
"Failed to create order": "订单创建失败",
|
||||||
|
"Order does not exist or has been paid": "订单不存在或已支付",
|
||||||
|
"Payment method is not available": "支付方式不可用",
|
||||||
|
"You can only cancel pending orders": "只可以取消待支付订单",
|
||||||
|
"Cancel failed": "取消失败",
|
||||||
|
"Currency conversion has timed out, please try again later": "货币转换超时,请稍后再试",
|
||||||
|
"Payment gateway request failed": "支付网关请求失败",
|
||||||
|
"Oops, there's a problem... Please refresh the page and try again later": "到了点问题,请刷新页面稍后再试",
|
||||||
|
"Payment failed. Please check your credit card information": "扣款失败,请检查信用卡信息",
|
||||||
|
"Article does not exist": "文章不存在",
|
||||||
|
"No active subscription. Unable to use our provided Apple ID": "无有效订阅,无法使用本站提供的 AppleID",
|
||||||
|
"You must have a valid subscription to view content in this area": "你必须拥有有效的订阅才可以查看该区域的内容",
|
||||||
|
"The maximum number of creations has been reached": "已达到创建数量上限",
|
||||||
|
"Coupon cannot be empty": "优惠券不能为空",
|
||||||
|
"This coupon is no longer available": "优惠券已无可用次数",
|
||||||
|
"This coupon has not yet started": "优惠券还未到可用时间",
|
||||||
|
"This coupon has expired": "优惠券已过期",
|
||||||
|
"The coupon code cannot be used for this subscription": "该订阅无法使用此优惠码",
|
||||||
|
"Invalid coupon": "优惠券无效",
|
||||||
|
"Invalid code is incorrect": "验证码有误",
|
||||||
|
"Email suffix is not in the Whitelist": "邮箱后缀不处于白名单中",
|
||||||
|
"Gmail alias is not supported": "不支持 Gmail 别名邮箱",
|
||||||
|
"Registration has closed": "本站已关闭注册",
|
||||||
|
"You must use the invitation code to register": "必须使用邀请码才可以注册",
|
||||||
|
"Email verification code cannot be empty": "邮箱验证码不能为空",
|
||||||
|
"Incorrect email verification code": "邮箱验证码有误",
|
||||||
|
"Email already exists": "邮箱已存在系统中",
|
||||||
|
"Invalid invitation code": "邀请码无效",
|
||||||
|
"Register failed": "注册失败",
|
||||||
|
"Incorrect email or password": "邮箱或密码错误",
|
||||||
|
"Your account has been suspended": "该账户已被停止使用",
|
||||||
|
"Token error": "令牌有误",
|
||||||
|
"This email is not registered in the system": "该邮箱不存在系统中",
|
||||||
|
"Email verification code has been sent, please request again later": "验证码已发送,请过一会再请求",
|
||||||
|
"Email verification code": "邮箱验证码",
|
||||||
|
"Plan ID cannot be empty": "套餐ID不能为空",
|
||||||
|
"Plan cycle cannot be empty": "套餐周期不能为空",
|
||||||
|
"Wrong plan cycle": "套餐周期参数有误",
|
||||||
|
"Ticket subject cannot be empty": "工单主题不能为空",
|
||||||
|
"Ticket level cannot be empty": "工单等级不能为空",
|
||||||
|
"Incorrect ticket level format": "工单等级参数有误",
|
||||||
|
"The withdrawal method cannot be empty": "提现方式不能为空",
|
||||||
|
"The withdrawal account cannot be empty": "提现账号不能为空",
|
||||||
|
"Old password cannot be empty": "旧密码不能为空",
|
||||||
|
"New password cannot be empty": "新密码不能为空",
|
||||||
|
"Password must be greater than 8 digits": "密码必须大于8个字符",
|
||||||
|
"The transfer amount cannot be empty": "划转金额不能为空",
|
||||||
|
"The transfer amount parameter is wrong": "划转金额参数有误",
|
||||||
|
"Incorrect format of expiration reminder": "过期提醒参数有误",
|
||||||
|
"Incorrect traffic alert format": "流量提醒参数有误",
|
||||||
|
"Email can not be empty": "邮箱不能为空",
|
||||||
|
"Email format is incorrect": "邮箱格式不正确",
|
||||||
|
"Password can not be empty": "密码不能为空"
|
||||||
|
}
|
@ -1,37 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
'auth' => [
|
|
||||||
'register' => [
|
|
||||||
'verify_incorrect' => '验证码有误',
|
|
||||||
'email_suffix_not_in_whitelist' => '邮箱后缀不处于白名单中',
|
|
||||||
'no_support_gmail_alias' => '不支持 Gmail 别名邮箱',
|
|
||||||
'close_register' => '本站已关闭注册',
|
|
||||||
'must_use_invite_code' => '必须使用邀请码才可以注册',
|
|
||||||
'email_code_not_empty' => '邮箱验证码不能为空',
|
|
||||||
'email_code_incorrect' => '邮箱验证码有误',
|
|
||||||
'email_exist_system' => '邮箱已存在系统中',
|
|
||||||
'invalid_invite_code' => '邀请码无效',
|
|
||||||
'register_failed' => '注册失败'
|
|
||||||
],
|
|
||||||
'login' => [
|
|
||||||
'wrong_email_or_password' => '邮箱或密码错误',
|
|
||||||
'account_been_discontinued' => '该账户已被停止使用'
|
|
||||||
],
|
|
||||||
'getQuickLoginUrl' => [
|
|
||||||
'wrong_token' => '令牌有误'
|
|
||||||
],
|
|
||||||
'forget' => [
|
|
||||||
'email_verification_code_incorrect' => '邮箱验证码有误',
|
|
||||||
'email_not_exist_system' => '该邮箱不存在系统中',
|
|
||||||
'reset_failed' => '重置失败'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'comm' => [
|
|
||||||
'sendEmailVerify' => [
|
|
||||||
'verification_code_incorrect' => '验证码有误',
|
|
||||||
'code_sent_request_later' => '验证码已发送,请过一会再请求',
|
|
||||||
'email_verification_code' => '邮箱验证码'
|
|
||||||
]
|
|
||||||
]
|
|
||||||
];
|
|
@ -1,135 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
'user' => [
|
|
||||||
'changePassword' => [
|
|
||||||
'user_not_exist' => '该用户不存在',
|
|
||||||
'old_password_wrong' => '旧密码有误',
|
|
||||||
'save_failed' => '保存失败'
|
|
||||||
],
|
|
||||||
'info' => [
|
|
||||||
'user_not_exist' => '该用户不存在'
|
|
||||||
],
|
|
||||||
'getSubscribe' => [
|
|
||||||
'user_not_exist' => '该用户不存在',
|
|
||||||
'plan_not_exist' => '订阅计划不存在',
|
|
||||||
],
|
|
||||||
'resetSecurity' => [
|
|
||||||
'user_not_exist' => '该用户不存在',
|
|
||||||
'reset_failed' => '重置失败'
|
|
||||||
],
|
|
||||||
'update' => [
|
|
||||||
'user_not_exist' => '该用户不存在',
|
|
||||||
'save_failed' => '保存失败',
|
|
||||||
],
|
|
||||||
'transfer' => [
|
|
||||||
'user_not_exist' => '该用户不存在',
|
|
||||||
'params_wrong' => '参数错误',
|
|
||||||
'insufficient_commission_balance' => '推广佣金余额不足',
|
|
||||||
'transfer_failed' => '划转失败'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'ticket' => [
|
|
||||||
'fetch' => [
|
|
||||||
'ticket_not_exist' => '工单不存在',
|
|
||||||
],
|
|
||||||
'save' => [
|
|
||||||
'exist_other_open_ticket' => '存在其它工单尚未处理',
|
|
||||||
'ticket_create_failed' => '工单创建失败',
|
|
||||||
],
|
|
||||||
'reply' => [
|
|
||||||
'params_wrong' => '参数错误',
|
|
||||||
'message_not_empty' => '消息不能为空',
|
|
||||||
'ticket_not_exist' => '工单不存在',
|
|
||||||
'ticket_close_not_reply' => '工单已关闭,无法回复',
|
|
||||||
'wait_reply' => '请等待技术支持回复',
|
|
||||||
'ticket_reply_failed' => '工单回复失败',
|
|
||||||
],
|
|
||||||
'close' => [
|
|
||||||
'params_wrong' => '参数错误',
|
|
||||||
'ticket_not_exist' => '工单不存在',
|
|
||||||
'close_failed' => '关闭失败',
|
|
||||||
],
|
|
||||||
'withdraw' => [
|
|
||||||
'not_support_withdraw_method' => '不支持的提现方式',
|
|
||||||
'system_require_withdraw_limit' => '当前系统要求的最少提现佣金为:¥:limitCNY',
|
|
||||||
'ticket_subject' => '[提现申请] 本工单由系统发出',
|
|
||||||
'ticket_create_failed' => '工单创建失败',
|
|
||||||
'ticket_message' => "提现方式::method\r\n提现账号::account\r\n",
|
|
||||||
'not_support_withdraw' => '不支持提现'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'plan' => [
|
|
||||||
'fetch' => [
|
|
||||||
'plan_not_exist' => '订阅计划不存在'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'order' => [
|
|
||||||
'details' => [
|
|
||||||
'order_not_exist' => '订单不存在',
|
|
||||||
'plan_not_exist' => '订阅计划不存在',
|
|
||||||
],
|
|
||||||
'save' => [
|
|
||||||
'plan_not_exist' => '订阅计划不存在',
|
|
||||||
'exist_open_order' => '您有未付款或开通中的订单,请稍后再试或将其取消',
|
|
||||||
'plan_stop_sell' => '该订阅已售罄,请更换其它订阅',
|
|
||||||
'plan_stop_renew' => '该订阅无法续费,请更换其它订阅',
|
|
||||||
'plan_stop' => '该订阅周期无法进行购买,请选择其它周期',
|
|
||||||
'plan_exist_not_buy_package' => '订阅已过期或无有效订阅,无法购买重置包',
|
|
||||||
'plan_expired' => '订阅已过期,请更换其它订阅',
|
|
||||||
'coupon_use_failed' => '优惠券使用失败',
|
|
||||||
'insufficient_balance' => '余额不足',
|
|
||||||
'order_create_failed' => '订单创建失败'
|
|
||||||
],
|
|
||||||
'checkout' => [
|
|
||||||
'order_not_exist_or_paid' => '订单不存在或已支付',
|
|
||||||
'pay_method_not_use' => '支付方式不可用',
|
|
||||||
],
|
|
||||||
'check' => [
|
|
||||||
'order_not_exist' => '订单不存在'
|
|
||||||
],
|
|
||||||
'cancel' => [
|
|
||||||
'params_wrong' => '参数有误',
|
|
||||||
'order_not_exist' => '订单不存在',
|
|
||||||
'only_cancel_pending_order' => '只可以取消待支付订单',
|
|
||||||
'cancel_failed' => '取消失败',
|
|
||||||
],
|
|
||||||
'stripeAlipay' => [
|
|
||||||
'currency_convert_timeout' => '货币转换超时,请稍后再试',
|
|
||||||
'gateway_request_failed' => '支付网关请求失败',
|
|
||||||
],
|
|
||||||
'stripeWepay' => [
|
|
||||||
'currency_convert_timeout' => '货币转换超时,请稍后再试',
|
|
||||||
'gateway_request_failed' => '支付网关请求失败',
|
|
||||||
],
|
|
||||||
'stripeCard' => [
|
|
||||||
'currency_convert_timeout' => '货币转换超时,请稍后再试',
|
|
||||||
'was_problem' => '遇到了点问题,请刷新页面稍后再试',
|
|
||||||
'deduction_failed' => '扣款失败,请检查信用卡信息'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'knowledge' => [
|
|
||||||
'fetch' => [
|
|
||||||
'knowledge_not_exist' => '文章不存在',
|
|
||||||
'apple_id_must_be_plan' => '无有效订阅,无法使用本站提供的 AppleID'
|
|
||||||
],
|
|
||||||
'formatAccessData' => [
|
|
||||||
'no_access' => '你必须拥有有效的订阅才可以查看该区域的内容'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'invite' => [
|
|
||||||
'save' => [
|
|
||||||
'invite_create_limit' => '已达到创建数量上限'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'coupon' => [
|
|
||||||
'check' => [
|
|
||||||
'coupon_not_empty' => '优惠券不能为空',
|
|
||||||
'coupon_invalid' => '优惠券无效',
|
|
||||||
'coupon_not_available_by_number' => '优惠券已无可用次数',
|
|
||||||
'coupon_not_available_by_time' => '优惠券还未到可用时间',
|
|
||||||
'coupon_expired' => '优惠券已过期',
|
|
||||||
'coupon_limit_plan' => '该订阅无法使用此优惠码'
|
|
||||||
]
|
|
||||||
]
|
|
||||||
];
|
|
Loading…
Reference in New Issue
Block a user