设为首页
收藏本站
首页
Portal
技术区
BBS
Vue
JavaScript
Discuz!
导读
Guide
热点排行
1
TypeError: Cannot read properties of undefined (reading 'data') at O
2
安装Discuz! Q 环境要求与配置
代码人
»
技术区
›
技术广场
›
Vue
›
查看内容
返回列表
发新帖
TypeError: Cannot read properties of undefined (reading 'data') at Object.po
dmr
dmr
当前离线
积分
1848
437
主题
3
回帖
1848
积分
管理员
积分
1848
发消息
显示全部楼层
1.页面加载,接口POST请求,报错:
错误1:请求返回空响应
...index.ts:34 【src/config/axios/index.ts】
错误2:POST请求失败: TypeError: Cannot read properties of undefined (reading 'data') at Object.post
post: async <T = any>(option: any) => {
//const res = await request({ method: 'POST', ...option })
//return res.data as unknown as T
try {
const res = await request({ method: 'POST', ...option });
// 添加空值检查
if (!res) {
console.error('<font color="#ff0000">请求返回空响应</font>'); //<font color="#ff0000">错误1</font>
}
return res.data as unknown as T;
} catch (error) {
console.error('POST请求失败:', error);//<font color="#ff0000">错误2</font>
}
},
复制代码
错误1:Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'list')
at getList
上面的错误出处:
const getList = async () => {
loading.value = true
try {
// 工作台获取工作任务分页
const res = await workbenchApi.getWorkbenchList(queryParams.value)
list.value = res.list //错误1
total.value = res.total
// 获取工作任务统计
workbenchList.value = await workbenchApi.getWorkbenchCount()
if(workbenchList.value){
getDictObj('FLOW_BUS_OPT')
}
loading.value = false
} finally {
loading.value = false
}
}
3.上面的接口报错后,页面返回登录页面,进行登录,报错
Uncaught (in promise) Error: No match for
{"name":"Home","params":{}}
登录页面没有跳转,报错提示上面的错误。
怎么解决?
微信扫一扫,分享更方便
代码人
相关帖子
2026-8-7
商家称1小时被20条差评后门店倒闭
2026-8-7
河南三支一扶笔试成绩作废!将重考
2026-8-7
女儿为争财产堵门阻挠父亲出殡
2026-8-7
河南撤回“领导带薪错峰休假”通知
2026-8-10
男子结婚8年3个女儿均非亲生,律师:属欺诈性抚养案件
2026-8-10
武汉天桥城管打人 当地通报
2026-8-17
北京领失业金期间,干了五件事,停止享受失业保险待遇
2026-8-18
【夜读】5个超棒的人生心态,值得分享!
2026-8-26
西藏日喀则市吉隆县吉隆口岸发生泥石流灾害,造成重大人员伤亡、失联
2026-9-5
【夜读】一个家最好的模样,从这3句话开始
上一篇:
vue3+ts项目开发笔记
下一篇: 没有了
发表于 2025-12-4 10:01:59
举报
回复
分享
dmr
dmr
当前离线
积分
1848
437
主题
3
回帖
1848
积分
管理员
积分
1848
发消息
楼主
|
显示全部楼层
解决办法:
有待测试,看看效果。
剩余
92%
内容需要支付
30.00
元 后可完整阅读
付费阅读
加入会员
支持付费阅读,激励作者创作更好的作品。会员可8折购买!
发表于 2025-12-4 10:45:22
举报
回复
返回列表
发新帖
本版积分规则
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
立即注册
浏览过的版块
uniapp
黑夜模式
快速发帖
返回列表
返回顶部