提交 7395f3bb 作者: ZhangLingKun

功能:ssr测试

上级 c9ec7d7a
流水线 #7394 已通过 于阶段
in 4 分 47 秒
...@@ -20,23 +20,23 @@ type GoodsInfoListType = InterDataType<QueryGoodsInfoByCategorySub>; ...@@ -20,23 +20,23 @@ type GoodsInfoListType = InterDataType<QueryGoodsInfoByCategorySub>;
// 每次加载页面都会执行 // 每次加载页面都会执行
export async function getServerSideProps() { export async function getServerSideProps() {
// 分类数据 // 分类数据
const categoryList: CategoryListType = []; let categoryList: CategoryListType = [];
// 获取各个目录及分类信息 // 获取各个目录及分类信息
// const getAppCategoryInfo = async () => {
// const res = await MallAPI.getAppCategoryInfo({
// type: 4,
// });
// if (res && res.code === '200') {
// categoryList = res?.result || [];
// }
// };
// fetch测试
const getAppCategoryInfo = async () => { const getAppCategoryInfo = async () => {
const res = await fetch( const res = await MallAPI.getAppCategoryInfo({
'https://test.iuav.com/pms/category/appCategoryInfo?type=4', type: 4,
); });
console.log('fetch测试 res --->', await res?.json()); if (res && res.code === '200') {
categoryList = res?.result || [];
}
}; };
// fetch测试
// const getAppCategoryInfo = async () => {
// const res = await fetch(
// 'https://test.iuav.com/pms/category/appCategoryInfo?type=4',
// );
// console.log('fetch测试 res --->', await res?.json());
// };
// 依次获取接口数据 // 依次获取接口数据
await (async () => { await (async () => {
await getAppCategoryInfo(); await getAppCategoryInfo();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论