mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 15:10:54 +00:00
@@ -36,7 +36,7 @@ class ArticleController extends Controller
|
||||
{
|
||||
$data = $request->except('_method', '_token');
|
||||
// LOGO
|
||||
if ($request->input('type') != 4 && $request->hasFile('logo')) {
|
||||
if ($request->input('type') !== "4" && $request->hasFile('logo')) {
|
||||
$data['logo'] = 'upload/'.$request->file('logo')->store('images');
|
||||
if (!$data['logo']) {
|
||||
Session::flash('errorMsg', 'LOGO不合法');
|
||||
@@ -45,14 +45,14 @@ class ArticleController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$id = Article::insertGetId($data);
|
||||
if ($id) {
|
||||
$article = Article::create($data);
|
||||
if ($article->id) {
|
||||
Session::flash('successMsg', '添加成功');
|
||||
} else {
|
||||
Session::flash('errorMsg', '添加失败');
|
||||
}
|
||||
|
||||
return Redirect::to(route('admin.article.edit', $id));
|
||||
return Redirect::to(route('admin.article.edit', $article->id));
|
||||
}
|
||||
|
||||
// 文章页面
|
||||
|
||||
@@ -40,11 +40,11 @@ class BaseController
|
||||
$obj->log_time = time();
|
||||
$obj->save();
|
||||
|
||||
if ($obj->id) {
|
||||
return $this->returnData('上报节点心跳信息成功', 'success', 200);
|
||||
if (!$obj->id) {
|
||||
return $this->returnData('生成节点心跳信息失败');
|
||||
}
|
||||
|
||||
return $this->returnData('上报节点心跳信息失败,请检查字段');
|
||||
return $this->returnData('上报节点心跳信息成功', 'success', 200);
|
||||
}
|
||||
|
||||
// 返回数据
|
||||
@@ -72,11 +72,7 @@ class BaseController
|
||||
$onlineCount = 0;
|
||||
foreach ($inputArray as $input) {
|
||||
if (!Arr::has($input, ['ip', 'uid'])) {
|
||||
return $this->returnData('上报节点在线情况失败,请检查字段');
|
||||
}
|
||||
|
||||
if (!isset($input['ip'], $input['uid'])) {
|
||||
return $this->returnData('上报节点在线情况失败,请检查字段');
|
||||
return $this->returnData('上报节点在线用户IP信息失败,请检查字段');
|
||||
}
|
||||
|
||||
$obj = new NodeOnlineUserIp();
|
||||
@@ -88,7 +84,7 @@ class BaseController
|
||||
$obj->save();
|
||||
|
||||
if (!$obj->id) {
|
||||
return $this->returnData('上报节点在线情况失败,请检查字段');
|
||||
return $this->returnData('生成节点在线用户IP信息失败');
|
||||
}
|
||||
$onlineCount++;
|
||||
}
|
||||
@@ -103,14 +99,14 @@ class BaseController
|
||||
return $this->returnData('上报节点在线情况成功', 'success', 200);
|
||||
}
|
||||
|
||||
return $this->returnData('上报节点在线情况失败,请检查字段');
|
||||
return $this->returnData('生成节点在线情况失败');
|
||||
}
|
||||
|
||||
// 上报用户流量日志
|
||||
public function setUserTraffic(Request $request, $id): JsonResponse
|
||||
{
|
||||
foreach ($request->all() as $input) {
|
||||
if (Arr::exists($input, 'uid')) {
|
||||
if (!Arr::exists($input, 'uid')) {
|
||||
return $this->returnData('上报用户流量日志失败,请检查字段');
|
||||
}
|
||||
|
||||
@@ -127,7 +123,7 @@ class BaseController
|
||||
$log->save();
|
||||
|
||||
if (!$log->id) {
|
||||
return $this->returnData('上报用户流量日志失败,请检查字段');
|
||||
return $this->returnData('生成用户流量日志失败');
|
||||
}
|
||||
$user = User::find($log->user_id);
|
||||
if ($user) {
|
||||
@@ -181,10 +177,10 @@ class BaseController
|
||||
$obj->save();
|
||||
|
||||
if ($obj->id) {
|
||||
return $this->returnData('上报用户触发审计规则记录成功', 'success', 200);
|
||||
return $this->returnData('上报用户触发审计规则日志成功', 'success', 200);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->returnData('上报用户触发审计规则记录失败');
|
||||
return $this->returnData('上报用户触发审计规则日志失败');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ class AuthController extends Controller
|
||||
$logId = Helpers::addNotificationLog('注册激活', '请求地址:'.$activeUserUrl, 1, $email);
|
||||
Mail::to($email)->send(new activeUser($logId, $activeUserUrl));
|
||||
|
||||
Session::flash('regSuccessMsg', trans('auth.register_active_tip'));
|
||||
Session::flash('successMsg', trans('auth.register_active_tip'));
|
||||
} else {
|
||||
// 则直接给推荐人加流量
|
||||
if ($inviter_id) {
|
||||
@@ -351,7 +351,7 @@ class AuthController extends Controller
|
||||
User::find($uid)->update(['status' => 1]);
|
||||
}
|
||||
|
||||
Session::flash('regSuccessMsg', trans('auth.register_success'));
|
||||
Session::flash('successMsg', trans('auth.register_success'));
|
||||
}
|
||||
|
||||
return Redirect::route('login')->withInput();
|
||||
|
||||
@@ -27,7 +27,7 @@ class UserUpdateRequest extends FormRequest
|
||||
'is_admin' => 'boolean|exclude_unless:id,1|gte:1',
|
||||
'reset_time' => 'nullable|date_format:Y-m-d',
|
||||
'invite_num' => 'numeric',
|
||||
'status' => 'required|boolean',
|
||||
'status' => 'required|integer|between:-1,1',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@
|
||||
swal.fire({title: ret.message, timer: 1000, showConfirmButton: false});
|
||||
}
|
||||
},
|
||||
error: function(ret) {
|
||||
error: function(data) {
|
||||
let str = '';
|
||||
const errors = data.responseJSON;
|
||||
if ($.isEmptyObject(errors) === false) {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
@if($errors->any())
|
||||
<x-alert type="danger" :message="$errors->all()"/>
|
||||
@endif
|
||||
@if (Session::get('regSuccessMsg'))
|
||||
<x-alert type="success" :message="Session::get('regSuccessMsg')"/>
|
||||
@if (Session::get('successMsg'))
|
||||
<x-alert type="success" :message="Session::get('successMsg')"/>
|
||||
@endif
|
||||
<div class="form-group form-material floating" data-plugin="formMaterial">
|
||||
<input type="email" class="form-control" name="email" value="{{Request::old('email')}}" required/>
|
||||
|
||||
Reference in New Issue
Block a user