diff --git a/src/enums/index.ts b/src/enums/index.ts index c27a790..78eb131 100644 --- a/src/enums/index.ts +++ b/src/enums/index.ts @@ -6,8 +6,8 @@ export enum ACTIVITY_TYPE { } export enum DEVICE { - window = 'windows', - android = 'android' + WINDOW = 'windows', + ANDROID = 'android' } //卡片推荐类型 diff --git a/src/http/http.ts b/src/http/http.ts index bb0d650..c5ae1eb 100644 --- a/src/http/http.ts +++ b/src/http/http.ts @@ -31,7 +31,7 @@ class Request { // 使用实例拦截器 this.instance.interceptors.request.use(this.interceptorsObj?.requestInterceptors, this.interceptorsObj?.requestInterceptorsCatch) this.instance.interceptors.response.use(this.interceptorsObj?.responseInterceptors, this.interceptorsObj?.responseInterceptorsCatch) - // 全局响应拦截器保证最后执行 + this.instance.interceptors.response.use( (res: AxiosResponse) => { const url = res.config.url || '' @@ -43,14 +43,13 @@ class Request { } request(config: RequestConfig): Promise { return new Promise((resolve, reject) => { - // 如果为单个请求设置拦截器,这里使用单个请求的拦截器 if (config.interceptors?.requestInterceptors) { config = config.interceptors.requestInterceptors(config as any) } this.instance .request(config) .then(res => { - // 如果为单个响应设置拦截器,这里使用单个响应的拦截器 + // 如果为单个响应设置拦截器,使用单个响应的拦截器 if (config.interceptors?.responseInterceptors) { res = config.interceptors.responseInterceptors(res) } diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 550d7d5..f29476b 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -1,5 +1,10 @@ { "detail": "Detail", "nav": "Navigate", - "energy": "Energy" + "energy": "Energy", + "replay": "Replay", + "pause": "Pause", + "play": "Play", + "speedUp": "Speed up", + "stopSpeedUp": "Stop acceleration" } diff --git a/src/i18n/lang/tw.json b/src/i18n/lang/tw.json index b8d1a78..9d64211 100644 --- a/src/i18n/lang/tw.json +++ b/src/i18n/lang/tw.json @@ -1,5 +1,10 @@ { "detail": "詳情", "nav": "導航", - "energy": "新能源" + "energy": "新能源", + "replay": "重播", + "pause": "暫停", + "play": "播放", + "speedUp": "加速", + "stopSpeedUp": "停止加速" } diff --git a/src/i18n/lang/zh.json b/src/i18n/lang/zh.json index aec7e66..e2ae349 100644 --- a/src/i18n/lang/zh.json +++ b/src/i18n/lang/zh.json @@ -1,5 +1,10 @@ { "detail": "详情", "nav": "导航", - "energy": "新能源" + "energy": "新能源", + "replay": "重播", + "pause": "暂停", + "play": "播放", + "speedUp": "加速", + "stopSpeedUp": "停止加速" } diff --git a/src/plugins/index.ts b/src/plugins/index.ts index d093f8c..723beae 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -1,6 +1,6 @@ import { switchLanguage } from './switchLanguage' import VueLazyLoad from 'vue3-lazyload' -import { App } from 'vue' +import type { App } from 'vue' export function setupPlugins(app: App) { app.use(switchLanguage).use(VueLazyLoad, { diff --git a/src/utils/utils.ts b/src/utils/utils.ts index bf0964d..b4b768d 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -120,7 +120,7 @@ export const formatDay = (date: Date, format: 'y.m.d' | 'y/m/d' | 'y-m-d' = 'y-m //判断当前系统 export const isAndroid = () => { const userAgent = navigator.userAgent - const agents = ['Android', 'iPhone', 'iPad'] + const agents = ['Android', 'iPhone', 'iPad'] as const return agents.some(item => userAgent.includes(item)) } diff --git a/src/views/Guide/Guide.vue b/src/views/Guide/Guide.vue index 6fb8770..ca86b98 100644 --- a/src/views/Guide/Guide.vue +++ b/src/views/Guide/Guide.vue @@ -2,7 +2,7 @@
Guide Page
-