20260804,日常开发-观察与求助
问题说明
在一个内部ERP系统中,会跳转一个外部服务。测试同学反馈,打不开报错。报错如下:
问题解决
跳转代码如下
public static void pcInsuranceReportByLogin(BeatContext beat, String orderNo, String ticket, String url, String mobile, String deviceInfo, Long downloadUser) throws Exception { StringBuffer content = new StringBuffer(); content.append("ticket").append('=').append(ticket); content.append("&orderno").append('=').append(orderNo); content.append("&phone").append('=').append(mobile); content.append("&source").append('=').append("crm"); content.append("&pdfNameType").append('=').append("4"); content.append("&deviceInfo").append('=').append(deviceInfo); /** * 下载人信息 */ content.append("&downloadUser").append('=').append(downloadUser); logger.info("查看下载检测基础版报告 content is :{} url is {}",content.toString(), url); byte[] b = HttpUtil.exec(beat.getRequest(), beat.getResponse(), url, "GET", content.toString()); writer(beat, b); } private static void writer(BeatContext beat, byte[] b) throws Exception { beat.getResponse().getWriter().write(new String(b, "utf-8")); beat.getResponse().getWriter().flush(); beat.getResponse().getWriter().close(); }可见,拿到一个地址,获取流然后写到response里取。找到对方的地址url,打开浏览器,发现人家可以正常打开,域名是,treport.chaboshi.cn。奇怪从erp里走进去,路径但是却定位到tqa.chaboshi.cn
GET https://tqa.chaboshi.cn/views/pcNewEnergyReport/components/header.js net::ERR_ABORTED 404 (Not Found)问题陷入僵局,我知道,我们是使用方,里边不受我们控制,更何况我们这什么也没改。
找运维,运维说不是我们的问题;找h5,还是人家慧眼。看到如下
为什么一些资源,没有绝对路径呢。前端开发过程,肯定是相对路径。部署的时候,再当前域名下可以,但是其他域名进来,就会打不开。
好吧,问题到此,水落石出,运维的问题。或者说项目打包问题。
运维说,已经2周了,你们都没发现?呵呵,没人用吧,没人较真吧。
问题总结
- 遇到问题不要慌,不要急(线上问题除外)
- 放平心态,找人协助。也不要急,每个团队都有自己的节奏
- 要善于观察和发现。见藐小微物,必明察秋毫