diff --git a/src/components/common/app-provider.vue b/src/components/common/app-provider.vue
index 6330c496..f6aa5271 100644
--- a/src/components/common/app-provider.vue
+++ b/src/components/common/app-provider.vue
@@ -1,9 +1,7 @@
diff --git a/src/layouts/base-layout/index.vue b/src/layouts/base-layout/index.vue
index 7debe5d1..3e58cd4e 100644
--- a/src/layouts/base-layout/index.vue
+++ b/src/layouts/base-layout/index.vue
@@ -1,9 +1,11 @@
diff --git a/src/theme/settings.ts b/src/theme/settings.ts
index dbae7247..f88320ba 100644
--- a/src/theme/settings.ts
+++ b/src/theme/settings.ts
@@ -1,15 +1,15 @@
/** Default theme settings */
export const themeSettings: App.Theme.ThemeSetting = {
- themeScheme: 'light',
+ themeScheme: 'auto',
grayscale: false,
colourWeakness: false,
recommendColor: false,
- themeColor: '#2080f0',
+ themeColor: '#0E42D2',
otherColor: {
- info: '#2080f0',
- success: '#52c41a',
- warning: '#faad14',
- error: '#f5222d'
+ info: '#0E42D2',
+ success: '#009A29',
+ warning: '#D25F00',
+ error: '#CB2634'
},
isInfoFollowPrimary: true,
layout: {
diff --git a/src/utils/sse.ts b/src/utils/sse.ts
index 3c9b803f..a17112bf 100644
--- a/src/utils/sse.ts
+++ b/src/utils/sse.ts
@@ -5,10 +5,10 @@ import { localStg } from './storage';
// 初始化
export const initSSE = (url: any) => {
- if (import.meta.env.VITE_APP_SSE === 'N') {
+ const token = localStg.get('token');
+ if (import.meta.env.VITE_APP_SSE === 'N' || !token) {
return;
}
- const token = localStg.get('token');
const sseUrl = `${url}?Authorization=Bearer ${token}&clientid=${import.meta.env.VITE_APP_CLIENT_ID}`;
const { data, error } = useEventSource(sseUrl, [], {
autoReconnect: {
diff --git a/src/utils/websocket.ts b/src/utils/websocket.ts
index 3e63a28a..519585d4 100644
--- a/src/utils/websocket.ts
+++ b/src/utils/websocket.ts
@@ -32,12 +32,12 @@ let socketError = 0; // 错误次数
// 初始化socket
export function initWebSocket(url: any) {
- if (import.meta.env.VITE_APP_WEBSOCKET === 'N') {
+ const token = localStg.get('token');
+ if (import.meta.env.VITE_APP_WEBSOCKET === 'N' || !token) {
return null;
}
socketUrl = url;
// 初始化 websocket
- const token = localStg.get('token');
websocket = new WebSocket(`${url}?Authorization=Bearer ${token}&clientid=${import.meta.env.VITE_APP_CLIENT_ID}`);
websocketonopen();
websocketonmessage();