feat(api): 添加根据code查询文章和导航的功能- 在cmsArticle模块中新增getByCode方法,支持根据code查询文章
- 在cmsNavigation模块中新增getByCode方法,支持根据code查询导航 - 优化导出用户列表的文件命名规则,加入租户ID标识
This commit is contained in:
@@ -119,6 +119,19 @@ export async function getCmsArticle(id: number) {
|
|||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code查询文章
|
||||||
|
*/
|
||||||
|
export async function getByCode(code: string) {
|
||||||
|
const res = await request.get<ApiResult<CmsArticle>>(
|
||||||
|
'/cms/cms-article/getByCode/' + code
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
export async function getCount(params: CmsArticleParam) {
|
export async function getCount(params: CmsArticleParam) {
|
||||||
const res = await request.get(MODULES_API_URL + '/cms/cms-article/data', {
|
const res = await request.get(MODULES_API_URL + '/cms/cms-article/data', {
|
||||||
params
|
params
|
||||||
|
|||||||
@@ -119,3 +119,18 @@ export async function getCmsNavigation(id: number) {
|
|||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code查询导航
|
||||||
|
*/
|
||||||
|
export async function getByCode(code: string) {
|
||||||
|
const res = await request.get<ApiResult<CmsNavigation>>(
|
||||||
|
'/cms/cms-navigation/getByCode/' + code
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ import {Organization} from '@/api/system/organization/model';
|
|||||||
import {hasRole} from '@/utils/permission';
|
import {hasRole} from '@/utils/permission';
|
||||||
import {getPageTitle} from "@/utils/common";
|
import {getPageTitle} from "@/utils/common";
|
||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
|
import {getTenantId} from "@/utils/domain";
|
||||||
|
|
||||||
// 加载状态
|
// 加载状态
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
@@ -402,7 +403,7 @@ const exportData = async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 生成Excel文件
|
// 生成Excel文件
|
||||||
const sheetName = `导出用户列表${dayjs(new Date()).format('YYYYMMDD')}`;
|
const sheetName = `shop_user_${getTenantId()}_${dayjs(new Date()).format('YYYYMMDD')}`;
|
||||||
const workbook = {
|
const workbook = {
|
||||||
SheetNames: [sheetName],
|
SheetNames: [sheetName],
|
||||||
Sheets: {}
|
Sheets: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user