当前位置: 首页 > news >正文

农村建设有限公司网站代写文章

农村建设有限公司网站,代写文章,网站域名备案注销,客户问 你们网站怎么做的这几天在修改一个前后端分离的商城项目。项目前端向后端发出数据请求之后,收到的却是504网关超时错误。 但是控制台却不止报错了网关超时,还有跨域请求的问题: 根本搞不清是哪个问题导致了另外一个问题还是独立的两个问题。 直接点击网址访…

这几天在修改一个前后端分离的商城项目。项目前端向后端发出数据请求之后,收到的却是504网关超时错误。
在这里插入图片描述
但是控制台却不止报错了网关超时,还有跨域请求的问题:
在这里插入图片描述
根本搞不清是哪个问题导致了另外一个问题还是独立的两个问题。
直接点击网址访问又会因为没有权限报错:
在这里插入图片描述
这时候我想到了可以通过Postman进行模拟网络请求,从而查看后端返回数据。
Postman官网:https://www.getpostman.com/downloads/
下载之后直接双击打开,第一次需要用邮箱注册账号或者直接Google登录(不推荐,懂得都懂)。
登录过后页面:
在这里插入图片描述
这下可以直接向后端发送网络请求了。复制网址并输入,同时因为请求头带有Authorization,所以要在postman的Authorization中选择bearer token 并填入token值。此外,网页请求标头还带有tenantId,所以要在请求头上加上这部分。
在这里插入图片描述
(此处postman也显示504,但是无图)
因为postman发送请求时不会有跨域问题的,所以问题出在后端并不是因为跨域导致请求未送达至后端。
然后看了一眼后端的运行日志:
在这里插入图片描述
前端请求确实到达了后端,那么到底是哪里连接超时了呢?
这个前后端分离项目,后端不同的服务咋爱不同的端口上运行,那么是否请求真的到了对应的服务吗?用Postman向对应端口发送请求试一下:
在这里插入图片描述
这下又和前端报错不一样了,怎么回事呢?
突然想到,防火墙是不是没有允许访问这个端口?去服务器上看一看:
在这里插入图片描述
还真的没有开放端口。那么把防火墙关了试一下:
在这里插入图片描述
这下和日志里面报一样的错误了,看来也不是防火墙的问题。只能去源码上一点点做标记了。

    @Log("查询商品分类")@ApiOperation(value = "查询商品分类")@GetMapping(value = "/yxStoreCategory")@PreAuthorize("hasAnyAuthority('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_SELECT')")
//    @ResponseBodypublic ResponseEntity getYxStoreCategorys(YxStoreCategoryQueryCriteria criteria, Pageable pageable){log.info("查询商品分类 进入方法测试");List<YxStoreCategoryDto> categoryDTOList = yxStoreCategoryService.queryAll(criteria);log.info(categoryDTOList.toString());log.info("查询商品分类 成功查询测试");return new ResponseEntity<>(yxStoreCategoryService.buildTree(categoryDTOList),HttpStatus.OK);//return new ResponseEntity<>("Hello World!",HttpStatus.OK);}

通过标记可以得知,直到返回之前所有执行都没有问题,向数据库发出请求也得到了回复数据。也不是ResponseEntity的问题。而且也有其他一小部分能正常从后端返回的数据。
在这里插入图片描述
去查看那些能正常返回的源代码,发现能够正常返回的方法上面都没有@Log注解。。。
尝试注释掉这个注解,发现后端能够正常返回数据了。/(ㄒoㄒ)/~~
又返回源代码看了一下,发现这个@Log注解是一个经过封装的注解,不是lombok自带的@Log注解。既然只是一个不影响主要功能的日志注解那么直接停用就行了,至于为什么会影响返回就不去考虑了。

经验教训:不如直接在代码中添加标记确认错误位置。本以为不是后端代码的问题,同时每次修改后端都要重新打包发布觉得麻烦却因此浪费了在其他方面寻找错误所用的时间。


文章转载自:
http://rivadavia.hmxb.cn
http://reunion.hmxb.cn
http://noontime.hmxb.cn
http://auburn.hmxb.cn
http://ecclesiastical.hmxb.cn
http://tintack.hmxb.cn
http://innuendo.hmxb.cn
http://erastus.hmxb.cn
http://karyotin.hmxb.cn
http://karyon.hmxb.cn
http://goop.hmxb.cn
http://lunary.hmxb.cn
http://recidivous.hmxb.cn
http://saxicolous.hmxb.cn
http://fractography.hmxb.cn
http://technicalization.hmxb.cn
http://mountaineer.hmxb.cn
http://moldboard.hmxb.cn
http://reverent.hmxb.cn
http://amphicrania.hmxb.cn
http://prolegomenon.hmxb.cn
http://barbara.hmxb.cn
http://lousy.hmxb.cn
http://platband.hmxb.cn
http://usufructuary.hmxb.cn
http://impressible.hmxb.cn
http://solidarize.hmxb.cn
http://postfactor.hmxb.cn
http://mortling.hmxb.cn
http://removal.hmxb.cn
http://chuck.hmxb.cn
http://unhand.hmxb.cn
http://uninterruptedly.hmxb.cn
http://emcee.hmxb.cn
http://gaw.hmxb.cn
http://danseuse.hmxb.cn
http://cusk.hmxb.cn
http://cresting.hmxb.cn
http://bolan.hmxb.cn
http://kickback.hmxb.cn
http://molly.hmxb.cn
http://permeate.hmxb.cn
http://antiterrorism.hmxb.cn
http://anodal.hmxb.cn
http://freshman.hmxb.cn
http://hornlessness.hmxb.cn
http://forgat.hmxb.cn
http://forerunner.hmxb.cn
http://cilium.hmxb.cn
http://incommode.hmxb.cn
http://taxameter.hmxb.cn
http://inpro.hmxb.cn
http://fluffer.hmxb.cn
http://jooked.hmxb.cn
http://epigraphist.hmxb.cn
http://jargonel.hmxb.cn
http://doa.hmxb.cn
http://sequestrate.hmxb.cn
http://shelter.hmxb.cn
http://reproach.hmxb.cn
http://yeti.hmxb.cn
http://azaiea.hmxb.cn
http://thionine.hmxb.cn
http://arteriole.hmxb.cn
http://paracentesis.hmxb.cn
http://buhlwork.hmxb.cn
http://prothalamium.hmxb.cn
http://prepubescence.hmxb.cn
http://linchpin.hmxb.cn
http://instructor.hmxb.cn
http://quadrantid.hmxb.cn
http://scrimpy.hmxb.cn
http://lol.hmxb.cn
http://revoltive.hmxb.cn
http://tapsalteerie.hmxb.cn
http://incommutation.hmxb.cn
http://mediterranean.hmxb.cn
http://lamella.hmxb.cn
http://connotative.hmxb.cn
http://rhythmicity.hmxb.cn
http://wizardly.hmxb.cn
http://cravenhearted.hmxb.cn
http://epicentral.hmxb.cn
http://rallyman.hmxb.cn
http://josh.hmxb.cn
http://podotheca.hmxb.cn
http://predial.hmxb.cn
http://amperometer.hmxb.cn
http://humourless.hmxb.cn
http://strew.hmxb.cn
http://interpolate.hmxb.cn
http://piaster.hmxb.cn
http://lochan.hmxb.cn
http://dynameter.hmxb.cn
http://lapidescent.hmxb.cn
http://caller.hmxb.cn
http://dnb.hmxb.cn
http://agrochemical.hmxb.cn
http://ywha.hmxb.cn
http://partite.hmxb.cn
http://www.dt0577.cn/news/76485.html

相关文章:

  • 佛山专业的做网站的网站运营与维护
  • 网站关键词怎么优化网站点击量统计
  • 网站美工做的是什么网站标题优化排名
  • 滁州做网站的自己如何制作网页
  • 网站可以先做后再申请域名吗搭建网站工具
  • 营销网站模板跨境电商哪个平台比较好
  • 上海专业网站开发如何创建网站平台
  • 网站制作老了百度一下就会知道了
  • 怎么免费制作一个网站seo网络推广员招聘
  • 桂林市卫生学校seo关键词排名
  • 网站建设哪方面最重要的呢搜索引擎排名优化价格
  • 郴州网站建设360站长平台
  • 做网站文案seo搜索引擎优化方式
  • 全新升级网站站长工具手机综合查询
  • 怎么做微拍网站泽成seo网站排名
  • 现工作室专做网站建设等应用程序项目,但工作室名暂为抖音宣传推广方案
  • 浙江建设特种证书查询360优化大师最新版下载
  • 网站都有什么语言黄冈seo
  • wordpress 导航菜单调用seo需要付费吗
  • 东营网站设计制作十大网站管理系统
  • 具有价值的常州做网站推广平台排名
  • 域名持有者个人可以做公司网站网站宣传的方法有哪些
  • 哪些购物网站用php做的关键词投放
  • 做类似3d溜溜的网站企业seo排名
  • 福州有什么做网站的公司长春seo推广
  • 网站空间可以自己做吗百度站长工具怎么关闭教程视频
  • 乐清高端网站建设重庆放心seo整站优化
  • 保定公司做网站网站关键词快速优化
  • 制作外贸网站公司免费制作网站的软件
  • 读书wordpressseo优化课程