diff --git a/.env b/.env index 8b27fe6f3..2f3df55d1 100644 --- a/.env +++ b/.env @@ -13,8 +13,8 @@ VITE_AUTH_ROUTE_MODE=static VITE_ROUTE_HOME_PATH=/dashboard/analysis # iconify图标作为组件的前缀 -VITE_ICON_PREFFIX=icon +VITE_ICON_PREFIX=icon -# 本地SVG图标作为组件的前缀, 请注意一定要包含 VITE_ICON_PREFFIX -# 格式 {VITE_ICON_PREFFIX}-{本地图标集合名称} -VITE_ICON_LOCAL_PREFFIX=icon-local +# 本地SVG图标作为组件的前缀, 请注意一定要包含 VITE_ICON_PREFIX +# 格式 {VITE_ICON_PREFIX}-{本地图标集合名称} +VITE_ICON_LOCAL_PREFIX=icon-local diff --git a/.vscode/settings.json b/.vscode/settings.json index 4c9359f8f..95393fe4f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,19 @@ { + "cSpell.words": [ + "AMAP", + "antv", + "colord", + "echarts", + "iconify", + "Sider", + "unocss", + "unplugin", + "vditor", + "vueuse", + "wangeditor", + "wechat", + "xgplayer" + ], "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, @@ -8,15 +23,15 @@ "strings": true }, "editor.tabSize": 2, - "eslint.validate": ["svelte", "astro", "json"], + "eslint.validate": ["json"], "files.associations": { "*.env.*": "dotenv", "*.svg": "html" }, "files.eol": "\n", + "i18n-ally.localesPaths": ["src/locales", "src/locales/lang"], "[html][css][less][scss][sass][markdown][yaml][yml][jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true - }, - "i18n-ally.localesPaths": ["src/locales", "src/locales/lang"] + } } diff --git a/build/plugins/unplugin.ts b/build/plugins/unplugin.ts index ef840458e..e42a81d13 100644 --- a/build/plugins/unplugin.ts +++ b/build/plugins/unplugin.ts @@ -7,13 +7,13 @@ import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'; import { getSrcPath } from '../utils'; export default function unplugin(viteEnv: ImportMetaEnv) { - const { VITE_ICON_PREFFIX, VITE_ICON_LOCAL_PREFFIX } = viteEnv; + const { VITE_ICON_PREFIX, VITE_ICON_LOCAL_PREFIX } = viteEnv; const srcPath = getSrcPath(); const localIconPath = `${srcPath}/assets/svg-icon`; /** 本地svg图标集合名称 */ - const collectionName = VITE_ICON_LOCAL_PREFFIX.replace(`${VITE_ICON_PREFFIX}-`, ''); + const collectionName = VITE_ICON_LOCAL_PREFIX.replace(`${VITE_ICON_PREFIX}-`, ''); return [ Icons({ @@ -31,12 +31,12 @@ export default function unplugin(viteEnv: ImportMetaEnv) { types: [{ from: 'vue-router', names: ['RouterLink', 'RouterView'] }], resolvers: [ NaiveUiResolver(), - IconsResolver({ customCollections: [collectionName], componentPrefix: VITE_ICON_PREFFIX }) + IconsResolver({ customCollections: [collectionName], componentPrefix: VITE_ICON_PREFIX }) ] }), createSvgIconsPlugin({ iconDirs: [localIconPath], - symbolId: `${VITE_ICON_LOCAL_PREFFIX}-[dir]-[name]`, + symbolId: `${VITE_ICON_LOCAL_PREFIX}-[dir]-[name]`, inject: 'body-last', customDomId: '__SVG_ICON_LOCAL__' }) diff --git a/src/components/custom/svg-icon.vue b/src/components/custom/svg-icon.vue index cfd83fcac..380baa69b 100644 --- a/src/components/custom/svg-icon.vue +++ b/src/components/custom/svg-icon.vue @@ -37,7 +37,7 @@ const bindAttrs = computed<{ class: string; style: string }>(() => ({ })); const symbolId = computed(() => { - const { VITE_ICON_LOCAL_PREFFIX: preffix } = import.meta.env; + const { VITE_ICON_LOCAL_PREFIX: preffix } = import.meta.env; const defaultLocalIcon = 'no-icon'; diff --git a/src/config/map-sdk.ts b/src/config/map-sdk.ts index f0b806633..e4c241796 100644 --- a/src/config/map-sdk.ts +++ b/src/config/map-sdk.ts @@ -2,7 +2,7 @@ export const BAIDU_MAP_SDK_URL = `https://api.map.baidu.com/getscript?v=3.0&ak=KSezYymXPth1DIGILRX3oYN9PxbOQQmU&services=&t=20210201100830&s=1`; /** 高德地图sdk地址 */ -export const GAODE_MAP_SDK_URL = 'https://webapi.amap.com/maps?v=2.0&key=e7bd02bd504062087e6563daf4d6721d'; +export const AMAP_SDK_URL = 'https://webapi.amap.com/maps?v=2.0&key=e7bd02bd504062087e6563daf4d6721d'; /** 腾讯地图sdk地址 */ export const TENCENT_MAP_SDK_URL = 'https://map.qq.com/api/gljs?v=1.exp&key=A6DBZ-KXPLW-JKSRY-ONZF4-CPHY3-K6BL7'; diff --git a/src/typings/env.d.ts b/src/typings/env.d.ts index 6f5d15bf2..f31af2b2c 100644 --- a/src/typings/env.d.ts +++ b/src/typings/env.d.ts @@ -40,13 +40,13 @@ interface ImportMetaEnv { /** 路由首页的路径 */ readonly VITE_ROUTE_HOME_PATH: AuthRoute.RoutePath; /** iconify图标作为组件的前缀 */ - readonly VITE_ICON_PREFFIX: string; + readonly VITE_ICON_PREFIX: string; /** - * 本地SVG图标作为组件的前缀, 请注意一定要包含 VITE_ICON_PREFFIX - * - 格式 {VITE_ICON_PREFFIX}-{本地图标集合名称} + * 本地SVG图标作为组件的前缀, 请注意一定要包含 VITE_ICON_PREFIX + * - 格式 {VITE_ICON_PREFIX}-{本地图标集合名称} * - 例如:icon-local */ - readonly VITE_ICON_LOCAL_PREFFIX: string; + readonly VITE_ICON_LOCAL_PREFIX: string; /** 后端服务的环境类型 */ readonly VITE_SERVICE_ENV?: ServiceEnvType; /** 开启请求代理 */ diff --git a/src/utils/common/color.ts b/src/utils/common/color.ts index a97bd1647..865f3c892 100644 --- a/src/utils/common/color.ts +++ b/src/utils/common/color.ts @@ -77,9 +77,9 @@ const darkColorMap = [ * @param darkThemeMixColor - 暗黑主题的混合颜色,默认 #141414 */ export function getColorPalettes(color: AnyColor, darkTheme = false, darkThemeMixColor = '#141414'): string[] { - const indexs: ColorIndex[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + const indexes: ColorIndex[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - const patterns = indexs.map(index => getColorPalette(color, index)); + const patterns = indexes.map(index => getColorPalette(color, index)); if (darkTheme) { const darkPatterns = darkColorMap.map(({ index, opacity }) => { diff --git a/src/utils/crypto/index.ts b/src/utils/crypto/index.ts index 453d62f51..3e482065d 100644 --- a/src/utils/crypto/index.ts +++ b/src/utils/crypto/index.ts @@ -6,7 +6,7 @@ const CryptoSecret = '__CryptoJS_Secret__'; * 加密数据 * @param data - 数据 */ -export function encrypto(data: any) { +export function encrypt(data: any) { const newData = JSON.stringify(data); return CryptoJS.AES.encrypt(newData, CryptoSecret).toString(); } @@ -15,7 +15,7 @@ export function encrypto(data: any) { * 解密数据 * @param cipherText - 密文 */ -export function decrypto(cipherText: string) { +export function decrypt(cipherText: string) { const bytes = CryptoJS.AES.decrypt(cipherText, CryptoSecret); const originalText = bytes.toString(CryptoJS.enc.Utf8); if (originalText) { diff --git a/src/utils/storage/local.ts b/src/utils/storage/local.ts index 114f39f78..4207819e1 100644 --- a/src/utils/storage/local.ts +++ b/src/utils/storage/local.ts @@ -1,4 +1,4 @@ -import { decrypto, encrypto } from '../crypto'; +import { decrypt, encrypt } from '../crypto'; interface StorageData { value: T; expire: number | null; @@ -13,7 +13,7 @@ function createLocalStorage | null = null; try { - storageData = decrypto(json); + storageData = decrypt(json); } catch { // 防止解析失败 } diff --git a/src/utils/storage/session.ts b/src/utils/storage/session.ts index d239e2c20..158ee9a0e 100644 --- a/src/utils/storage/session.ts +++ b/src/utils/storage/session.ts @@ -1,8 +1,8 @@ -import { decrypto, encrypto } from '../crypto'; +import { decrypt, encrypt } from '../crypto'; function createSessionStorage() { function set(key: K, value: T[K]) { - const json = encrypto(value); + const json = encrypt(value); sessionStorage.setItem(key as string, json); } function get(key: K) { @@ -10,7 +10,7 @@ function createSessionStorage
在src/assets/svg-icon文件夹下的svg文件,通过在template里面以 icon-local-{文件名} 直接渲染, - 其中icon-local为.env文件里的 VITE_ICON_LOCAL_PREFFIX + 其中icon-local为.env文件里的 VITE_ICON_LOCAL_PREFIX
diff --git a/src/views/plugin/map/components/gaode-map.vue b/src/views/plugin/map/components/gaode-map.vue index 8f998465b..defd64340 100644 --- a/src/views/plugin/map/components/gaode-map.vue +++ b/src/views/plugin/map/components/gaode-map.vue @@ -5,11 +5,11 @@