From 6bb3babcb98304a3f8f0a54dd33d069c01cdd7ee Mon Sep 17 00:00:00 2001 From: iven Date: Fri, 24 Apr 2026 12:30:02 +0800 Subject: [PATCH] =?UTF-8?q?chore(miniprogram):=20stores=20=E5=B1=82?= =?UTF-8?q?=E5=90=AF=E7=94=A8=20@/=20=E8=B7=AF=E5=BE=84=E5=88=AB=E5=90=8D?= =?UTF-8?q?=20+=20webpack=20alias=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/miniprogram/config/index.ts | 4 ++++ apps/miniprogram/src/stores/auth.ts | 2 +- apps/miniprogram/src/stores/health.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/miniprogram/config/index.ts b/apps/miniprogram/config/index.ts index 84bc216..c908498 100644 --- a/apps/miniprogram/config/index.ts +++ b/apps/miniprogram/config/index.ts @@ -1,4 +1,5 @@ import { defineConfig } from '@tarojs/cli'; +import path from 'path'; export default defineConfig(async (merge) => { const baseConfig = { @@ -13,6 +14,9 @@ export default defineConfig(async (merge) => { copy: { patterns: [], options: {} }, framework: 'react', compiler: 'webpack5', + alias: { + '@': path.resolve(__dirname, '..', 'src'), + }, sass: { resource: ['src/styles/variables.scss'], }, diff --git a/apps/miniprogram/src/stores/auth.ts b/apps/miniprogram/src/stores/auth.ts index 6450ead..3c087e8 100644 --- a/apps/miniprogram/src/stores/auth.ts +++ b/apps/miniprogram/src/stores/auth.ts @@ -1,6 +1,6 @@ import { create } from 'zustand'; import Taro from '@tarojs/taro'; -import * as authApi from '../services/auth'; +import * as authApi from '@/services/auth'; interface BindPhoneResp { access_token: string; diff --git a/apps/miniprogram/src/stores/health.ts b/apps/miniprogram/src/stores/health.ts index e842afc..0184da9 100644 --- a/apps/miniprogram/src/stores/health.ts +++ b/apps/miniprogram/src/stores/health.ts @@ -1,5 +1,5 @@ import { create } from 'zustand'; -import * as healthApi from '../services/health'; +import * as healthApi from '@/services/health'; interface HealthState { todaySummary: healthApi.TodaySummary | null;