Enhance backend functionality and frontend UI

- Updated main.py to include authentication for brand, model, and OTA routers.
- Added new OTA schemas in schemas.py for version management.
- Enhanced model retrieval with sorting options in models.py.
- Improved model update functionality to support multipart/form-data uploads.
- Updated frontend layout and styles for a more modern look, including new font integration.
- Implemented login route and authentication checks in router/index.js.
- Added sorting capabilities in model table and improved file handling in model view.
- Updated requirements.txt to include PyJWT for token management.
This commit is contained in:
yangy
2026-05-14 17:54:36 +08:00
parent b1d088a755
commit 661b85ce62
23 changed files with 2104 additions and 119 deletions
+6 -3
View File
@@ -7,6 +7,8 @@ import request from '@/utils/request'
* @param {number} params.limit - 返回记录数
* @param {string} params.brand_name - 品牌名称(模糊查询)
* @param {string} params.name - 型号名称(模糊查询)
* @param {string} [params.sort_by] - 排序字段:id | create_at,默认 id
* @param {string} [params.sort_order] - asc | desc,默认 desc
*/
export function getModels(params) {
return request({
@@ -44,13 +46,14 @@ export function createModel(data, config = {}) {
/**
* 更新型号
* @param {Object} data - 型号数据或 FormData
* @param {number} id - 型号 ID
* @param {Object} data - 型号数据或 FormData(与创建一致,可为 multipart
* @param {Object} config - 额外配置
* @param {boolean} config.isFormData - 是否为 FormData 上传
*/
export function updateModel(data, config = {}) {
export function updateModel(id, data, config = {}) {
return request({
url: `/models/${data.id || data.get('id')}`,
url: `/models/${id}`,
method: 'put',
data,
headers: config.isFormData ? { 'Content-Type': 'multipart/form-data' } : {}