# mini-project **Repository Path**: llyafei/mini-project ## Basic Information - **Project Name**: mini-project - **Description**: AI图文助手 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-07-18 - **Last Updated**: 2025-07-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Mini AI - AI创作助手 一个现代化的AI创作助手应用,提供图片管理、AI文案生成、图片扩展等功能。 ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. ## Customize configuration See [Vite Configuration Reference](https://vite.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ``` ## API接口说明 ### 请求头说明 所有需要认证的API请求都需要在请求头中包含token: ``` x-auth-token: your_access_token ``` **注意**:登录成功后,系统会自动在后续请求中添加此请求头,无需手动添加。 ### API使用示例 ```typescript // 获取素材列表(需要认证) import { getAssetList } from '@/api/assets.js' const fetchAssets = async () => { try { const response = await getAssetList({ page: 1, pageSize: 10, type: 'image', }) console.log('素材列表:', response.data) } catch (error) { console.error('获取素材失败:', error) } } ``` ### 用户注册 - **接口**:`POST /api/user/register` - **参数**: ```json { "username": "用户名", "email": "邮箱", "password": "密码", "confirmPassword": "确认密码" } ``` - **响应**: ```json { "code": 200, "message": "success", "data": true } ``` ### 用户登录 - **接口**:`POST /api/user/login` - **参数**: ```json { "username": "用户名", "password": "密码", "rememberMe": true } ``` - **响应**: ```json { "code": 200, "message": "success", "data": { "userId": 6, "username": "lyhqaq", "email": "123456@qq.com", "accessToken": "qwe" } } ``` ## 表单验证规则 ### 用户名验证(登录和注册) - 长度:3-20个字符 - 字符:只能包含字母、数字、下划线 ### 邮箱验证(仅注册) - 格式:标准邮箱格式 - 示例:`user@example.com` ### 密码验证 - 长度:至少6位 - 要求:必须包含字母和数字