diff --git a/package.json b/package.json index e3f4178..1a1c595 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "stylelint-config-recommended-vue": "^1.4.0", "stylelint-config-standard": "^28.0.0", "stylelint-order": "^5.0.0", + "terser": "^5.15.0", "typescript": "^4.6.3", "unplugin-auto-import": "^0.11.2", "unplugin-vue-components": "^0.22.4", diff --git a/src/i18n/index.ts b/src/i18n/index.ts index f35e1bb..71ac9b4 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -13,7 +13,7 @@ export function loadLang() { export const i18n = createI18n({ // globalInjection: true, - // legacy: false, + legacy: false, locale: 'zh-cn', fallbackLocale: 'zh-cn', messages: loadLang(), @@ -23,7 +23,7 @@ export function setLang(locale?: string) { if (locale) { localStorage.setItem('lang', locale); } - i18n.global.locale = locale || localStorage.getItem('lang') || ''; + i18n.global.locale.value = locale || localStorage.getItem('lang') || ''; } setLang(); diff --git a/src/main.ts b/src/main.ts index 90d9571..cf3e670 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,7 +6,7 @@ import router from '/@/router'; import store from '/@/store'; import './assets/font/iconfont.css'; import './assets/app.css'; -import 'amfe-flexible'; +// import 'amfe-flexible'; const app = createApp(App); diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 302f78c..70ae58f 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -41,3 +41,30 @@ export const useUserStore = defineStore({ paths: ['token'], }, }); +// export const useUserStore = defineStore('app-user', () => { +// const Token = ref(token); +// const info = ref>({}); +// const setInfo = (info: any) => { +// info.value = info ? info : ''; +// }; +// const getUserInfo = () => { +// return info || {}; +// }; +// const login = () => { +// return new Promise((resolve) => { +// const { data } = loginPassword(); +// watch(data, () => { +// setInfo(data.value); +// // useCookies().set(VITE_TOKEN_KEY as string, data.value.token); +// resolve(data.value); +// }); +// }); +// }; +// return { +// Token, +// info, +// setInfo, +// login, +// getUserInfo, +// }; +// }); diff --git a/src/styles/index.less b/src/styles/index.scss similarity index 100% rename from src/styles/index.less rename to src/styles/index.scss diff --git a/src/styles/mixin.scss b/src/styles/mixin.scss index c3151e3..67e6cc9 100644 --- a/src/styles/mixin.scss +++ b/src/styles/mixin.scss @@ -14,3 +14,10 @@ } } } + +@mixin center { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 2a71e24..da2456e 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -13,7 +13,7 @@ -
+
@@ -30,14 +30,16 @@