From 11c56d5233536b3b63c6be5adce5a344d3009318 Mon Sep 17 00:00:00 2001 From: jiangx <1457960500@qq.com> Date: Mon, 19 Jun 2023 17:06:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/utils.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 0f6d1d7..7a67874 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -1,3 +1,5 @@ +import { PREFIX } from '@/enums' + /** *随机数 * @param {number} max @@ -117,15 +119,8 @@ export const formatDay = (date: Date, format: 'y.m.d' | 'y/m/d' | 'y-m-d' = 'y-m return `${year}-${month}-${week}` } -//判断当前系统 -export const isAndroid = () => { - const userAgent = navigator.userAgent - const agents = ['Android', 'iPhone', 'iPad'] as const - return agents.some(item => userAgent.includes(item)) -} - //指定key的图片类型加上前缀 -export const addPrefixByRecursive = (data: any[], prefix = '/static/offline', exp = /\.(png|jpg|jpeg|JPG|PNG|MP4|mp4)$/) => { +export const addPrefixByRecursive = (data: any[], prefix = PREFIX.STATIC_URL, exp = /\.(png|jpg|jpeg|JPG|PNG|MP4|mp4)$/) => { if (data && typeof data === 'object') { for (const key in data) { if (typeof data[key] === 'string' && exp.test(data[key])) {