diff --git a/CHANGELOG.md b/CHANGELOG.md index 51f2d0e6e..57cbba7c6 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. +### v3.2.5 (2021-12-17) + +**Feature** + +- `HitHub` > `GitHub` +- Improve axios error infos +- Suspend `Wallpaper` service + ### v3.2.4 (2021-12-17) **Feature** diff --git a/package.json b/package.json index 3a76ce121..3e7ae1ef5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "surmon.me", - "version": "3.2.4", + "version": "3.2.5", "description": "Surmon.me blog", "author": { "name": "Surmon", diff --git a/src/components/layout/mobile/aside.vue b/src/components/layout/mobile/aside.vue index f0b6db98e..4dbd7e7a4 100755 --- a/src/components/layout/mobile/aside.vue +++ b/src/components/layout/mobile/aside.vue @@ -204,7 +204,6 @@ margin-bottom: 0.5em; border: none; text-decoration: none; - text-transform: uppercase; font-weight: 700; color: $white; diff --git a/src/components/widget/wallpaper/main.vue b/src/components/widget/wallpaper/main.vue index 9e2543d81..e15864383 100755 --- a/src/components/widget/wallpaper/main.vue +++ b/src/components/widget/wallpaper/main.vue @@ -51,7 +51,9 @@ } onMounted(() => { - wallpaperStore.fetchPapers() + wallpaperStore.fetchPapers().catch((error) => { + console.warn(`[wallpaper] error:`, error) + }) }) return { diff --git a/src/language/data.ts b/src/language/data.ts index 5ee9f5449..54ec60f88 100755 --- a/src/language/data.ts +++ b/src/language/data.ts @@ -44,7 +44,7 @@ export const langMap: I18nMap = { }, [LANGUAGE_KEYS.PAGE_GITHUB]: { [Language.Zh]: '丹青阁', - [Language.En]: 'HitHub' + [Language.En]: 'GitHub' }, [LANGUAGE_KEYS.PAGE_ARCHIVE]: { [Language.Zh]: '万象殿', diff --git a/src/pages/about/helper.ts b/src/pages/about/helper.ts index 2734da8fa..09d4968a7 100644 --- a/src/pages/about/helper.ts +++ b/src/pages/about/helper.ts @@ -40,7 +40,7 @@ export const i18ns = { }, TelegramGroup: { [Language.Zh]: `加入电报群`, - [Language.En]: `Join Telegram group` + [Language.En]: `Telegram group` } } diff --git a/src/server/tunnel/index.ts b/src/server/tunnel/index.ts index 87ac49b4f..c6dc6fd25 100644 --- a/src/server/tunnel/index.ts +++ b/src/server/tunnel/index.ts @@ -26,7 +26,7 @@ const handleTunnelService = (tunnelService: () => Promise): RequestHandler .then((data) => response.send(data)) .catch((error) => { response.status(INVALID_ERROR) - response.send(error.message) + response.send(error?.message || String(error)) }) } } diff --git a/src/server/tunnel/wallpaper.ts b/src/server/tunnel/wallpaper.ts index a51fc0a25..22feea220 100644 --- a/src/server/tunnel/wallpaper.ts +++ b/src/server/tunnel/wallpaper.ts @@ -27,20 +27,22 @@ const fetchWallpapers = async (params?: WonderfulBingWallpaperOption): Promise - fetchWallpapers({ +const fetchZHWallpapers = () => { + return fetchWallpapers({ local: 'zh-CN', host: 'cn.bing.com', ensearch: 0 }) +} // 今日壁纸缓存(EN) -const getENWallpapers = () => - fetchWallpapers({ +const getENWallpapers = () => { + return fetchWallpapers({ local: 'en-US', host: 'bing.com', ensearch: 1 }) +} const fetchAllWallpapers = async (): Promise => { const [zh, en] = await Promise.all([fetchZHWallpapers(), getENWallpapers()]) @@ -54,9 +56,9 @@ const autoUpdateData = () => { tunnelCache.set(TunnelModule.Wallpaper, data) }) .catch((error) => { - // 失败后 10 分钟更新一次数据 + // 失败后 30 分钟更新一次数据 console.warn('[Tunnel Wallpaper]', '请求失败', error) - setTimeout(autoUpdateData, 1000 * 60 * 10) + setTimeout(autoUpdateData, 1000 * 60 * 30) }) } @@ -66,11 +68,13 @@ autoUpdateData() schedule.scheduleJob('10 0 0 * * *', autoUpdateData) export const wallpaperService = async (): Promise => { - if (tunnelCache.has(TunnelModule.Wallpaper)) { - return tunnelCache.get(TunnelModule.Wallpaper) - } else { - const data = await fetchAllWallpapers() - tunnelCache.set(TunnelModule.Wallpaper, data) - return data - } + // GFW! https://www.ithome.com/0/592/920.htm + return Promise.reject(`GFW! https://www.ithome.com/0/592/920.htm`) + // if (tunnelCache.has(TunnelModule.Wallpaper)) { + // return tunnelCache.get(TunnelModule.Wallpaper) + // } else { + // const data = await fetchAllWallpapers() + // tunnelCache.set(TunnelModule.Wallpaper, data) + // return data + // } } diff --git a/src/services/music.ts b/src/services/music.ts index 4e3cef611..acfc8bfd4 100755 --- a/src/services/music.ts +++ b/src/services/music.ts @@ -6,8 +6,9 @@ */ import { App, Plugin, inject, readonly, reactive, computed } from 'vue' -import { getFileProxyUrl } from '/@/transforms/url' +import { UNDEFINED } from '/@/constants/value' import { TunnelModule } from '/@/constants/tunnel' +import { getFileProxyUrl } from '/@/transforms/url' import type { Song } from '/@/server/tunnel/music' import tunnel from '/@/services/tunnel' @@ -84,6 +85,8 @@ const createMusicPlayer = (config: PlayerConfig) => { const currentSong = computed(() => { if (state.inited && state.index !== undefined) { return amplitude.getActiveSongMetadata() + } else { + return UNDEFINED } }) diff --git a/src/services/nodepress.ts b/src/services/nodepress.ts index 80471e727..8cc51ced2 100644 --- a/src/services/nodepress.ts +++ b/src/services/nodepress.ts @@ -46,9 +46,8 @@ nodepress.interceptors.response.use( : { name: errorJSON.name, message: errorJSON.message, - code: errorJSON.code, status: errorJSON.status, - stack: errorJSON.stack, + code: errorJSON.code, method: errorJSON.config.method, baseURL: errorJSON.config.baseURL, url: errorJSON.config.url,