From a48ae2a149f63bcbbd22a4e2c50601526b966f91 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Thu, 8 May 2025 14:58:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E7=99=BB=E5=BD=95=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- increment-version.js | 50 ++++++------ src/apis/login.ts | 2 +- src/app.vue | 83 ++++++++++++++++++- src/assets/images/login.svg | 1 + src/assets/images/password_icon.svg | 1 + src/assets/images/user_icon.svg | 1 + src/layouts/default.vue | 13 ++- src/stores/systemStore.ts | 12 ++- src/types/system.d.ts | 5 ++ src/views/login/index.vue | 157 +++++++++++++++++++----------------- 10 files changed, 215 insertions(+), 110 deletions(-) create mode 100644 src/assets/images/login.svg create mode 100644 src/assets/images/password_icon.svg create mode 100644 src/assets/images/user_icon.svg diff --git a/increment-version.js b/increment-version.js index 57b3e92..1af84df 100644 --- a/increment-version.js +++ b/increment-version.js @@ -1,41 +1,43 @@ -import fs from 'node:fs'; -import path, { dirname } from 'node:path'; -import { fileURLToPath } from 'node:url'; -import semver from 'semver'; -import { execSync } from 'child_process'; // 引入 child_process 模块用于执行 Git 命令 +import { execSync } from 'node:child_process' // 引入 child_process 模块用于执行 Git 命令 +import fs from 'node:fs' +import path, { dirname } from 'node:path' +import { fileURLToPath } from 'node:url' +import semver from 'semver' -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); +const __filename = fileURLToPath(import.meta.url) +const __dirname = dirname(__filename) -const packagePath = path.resolve(__dirname, 'package.json'); -const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf-8')); +const packagePath = path.resolve(__dirname, 'package.json') +const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf-8')) // 读取命令行参数(默认使用 'patch') -const versionType = process.argv[2] || 'patch'; +// eslint-disable-next-line node/prefer-global/process +const versionType = process.argv[2] || 'patch' // 递增版本 -const newVersion = semver.inc(packageJson.version, versionType); +const newVersion = semver.inc(packageJson.version, versionType) if (!newVersion) { - throw new Error(`Invalid version type: ${versionType}`); + throw new Error(`Invalid version type: ${versionType}`) } -packageJson.version = newVersion; -fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2)); -console.log(`Version updated to: ${newVersion}`); +packageJson.version = newVersion +fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2)) +console.log(`Version updated to: ${newVersion}`) // 新增:自动提交 package.json 到远程仓库 try { // 将 package.json 添加到暂存区 - execSync('git add package.json'); - console.log('Added package.json to staging area.'); + execSync('git add package.json') + console.log('Added package.json to staging area.') // 提交更改 - execSync(`git commit -m "fix: Update version to V${newVersion}"`); - console.log(`Committed changes with message: Update version to ${newVersion}`); + execSync(`git commit -m "fix: Update version to V${newVersion}"`) + console.log(`Committed changes with message: Update version to ${newVersion}`) // 推送到远程仓库 - execSync('git push'); - console.log('Pushed changes to remote repository.'); -} catch (error) { - console.error('Failed to commit and push changes:', error.message); -} \ No newline at end of file + execSync('git push') + console.log('Pushed changes to remote repository.') +} +catch (error) { + console.error('Failed to commit and push changes:', error.message) +} diff --git a/src/apis/login.ts b/src/apis/login.ts index 369aeab..0c51b78 100644 --- a/src/apis/login.ts +++ b/src/apis/login.ts @@ -1,4 +1,4 @@ import http from 'libs/http' export const login = (params: User.Login): Promise => http.post('/auth/login', params) -export const logout = (params: User.Login): Promise => http.post('/auth/logout', params) +export const logout = (): Promise => http.post('/auth/logout') diff --git a/src/app.vue b/src/app.vue index 04888c4..86859b0 100644 --- a/src/app.vue +++ b/src/app.vue @@ -1,17 +1,52 @@