diff --git a/src/AppMain.vue b/src/AppMain.vue index 66fe6e3..ce7e6e2 100644 --- a/src/AppMain.vue +++ b/src/AppMain.vue @@ -45,7 +45,7 @@ const propOverrides = { cols: 4, }, ProModalForm: { - labelWidth: 120, + labelWidth: 100, labelPlacement: 'left', preset: 'card', }, diff --git a/src/api/system/user.ts b/src/api/system/user.ts index f06abac..7451461 100644 --- a/src/api/system/user.ts +++ b/src/api/system/user.ts @@ -6,7 +6,7 @@ interface UserQueryParams { pageSize?: number username?: string gender?: 'male' | 'female' | 'unknown' - userStatus?: number + status?: number deptId?: number } diff --git a/src/constants/Regex.ts b/src/constants/Regex.ts index d675af7..b255c6d 100644 --- a/src/constants/Regex.ts +++ b/src/constants/Regex.ts @@ -8,5 +8,5 @@ export enum Regex { Email = '^(([^<>()[\\]\\\\.,;:\\s@"]+(\\.[^<>()[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$', - RouteName = '^[\\w_!@#$%^&*~-]+$', + Phone = '^1[3-9]\d{9}$', } diff --git a/src/constants/User.ts b/src/constants/User.ts deleted file mode 100644 index a8104ea..0000000 --- a/src/constants/User.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** Gender */ -export enum Gender { - male, - female, -} diff --git a/src/constants/index.ts b/src/constants/index.ts index a2b4ead..9cc303a 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -1,2 +1 @@ export * from './Regex' -export * from './User' diff --git a/src/typings/entities/dict.d.ts b/src/typings/entities/dict.d.ts index 04ab2e2..e900197 100644 --- a/src/typings/entities/dict.d.ts +++ b/src/typings/entities/dict.d.ts @@ -3,14 +3,18 @@ /** 数据库表字段 */ namespace Entity { interface DictType { + /** + * 主键ID + */ + id?: number /** * 字典名称 */ - dictName: string + name: string /** * 字典类型 */ - dictType: string + type: string /** * 备注信息 */ @@ -19,21 +23,29 @@ namespace Entity { * 状态 */ status?: number + /** + * 创建时间 + */ + createTime?: string + /** + * 更新时间 + */ + updateTime?: string } interface DictData { /** - * 样式属性 + * 主键ID */ - cssClass?: string + id?: number /** - * 字典标签 + * 字典名称 */ - dictLabel: string + name: string /** * 字典排序 */ - dictSort?: number + sort?: number /** * 字典类型 */ @@ -41,15 +53,7 @@ namespace Entity { /** * 字典键值 */ - dictValue: string - /** - * 是否默认 - */ - isDefault?: number - /** - * 表格回显样式 - */ - listClass?: string + value: string /** * 备注信息 */ @@ -58,5 +62,13 @@ namespace Entity { * 状态 */ status?: number + /** + * 创建时间 + */ + createTime?: string + /** + * 更新时间 + */ + updateTime?: string } } diff --git a/src/typings/entities/role.d.ts b/src/typings/entities/role.d.ts index 2c97d93..d62e397 100644 --- a/src/typings/entities/role.d.ts +++ b/src/typings/entities/role.d.ts @@ -8,7 +8,7 @@ namespace Entity { /** * 角色ID */ - roleId: number + id: number /** * 菜单ID数组 */ @@ -28,7 +28,7 @@ namespace Entity { /** * 角色状态 */ - roleStatus?: number + status?: number /** * 显示顺序 */ diff --git a/src/typings/entities/user.d.ts b/src/typings/entities/user.d.ts index b86828e..9e57ff6 100644 --- a/src/typings/entities/user.d.ts +++ b/src/typings/entities/user.d.ts @@ -4,7 +4,7 @@ namespace Entity { interface User { /** 用户id */ - userId: number + id: number /** 部门id */ deptId?: any /** 用户名 */ @@ -22,13 +22,9 @@ namespace Entity { /** 头像 */ avatar?: string /** 用户状态 */ - userStatus: number - /** 创建人 */ - createBy?: string + status: number /** 创建时间 */ createTime: string - /** 更新人 */ - updateBy?: string /** 更新时间 */ updateTime: string /** 备注 */ diff --git a/src/utils/alova/alova.ts b/src/utils/alova/alova.ts index a35c17b..0382685 100644 --- a/src/utils/alova/alova.ts +++ b/src/utils/alova/alova.ts @@ -72,24 +72,23 @@ export function createAlovaInstance( const { status } = response let errorMessage = '' + const res = await response.clone().json() if (status === 200) { // 返回blob数据 if (method.meta?.isBlob) return response.blob() - // 返回json数据 - const apiData = await response.json() // 请求成功 - if (apiData[_backendConfig.codeKey] === _backendConfig.successCode) - return apiData + if (res[_backendConfig.codeKey] === _backendConfig.successCode) + return res // 业务请求失败 - errorMessage = apiData[_backendConfig.msgKey] + errorMessage = res[_backendConfig.msgKey] } else { // 接口请求失败 const errorCode = response.status as ErrorStatus - errorMessage = ERROR_STATUS[errorCode] || ERROR_STATUS.default + errorMessage = res[_backendConfig.msgKey] || ERROR_STATUS[errorCode] || ERROR_STATUS.default } window.$message?.error(errorMessage) throw new Error(errorMessage) diff --git a/src/views/build-in/login/components/Login/index.vue b/src/views/build-in/login/components/Login/index.vue index f614145..2c358ca 100644 --- a/src/views/build-in/login/components/Login/index.vue +++ b/src/views/build-in/login/components/Login/index.vue @@ -49,7 +49,7 @@ const rules = computed(() => { }) const formValue = ref({ account: 'admin', - pwd: '12345', + pwd: '123456', captcha: '', }) const isRemember = ref(false) diff --git a/src/views/demo/list/common-list/index.vue b/src/views/demo/list/common-list/index.vue index 7081850..40fe188 100644 --- a/src/views/demo/list/common-list/index.vue +++ b/src/views/demo/list/common-list/index.vue @@ -185,7 +185,7 @@ function handleAddTable() { - 新建 + 新增