diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..401c5053 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,52 @@ +name: Build +on: + pull_request: + types: + - opened + - synchronize + branches: + - master + push: + branches: + - master + +env: + HUSKY: '0' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + post-update: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + # - macos-latest + - windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 10 + run_install: true + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - name: Build + run: | + pnpm build:antd diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..660833ab --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + pull_request: + push: + branches: + - master + +permissions: + contents: read + +jobs: + check: + name: Check + runs-on: ${{ matrix.os }} + timeout-minutes: 20 + strategy: + matrix: + os: + - ubuntu-latest + # - macos-latest + - windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 10 + run_install: true + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - name: Typecheck + run: pnpm check:type diff --git a/.gitignore b/.gitignore index 4211af2f..87cb9077 100644 --- a/.gitignore +++ b/.gitignore @@ -53,7 +53,6 @@ vite.config.ts.* # 升级 vben 时需要删除的文件 .vscode .changeset -.github backend-mock web-ele web-naive diff --git a/apps/web-antd/src/store/auth.ts b/apps/web-antd/src/store/auth.ts index f1a51fb5..df0720f0 100644 --- a/apps/web-antd/src/store/auth.ts +++ b/apps/web-antd/src/store/auth.ts @@ -1,3 +1,5 @@ +import type { Recordable } from '@vben/types'; + import type { CaptchaResult, LoginParams, MyUserInfo } from '#/api'; import { ref } from 'vue'; @@ -39,14 +41,14 @@ export const useAuthStore = defineStore('auth', () => { * @param params 登录表单数据 */ async function authLogin( - params: LoginParams, + params: Recordable, onSuccess?: () => Promise | void, ) { // 异步处理用户登录操作并获取 accessToken let userInfo: MyUserInfo | null = null; try { loginLoading.value = true; - const { access_token } = await loginApi(params); + const { access_token } = await loginApi(params as LoginParams); // 如果成功获取到 accessToken if (access_token) {