15th_final and clean
This commit is contained in:
@@ -246,13 +246,7 @@ const handleMenuClick = () => {
|
||||
const showNotifications = async () => {
|
||||
notificationDrawerVisible.value = true
|
||||
// 載入最新通知
|
||||
console.log('🔔 正在載入通知...')
|
||||
try {
|
||||
await notificationStore.fetchNotifications()
|
||||
console.log('🔔 通知載入完成:', notificationStore.notifications.length)
|
||||
} catch (error) {
|
||||
console.error('🔔 通知載入失敗:', error)
|
||||
}
|
||||
await notificationStore.fetchNotifications()
|
||||
}
|
||||
|
||||
const handleUserMenuCommand = async (command) => {
|
||||
@@ -337,12 +331,7 @@ onMounted(() => {
|
||||
// initWebSocket()
|
||||
|
||||
// 載入通知
|
||||
console.log('🔔 初始化載入通知...')
|
||||
notificationStore.fetchNotifications().then(() => {
|
||||
console.log('🔔 初始化通知載入完成:', notificationStore.notifications.length)
|
||||
}).catch(error => {
|
||||
console.error('🔔 初始化通知載入失敗:', error)
|
||||
})
|
||||
notificationStore.fetchNotifications()
|
||||
|
||||
// 監聽窗口大小變化
|
||||
window.addEventListener('resize', handleResize)
|
||||
|
@@ -6,7 +6,7 @@ import NProgress from 'nprogress'
|
||||
|
||||
// 創建 axios 實例
|
||||
const service = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://127.0.0.1:5000/api/v1',
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://127.0.0.1:12010/api/v1',
|
||||
timeout: 30000, // 30秒超時
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
@@ -18,20 +18,11 @@ service.interceptors.request.use(
|
||||
config => {
|
||||
NProgress.start()
|
||||
|
||||
console.log('🚀 [API Request]', {
|
||||
method: config.method.toUpperCase(),
|
||||
url: config.url,
|
||||
baseURL: config.baseURL,
|
||||
fullURL: `${config.baseURL}${config.url}`,
|
||||
headers: config.headers,
|
||||
timestamp: new Date().toISOString()
|
||||
})
|
||||
|
||||
// JWT 認證:添加 Authorization header
|
||||
const authStore = useAuthStore()
|
||||
if (authStore.token) {
|
||||
config.headers.Authorization = `Bearer ${authStore.token}`
|
||||
console.log('🔑 [JWT Token]', `Bearer ${authStore.token.substring(0, 20)}...`)
|
||||
}
|
||||
|
||||
return config
|
||||
@@ -171,7 +162,7 @@ service.interceptors.response.use(
|
||||
|
||||
// 檔案上傳專用請求實例
|
||||
export const uploadRequest = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://127.0.0.1:5000/api/v1',
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://127.0.0.1:12010/api/v1',
|
||||
timeout: 120000, // 2分鐘超時
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
|
@@ -26,7 +26,7 @@ class WebSocketService {
|
||||
|
||||
try {
|
||||
// 建立 Socket.IO 連接
|
||||
const wsUrl = import.meta.env.VITE_WS_BASE_URL || 'http://127.0.0.1:5000'
|
||||
const wsUrl = import.meta.env.VITE_WS_BASE_URL || 'http://127.0.0.1:12010'
|
||||
console.log('🔌 [WebSocket] 嘗試連接到:', wsUrl)
|
||||
|
||||
this.socket = io(wsUrl, {
|
||||
|
Reference in New Issue
Block a user