From dce5d85f65b57c675175b45356868311037b8455 Mon Sep 17 00:00:00 2001 From: h_mo <596417202@qq.com> Date: Wed, 12 Mar 2025 15:47:23 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=8D=87=E7=BA=A7=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=B9=B6=E9=87=8D=E6=9E=84=E9=A1=B9=E7=9B=AE=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新多个依赖到最新版本,包括 uni-app、alova、pinia、tailwindcss 等 - 移除 postcss.config.ts 配置文件 - 调整 vite 配置和 tailwindcss 引入方式 - 更新 App.vue 和 main.ts 中的样式引入 - 优化 stores 中的 defineStore 使用方式 - 新增 src/styles/main.css 文件 --- .DS_Store | Bin 0 -> 12292 bytes .npmrc | 4 +- build/vitePlugins.ts | 2 + package.json | 78 ++++++++++++++++++------------------- postcss.config.ts | 12 ------ src/.DS_Store | Bin 0 -> 10244 bytes src/App.vue | 5 +-- src/components/.DS_Store | Bin 0 -> 6148 bytes src/main.ts | 1 + src/pages/.DS_Store | Bin 0 -> 8196 bytes src/services/.DS_Store | Bin 0 -> 6148 bytes src/static/.DS_Store | Bin 0 -> 6148 bytes src/stores/app.ts | 5 +-- src/stores/modules/user.ts | 6 +-- src/styles/main.css | 1 + src/utils/.DS_Store | Bin 0 -> 6148 bytes vite.config.ts | 8 ++-- 17 files changed, 55 insertions(+), 67 deletions(-) create mode 100644 .DS_Store delete mode 100644 postcss.config.ts create mode 100644 src/.DS_Store create mode 100644 src/components/.DS_Store create mode 100644 src/pages/.DS_Store create mode 100644 src/services/.DS_Store create mode 100644 src/static/.DS_Store create mode 100644 src/utils/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..16f9eaef8386f30ef88d05573c6e5835291c30c6 GIT binary patch literal 12292 zcmeHNYit}>6+UOzj%RAe9Vc<(uvysRBuW~`b)34XleSquQ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gyM z^G%w@*y5=KDIseW9sZxh&C0s4BAsfH^U1^KFyD%}s*Rq%{LZ7p2c=hC2fyNF?*?DB z;|qqgV^i=T2d(1ZTYH2Rhtj|iwi$Hd5SXW(ODj<)4z;OeEFxAU_4wNYI$NwPu(*R? zwfEE<)8yKuj-b;~*t3rY=`i3jtC{p1m7)RjWbi*T3v<_wFV?i{V5>GnK>ZHbRpY6a zi;gTsR}EIhUMpj%R`S28HG}(E@SX?UDc64sQj3=sHL}Q+VM!KknUg)Zug8V5O?>|! zTKWHf5-Gfe8VEJ;!PEfP4UP@=LpEMPKJl$Rf$KqB0_R7#M8UHp!A*XS2b7=V0p;g- mK)Jp6xJe%_co4lP|Mx!vg!{kpdOY0!{V(1IT=+w^|Nj?MODeMf literal 0 HcmV?d00001 diff --git a/.npmrc b/.npmrc index 54d704c..152f324 100644 --- a/.npmrc +++ b/.npmrc @@ -2,5 +2,5 @@ # 提示:如果你不希望pnpm在对等依赖问题上失败,在项目根目录下的.npmrc文件中添加"strict-peer-dependencies=false"。 # auto-install-peers=true strict-peer-dependencies=false -registry=https://registry.npmmirror.com -# registry=https://registry.npmjs.org +# registry=https://registry.npmmirror.com +registry=https://registry.npmjs.org diff --git a/build/vitePlugins.ts b/build/vitePlugins.ts index 8da09c1..b3e83d3 100644 --- a/build/vitePlugins.ts +++ b/build/vitePlugins.ts @@ -1,5 +1,6 @@ import type { PluginOption } from 'vite'; import uni from '@dcloudio/vite-plugin-uni'; +import tailwindcss from '@tailwindcss/vite'; import { visualizer } from 'rollup-plugin-visualizer'; import autoImport from 'unplugin-auto-import/vite'; import viteRestart from 'vite-plugin-restart'; @@ -14,6 +15,7 @@ export function createVitePlugins({ isProd }: VitePluginConfig): PluginOption[] return [ // @ts-expect-error TODO uni() 会报错:uni is not a function,暂时使用此方式解决 uni?.default(), + tailwindcss(), uvtw({ rem2rpx: true, disabled: WeappTailwindcssDisabled, diff --git a/package.json b/package.json index bef9508..a821872 100644 --- a/package.json +++ b/package.json @@ -44,64 +44,64 @@ }, "dependencies": { "@alova/adapter-uniapp": "^2.0.11", - "@alova/mock": "^2.0.11", + "@alova/mock": "^2.0.12", "@alova/shared": "^1.1.2", - "@dcloudio/uni-app": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-app-plus": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-components": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-h5": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-i18n": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-mp-alipay": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-mp-baidu": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-mp-lark": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-mp-qq": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-mp-toutiao": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-mp-weixin": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4040220241217001", + "@dcloudio/uni-app": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-app-plus": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-components": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-h5": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-i18n": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-mp-alipay": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-mp-baidu": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-mp-lark": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-mp-qq": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-mp-toutiao": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-mp-weixin": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4050320250224001", "@multiavatar/multiavatar": "^1.0.7", - "alova": "^3.2.7", + "alova": "^3.2.10", "crypto-js": "^4.2.0", "lodash-es": "^4.17.21", - "pinia": "^2.3.0", + "pinia": "^2.3.1", "vue": "^3.5.13" }, "devDependencies": { - "@antfu/eslint-config": "^3.12.0", + "@antfu/eslint-config": "^4.8.1", "@dcloudio/types": "^3.4.14", - "@dcloudio/uni-automator": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-cli-shared": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-stacktracey": "3.0.0-alpha-4040220241217001", - "@dcloudio/uni-uts-v1": "3.0.0-alpha-4040220241217001", - "@dcloudio/vite-plugin-uni": "3.0.0-alpha-4040220241217001", - "@egoist/tailwindcss-icons": "^1.8.2", - "@iconify/json": "^2.2.287", + "@dcloudio/uni-automator": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-cli-shared": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-stacktracey": "3.0.0-alpha-4050320250224001", + "@dcloudio/uni-uts-v1": "3.0.0-alpha-4050320250224001", + "@dcloudio/vite-plugin-uni": "3.0.0-alpha-4050320250224001", + "@egoist/tailwindcss-icons": "^1.9.0", + "@iconify/json": "^2.2.315", "@rollup/plugin-node-resolve": "^16.0.0", + "@tailwindcss/vite": "^4.0.12", "@types/crypto-js": "^4.2.2", "@types/lodash-es": "^4.17.12", - "@types/node": "^22.10.2", + "@types/node": "^22.13.10", "@vitejs/plugin-vue": "^5.2.1", "@vue/runtime-core": "^3.5.13", - "autoprefixer": "^10.4.20", + "autoprefixer": "^10.4.21", "commit-and-tag-version": "^12.5.0", - "eslint": "^9.17.0", - "eslint-plugin-format": "^0.1.3", - "globals": "^15.14.0", - "lint-staged": "^15.2.11", + "eslint": "^9.22.0", + "eslint-plugin-format": "^1.0.1", + "globals": "^16.0.0", + "lint-staged": "^15.4.3", "picocolors": "^1.1.1", - "postcss": "^8.4.49", - "rollup-plugin-visualizer": "^5.12.0", - "sass": "^1.83.0", + "rollup-plugin-visualizer": "^5.14.0", + "sass": "^1.85.1", "simple-git-hooks": "^2.11.1", - "tailwindcss": "^3.4.17", - "tsx": "^4.19.2", - "typescript": "^5.7.2", + "tailwindcss": "^4.0.12", + "tsx": "^4.19.3", + "typescript": "^5.8.2", "uni-mini-router": "^0.1.6", "uni-read-pages-vite": "^0.0.6", - "unplugin-auto-import": "^0.19.0", - "vite": "^6.0.5", + "unplugin-auto-import": "^19.1.1", + "vite": "^6.2.1", "vite-plugin-restart": "^0.4.2", - "weapp-tailwindcss": "^3.7.0" + "weapp-tailwindcss": "^4.0.11" }, "simple-git-hooks": { "pre-commit": "npx lint-staged", diff --git a/postcss.config.ts b/postcss.config.ts deleted file mode 100644 index 1f941ac..0000000 --- a/postcss.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { AcceptedPlugin } from 'postcss'; -import autoprefixer from 'autoprefixer'; -import tailwindcss from 'tailwindcss'; -import cssMacro from 'weapp-tailwindcss/css-macro/postcss'; - -const plugins: AcceptedPlugin[] = [tailwindcss(), autoprefixer()]; - -// 可以使用 postcss-pxtransform 来进行 px 转 rpx 的功能 - -plugins.push(cssMacro); - -export default plugins; diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8f58053e21cd01153ef9c38bb6d7a366a000bab1 GIT binary patch literal 10244 zcmeHMOKTHR6h6~5?WDC*L`6hpKopgNeWbN%LDE=pZ;B#S+N23>Y%+JuqoI~URz4Rl zgs$DV5f|dhwb0^5bX9j+a3%U9Jok~Ad*@L^5MOs-=FH6b&OP7#=FXj*8vrmejlvLs z1pp@Q)b{VeL&!$`bPsGD;?5LW1LFY**igj14z&PU-_QzZ1+)TM0j+>m;7?Ehzu9y% zd%4v|t$QhS4h9bgLu58Yg<`Pm7-um!7-??xQ7fPo2r4jzw|Za!EB6XG za{XRj9Lg?`io-*WJ&nRu$n~ac zW!G^=^~#*4?%!>5lHz41;RrRq#q%$rLIjor`Jb`;u2;@K^XS9ro3A&iCUKAuo)Y1R zko=w4bAr!mS?zt#2Da_`@~ES|(SWrB^eAl=JQLT>eU_*qrO%e}UNbT*)q0SwN{!M9B54CA&bH8Pc!|H5QxY z4l|KR%=I5yTRWE=92acbeygavDuGr)O6%Rkj;?oU% z{MtP}#51K&srj z3Y73I47?3TK80aquGbzrU-unlTmx;%e0RgCoZ0lu+p6PuDB;@cqW>-JNV>cvjLfT1 zxYwQ|18vE?cEhQ>#5k=XryS$8pghyq#y8~Dg?hSvna{0Dq^*+=sMwbqk)tFZ0-Y+sDJjczQ%(R35=R zzA+xhC$ft3Eh_c9XO`sn_<)rh@n)9fSn?-k7O6+d7=+kiR73L0iaQ^-Pj2yFG77@e zI~<{^ZBeTCI*XA()B-G W<51QKyqZVX|9lNWuD1Tx`u{u8hZukW literal 0 HcmV?d00001 diff --git a/src/App.vue b/src/App.vue index 6ee2ae9..9a62c9e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -15,8 +15,5 @@ onHide(() => { }); - diff --git a/src/components/.DS_Store b/src/components/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e81f1c98c832514e774578ed878bf30c0cfe7034 GIT binary patch literal 6148 zcmeHKJxc>Y5S>i|MuU*jazU_9snsQ%g`JQ;U_ML~lI#&p!0tM0f0SZr>2L5q2)>zJ z$XzbyML7< zEPD8Z=;SKPg7+!#?NE^yy^e&6p>=*@P2{k+;KdC7ev;QF~QD704@4^|wu~|EJ~W|9q0(sRF9N zzf!=|;%?l*l0t1QERJifMY}*_F@9sYvDVM}Lg zYi&9in@+|d8+Sr6f{wgG!pW4@YO4yU0&NAh(6vH`G@y!37SHe5LF}DWz20D44bYq4 z+qv<1ws-nqF=BW@#Ozu4hCuGtjD~bX6RP632c0h%+xtT7ojs2o_#5PuKY_bK$21k} zS242rDc{O_L+rPYJa&*jsT%Zj#B%(X{pZthH5~z$A8=h7V?IVPtIl@g2^noZ_KaL! z$foU0G7&u1BgR}k6D7Pi#QpvK^{0>b-3kaI8YR*Z3H%)MP|=(YWEEmgViw(XuxQ1E zTt3|Tdgs(~NyIgbmc=D`&1GfIFdv8DcNFuY_rhx-Cgk+MeD;4B a;<`X6=akOY)}jYRUj&E@+Nc8mRDr+Zdjfp` literal 0 HcmV?d00001 diff --git a/src/services/.DS_Store b/src/services/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..53c249cb867984842b17a76826caecf2801cc54d GIT binary patch literal 6148 zcmeHKJx{|h5WOQsio{Zhh0#BOj%=n15(`sD7AQd!DN(YpXY3y<>d)ex?`UHYF(L$a zlKt%aOr8`wM?}1Qs~1FbA}TQiSr!u_>PgdyIg61c$71!=wf#hj->Z^mFX)kadTn0D z&tIG$Ep1m->!w>nQ-<5^es}eLJ+{{0So_U5Yd{#CQcE4x^h`}&llQrGT=(w&Ppm|rv;6g8aKnh&c}6GJ8@L>*%@#K zas~?B&gK5U!6!4>S5S}qb0$zIbBJ9pHMtadO(@j#i6uG`X#-WzR;x z(InS?NDoxe4VAQi{n`1|zQ3xAVz#Jfu;;HQAE%FR@0Z<}`L{94`yHOLDYl@DR`g6| zo573Et!KCP%h{&3kGTO>bH^w}A32AqKn1M+?d z7=qETQB1E6OsNF`4q#3KU3v-035Lx(Xdg}bYg2h*eb7^ z7f#i&e@NlPQPF2-z!_*Wkm+(L=Rf+~^&`{{@|82-4E$*Zcu-7=F>cY$*3Qk!SsO5> t7$OqahysD$`Ut>6{;3@&r}~5Fh>M1eqU<8}ln(R{fkcQ;&cF{a@CC8jNR0ph literal 0 HcmV?d00001 diff --git a/src/stores/app.ts b/src/stores/app.ts index 87a6977..ee4c344 100644 --- a/src/stores/app.ts +++ b/src/stores/app.ts @@ -1,11 +1,10 @@ -import { defineStore } from 'pinia'; +// import { defineStore } from 'pinia'; interface AppState { sys?: string | number } -export const useAppStore = defineStore({ - id: 'app-store', +export const useAppStore = defineStore('app-store', { state: (): AppState => ({}), getters: {}, actions: {}, diff --git a/src/stores/modules/user.ts b/src/stores/modules/user.ts index 9c04945..2ccf512 100644 --- a/src/stores/modules/user.ts +++ b/src/stores/modules/user.ts @@ -11,10 +11,10 @@ export const useUserStore = defineStore('UserStore', () => { const userInfo = ref(null); // 初始化 - function initUserInfo() { + async function initUserInfo() { if (isLogin()) { token.value = getToken(); - getUserInfo(); + await getUserInfo(); } } @@ -35,7 +35,7 @@ export const useUserStore = defineStore('UserStore', () => { } // 获取用户信息 - const { send: _getUserInfo } = useRequest(getUserInfoApi, { initialData: null, immediate: false }); + const { send: _getUserInfo } = useRequest(getUserInfoApi, { immediate: false }); async function getUserInfo() { try { userInfo.value = await _getUserInfo(); diff --git a/src/styles/main.css b/src/styles/main.css index e69de29..d4b5078 100644 --- a/src/styles/main.css +++ b/src/styles/main.css @@ -0,0 +1 @@ +@import 'tailwindcss'; diff --git a/src/utils/.DS_Store b/src/utils/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..623b1926314d784c2d538b9f75835cb59bbed3f9 GIT binary patch literal 6148 zcmeHKOHRW;4D~=jEg)2}>T<5oC9FafPS6WL+o-M7k_hM$DN9a*I09l1VgVAjfCY!( z*)vKr{QxTj$gVtZ;<01rMHzR9$h4>Z7EyzUYEZ^#3&RrOb=C!0^A-*^a*uR8Xmxto zBwz4VgEF8D{5}Tw+ufiZoj`{)_xK@^pH#(jKd<4-6?vcqo0olNXdM`b`62pL#+mksX!N2|~O zVUS)a1Ioa^V!%X6Cu!r6d~aQNIPSF;dJJV@zrvw}VDRl&CftgfP!X(Io&aNyg+o{% P`bR)$&_NmaQ3gH$%?*@- literal 0 HcmV?d00001 diff --git a/vite.config.ts b/vite.config.ts index 43a5c48..240d617 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -9,7 +9,7 @@ import process from 'node:process'; import TransformPages from 'uni-read-pages-vite'; import { defineConfig, loadEnv } from 'vite'; import { createVitePlugins, currentPlatform, resolveProxy } from './build'; -import postcssPlugins from './postcss.config'; +// import postcssPlugins from './postcss.config'; export default defineConfig(async ({ mode }) => { const root = process.cwd(); @@ -39,9 +39,9 @@ export default defineConfig(async ({ mode }) => { silenceDeprecations: ['legacy-js-api'], }, }, - postcss: { - plugins: postcssPlugins, - }, + // postcss: { + // plugins: postcssPlugins, + // }, }, plugins: createVitePlugins({ isProd }), // 开发服务器配置