1.将 IJsonResult 移动到 types/api.d.ts 文件中

This commit is contained in:
Wang Chen Chen
2023-11-01 10:05:24 +08:00
parent e785592f99
commit ea64beb217
18 changed files with 36 additions and 52 deletions

View File

@@ -1,4 +1,4 @@
import { IJsonResult, IPageResult, ISearchQuery } from "@/types/base"
import { ISearchQuery } from "@/types/base"
import { ISysConfig } from "@/types/sys"
import { httpDelete, httpGet, httpPost, httpPut } from "@/utils/service"

View File

@@ -1,4 +1,4 @@
import { IJsonResult, IPageResult, ISearchQuery } from "@/types/base"
import { ISearchQuery } from "@/types/base"
import { IPmsDept } from "@/types/pms"
import { httpDelete, httpGet, httpPost, httpPut } from "@/utils/service"

View File

@@ -1,4 +1,4 @@
import { IJsonResult, IPageResult, ISearchQuery } from "@/types/base"
import { ISearchQuery } from "@/types/base"
import { ICmsDevice } from "@/types/cms"
import { httpDelete, httpGet, httpPost, httpPut } from "@/utils/service"

View File

@@ -1,4 +1,4 @@
import { IJsonResult, IPageResult, ISearchQuery } from "@/types/base"
import { ISearchQuery } from "@/types/base"
import { httpDelete, httpGet, httpPost, httpPut } from "@/utils/service"
import { IMapDictData, IDictType, IDictData, IDictSearchQuery } from "@/types/dict"

View File

@@ -1,4 +1,3 @@
import { IJsonResult } from "@/types/base"
import { ILoginData, ILoginUserInfo, IOAuth2Token, IUserPerms } from "@/types/pms"
import { httpGet, httpPost } from "@/utils/service"

View File

@@ -1,4 +1,4 @@
import { IJsonResult, IPageResult, ISearchQuery } from "@/types/base"
import { ISearchQuery } from "@/types/base"
import { ILoginLog, IOperLog } from "@/types/lms"
import { httpPost, httpGet } from "@/utils/service"

View File

@@ -1,4 +1,4 @@
import { IJsonResult, IPageResult, ISearchQuery } from "@/types/base"
import { ISearchQuery } from "@/types/base"
import { ISysMenu } from "@/types/pms"
import { httpDelete, httpGet, httpPost, httpPut } from "@/utils/service"

View File

@@ -1,4 +1,4 @@
import { IJsonResult, IPageResult, ISearchQuery, ISimpleProject } from "@/types/base"
import { ISearchQuery, ISimpleProject } from "@/types/base"
import { ICmsProject } from "@/types/cms"
import { httpDelete, httpGet, httpPost, httpPut } from "@/utils/service"

View File

@@ -1,4 +1,4 @@
import { IJsonResult, IPageResult, ISearchQuery, IUpdateMenus } from "@/types/base"
import { ISearchQuery, IUpdateMenus } from "@/types/base"
import { IPmsRole } from "@/types/pms"
import { httpDelete, httpGet, httpPost, httpPut } from "@/utils/service"

View File

@@ -1,4 +1,3 @@
import { IJsonResult } from "@/types/base"
import { IServerInfo } from "@/types/sys"
import { httpGet } from "@/utils/service"

View File

@@ -1,4 +1,4 @@
import { IJsonResult, IPageResult, ISearchQuery, IUpdateMenus } from "@/types/base"
import { ISearchQuery, IUpdateMenus } from "@/types/base"
import { ISysTemplate } from "@/types/sys"
import { httpDelete, httpGet, httpPost, httpPut } from "@/utils/service"

View File

@@ -1,4 +1,4 @@
import { IJsonResult, IPageResult, ISearchQuery, ISimpleTenant } from "@/types/base"
import { ISearchQuery, ISimpleTenant } from "@/types/base"
import { ISysTenant, ICreateTenant, ICreateTenantAdmin } from "@/types/sys"
import { httpDelete, httpGet, httpPost, httpPut } from "@/utils/service"

View File

@@ -1,4 +1,3 @@
import { IJsonResult } from "@/types/base"
import { httpDelete } from "@/utils/service"
// 删除 oss 上的图片

View File

@@ -1,4 +1,4 @@
import { IJsonResult, IPageResult, ISearchQuery } from "@/types/base"
import { ISearchQuery } from "@/types/base"
import { IPmsUser, IUserListTenant } from "@/types/pms"
import { httpPost, httpPut, httpGet, httpDelete } from "@/utils/service"

View File

@@ -1,31 +1,3 @@
// json 返回值
export interface IJsonResult<T> {
/* 状态码 200: 成功! 100: 失败! 其他: 都是报错! */
status: number
/* 返回消息 */
message: string
/* 数据 */
data: T
}
// 分页
export interface IPagination<T> {
/* 总页数 */
total: number
/* 数据列表 */
list: T[]
}
// 分页 返回值
export interface IPageResult<T> {
/* 状态码 200: 成功! 100: 失败! 其他: 都是报错! */
status: number
/* 返回消息 */
message: string
/* 分页数据 */
data: IPagination<T>
}
// 搜索分页查询
export interface ISearchQuery {
// 包含操作用户信息

View File

@@ -313,8 +313,6 @@ import { cloneDeep } from "lodash-es"
// 判读 当前选中的租户是否 默认租户
const { isDefaultTenantId } = useTenantStoreHook()
console.log("isDefaultTenantId() :>>", isDefaultTenantId())
const dictStore = useDictStoreHook()
/** 加载 */

View File

@@ -22,11 +22,7 @@ describe("NotifyList", () => {
it("List 长度不为 0", () => {
const wrapper = shallowMount(NotifyList, {
props: {
list: [
{
title: ""
}
]
list: []
}
})
expect(wrapper.find("el-empty").exists()).toBe(false)

27
web-ui/types/api.d.ts vendored
View File

@@ -1,6 +1,27 @@
/** 所有 api 接口的响应数据都应该准守该格式 */
interface ApiResponseData<T> {
// json 返回值
interface IJsonResult<T> {
/* 状态码 200: 成功! 100: 失败! 其他: 都是报错! */
status: number
data: T
/* 返回消息 */
message: string
/* 数据 */
data: T
}
// 分页
interface IPagination<T> {
/* 总页数 */
total: number
/* 数据列表 */
list: T[]
}
// 分页 返回值
interface IPageResult<T> {
/* 状态码 200: 成功! 100: 失败! 其他: 都是报错! */
status: number
/* 返回消息 */
message: string
/* 分页数据 */
data: IPagination<T>
}