Skip to content

Commit

Permalink
Merge pull request #294 from XPoet/dev
Browse files Browse the repository at this point in the history
Release new version
  • Loading branch information
XPoet authored Mar 12, 2024
2 parents 7785dbc + 6875c07 commit b12ee5a
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8" />
<link rel="icon" href="./logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PicX 图床神器</title>
<title>PicX</title>
</head>

<body>
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "picx",
"version": "3.0.0",
"version": "3.0.1",
"private": false,
"packageManager": "[email protected]",
"author": "XPoet <[email protected]>",
"license": "AGPL-3.0",
"bugs": {
Expand Down Expand Up @@ -42,6 +43,7 @@
"@commitlint/cli": "17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@iconify-json/ep": "^1.1.10",
"@plugin-web-update-notification/vite": "1.7.1",
"@types/node": "^15.0.1",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
Expand Down
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/plugins/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import IconsResolver from 'unplugin-icons/resolver'
import Icons from 'unplugin-icons/vite'
import { webUpdateNotice } from '@plugin-web-update-notification/vite'
import { ViteEnv } from '@/common/model'
import configPWAPlugin from './pwa'

export default function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
const vitePlugins: (Plugin | Plugin[])[] = [vue()]

// 按需自动导入 Element Plus 组件
vitePlugins.push(
AutoImport({
resolvers: [
Expand All @@ -24,6 +24,7 @@ export default function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
],
dts: 'src/auto-imports.d.ts'
}),

Components({
resolvers: [
// 自动导入 Element Plus 组件
Expand All @@ -35,8 +36,14 @@ export default function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
],
dts: 'src/components.d.ts'
}),

Icons({
autoInstall: true
}),

// 更新通知插件
webUpdateNotice({
logVersion: true
})
)

Expand Down
1 change: 1 addition & 0 deletions src/shims-vue.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@plugin-web-update-notification/vite" />
declare module '*.vue' {
import { DefineComponent } from 'vue'

Expand Down
17 changes: 14 additions & 3 deletions src/views/app-wrap/app-wrap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,25 @@ const elementPlusSizeHandle = (width: number) => {
const setLanguage = (language: LanguageEnum) => {
if (language === LanguageEnum.zhCN) {
elementPlusLocale.value = zhCN // 设置 Element Plus 组件库语言
instance!.proxy!.$i18n.locale = 'zh-CN' // 设置 i18n 语言
elementPlusLocale.value = zhCN // 设置 Element Plus 组件库语言
// eslint-disable-next-line no-underscore-dangle
window.pluginWebUpdateNotice_?.setLocale('zh_CN')
} else if (language === LanguageEnum.zhTW) {
elementPlusLocale.value = zhTW
instance!.proxy!.$i18n.locale = 'zh-TW'
elementPlusLocale.value = zhTW
// eslint-disable-next-line no-underscore-dangle
window.pluginWebUpdateNotice_?.setLocale('zh_TW')
} else if (language === LanguageEnum.en) {
elementPlusLocale.value = en
instance!.proxy!.$i18n.locale = 'en'
elementPlusLocale.value = en
// eslint-disable-next-line no-underscore-dangle
window.pluginWebUpdateNotice_?.setLocale('en_US')
} else {
elementPlusLocale.value = zhCN
instance!.proxy!.$i18n.locale = 'zh-CN'
// eslint-disable-next-line no-underscore-dangle
window.pluginWebUpdateNotice_?.setLocale('zh_CN')
}
setWindowTitle(router.currentRoute.value.meta.title as string)
}
Expand Down Expand Up @@ -105,6 +113,9 @@ const setLanguageByIP = () => {
store.dispatch('SET_USER_SETTINGS', {
language
})
store.dispatch('SET_GLOBAL_SETTINGS', {
language
})
msgInstance.close()
})
}
Expand Down

0 comments on commit b12ee5a

Please sign in to comment.