From c5233454b3c283cc0c4fe1e50c3bf82ff0a8eaa4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com>
Date: Thu, 24 Sep 2026 17:03:30 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=95=BF=E8=BF=9E?=
=?UTF-8?q?=E6=8E=A5=E6=A3=80=E6=9F=A5=E5=92=8C=E6=8F=90=E7=A4=BA=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../adminapi/controller/PublicController.php | 1 +
.../admin/src/pages/account/login/index.vue | 27 +++++++++++++++++++
.../admin/src/pages/system/auth/index.vue | 7 ++++-
3 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/backend/app/adminapi/controller/PublicController.php b/backend/app/adminapi/controller/PublicController.php
index de8e414b2..ebc2f36e4 100644
--- a/backend/app/adminapi/controller/PublicController.php
+++ b/backend/app/adminapi/controller/PublicController.php
@@ -155,6 +155,7 @@ class PublicController
};
$runtime = root_path('runtime');
$info['process'] = [
+ ['name' => '长链接', 'require' => '开启', 'value' => $isHeartbeatFresh($runtime . '.workerman') || $checkLegacyPid('workerman')],
['name' => '定时任务', 'require' => '开启', 'value' => $isHeartbeatFresh($runtime . '.timer') || $checkLegacyPid('timer')],
['name' => '消息队列', 'require' => '开启', 'value' => sys_config('queue_open', 0) == 1 && $isHeartbeatFresh($runtime . '.queue_heartbeat')],
];
diff --git a/frontend/admin/src/pages/account/login/index.vue b/frontend/admin/src/pages/account/login/index.vue
index 499880f38..7b4420d85 100644
--- a/frontend/admin/src/pages/account/login/index.vue
+++ b/frontend/admin/src/pages/account/login/index.vue
@@ -87,6 +87,7 @@ import 'swiper/css';
import 'swiper/css/pagination';
import { AccountLogin, loginInfoApi } from '@/api/account';
+import { getWorkermanUrl } from '@/api/setting';
import { setCookies } from '@/libs/util';
import '@/assets/js/canvas-nest.min';
import Verify from '@/components/verifition/Verify';
@@ -237,6 +238,7 @@ function closeModel(params) {
});
}, 0);
}
+ checkSocket();
} catch (e) {}
PrevLoading.start();
router.push({
@@ -266,6 +268,31 @@ function formatTwoStageRoutes(arr) {
keepAliveNamesStore.setCacheKeepAlive(cacheList);
}
}
+function checkSocket() {
+ getWorkermanUrl()
+ .then((res) => {
+ const url = res.data.admin;
+ let isNotice = false;
+ const socket = new window.WebSocket(url);
+ socket.onopen = () => {
+ isNotice = true;
+ socket.close();
+ };
+ socket.onerror = socket.onclose = () => {
+ if (!isNotice) {
+ isNotice = true;
+ ElNotification.warning({
+ title: '温馨提示',
+ message:
+ '您的【长连接】未开启,没有开启会导致系统默认客服无法使用,后台订单通知无法收到。请尽快执行命令开启!!点击查看开启方法',
+ dangerouslyUseHTMLString: true,
+ duration: 30000,
+ });
+ }
+ };
+ })
+ .catch(() => {});
+}
function getExpiresTime(expiresTime) {
const nowTimeNum = Math.round(Date.now() / 1000);
const expiresTimeNum = expiresTime - nowTimeNum;
diff --git a/frontend/admin/src/pages/system/auth/index.vue b/frontend/admin/src/pages/system/auth/index.vue
index 694e64c09..88e6919f7 100644
--- a/frontend/admin/src/pages/system/auth/index.vue
+++ b/frontend/admin/src/pages/system/auth/index.vue
@@ -36,8 +36,13 @@ import { copyrightList as copyrightListApi } from '@/api/system';
defineOptions({ name: 'system_auth' });
const tableList = ref([]);
-// 与后端 process 数组顺序一一对应(长链接已移除):0=定时任务 1=消息队列
+// 与后端 process 数组顺序一一对应:0=长链接 1=定时任务 2=消息队列
const trips = [
+ {
+ title: '温馨提示',
+ message:
+ '您的【长连接】未开启,没有开启会导致系统默认客服无法使用,后台订单通知无法收到。请尽快执行命令开启!!点击查看开启方法',
+ },
{
title: '温馨提示',
message: