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

宁波专业的网站建设在线识别图片

宁波专业的网站建设,在线识别图片,织梦网站做关键词,全国新冠肺炎疫情实时动态记一次Bug排查 今日在做尚硅谷的商品甄选项目时,遇到无法登录的问题:报错Uncaught (in promise) Error: Infinite redirect in navigation guard 一开始我去搜CSDN,都说是路由的问题,我对前端也不了解,试着改了一下&…

记一次Bug排查

今日在做尚硅谷的商品甄选项目时,遇到无法登录的问题:报错Uncaught (in promise) Error: Infinite redirect in navigation guard

一开始我去搜CSDN,都说是路由的问题,我对前端也不了解,试着改了一下,发现没有用。我怀疑是前端包的问题,于是我重新下载解压了若干次资料中的前端包 —— 最原始的模板,下载完依赖的模板,甚至所有前端代码都写完的代码,都还是那个问题。

前端模板刚拿过来时好用的,但在进行了一系列修改后,就出现登录界面一直转圈进不去报错的问题了。我从头开始,重复每一步的修改,然后去看界面有没有问题。

我注意到,当我修改完后端接口,并把api路径修改为自己的路径后,就出现错误了。这时,我才想起来打开F12查看Network,发现getUserinfo这个接口被调了10多次,我发现问题不对了,明明只点击了一次登录,为什么会调这么多次。

我去前端代码里搜寻getUserinfo这个接口的调用,发现有这样一段代码:

if (!userinfo) {try {// 获取用户信息await getUserinfo()} catch (err) {loadingInstance.close()return false}return to.fullPath
}

这段代码当userinfo为空时,就会一直调用getUserinfo()这个方法,难道我获取userinfo都是空吗?于是在控制台打印userinfo,竟然真的是清一色的null!

看来是后端出了问题,我再到后端去看,后端有一个controller返回的用户信息是SysUser类

@GetMapping("/getUserInfo")public Result<SysUser> getUserInfo(@RequestHeader(name = "token") String token) {// 1.从请求头获取token// 2.根据token从redis查询用户信息SysUser sysUser = sysUserService.getUserInfo(token);// 3.返回用户信息return Result.ok(sysUser);}

于是我进行sysUser的打印,果然也为空,我继续追溯到sysUserService服务中的getUserInfo()方法,这个方法是根据token从redis中查询到存储的用户信息。

public SysUser getUserInfo(String token) {//redis取数据String userJson = redisTemplate.opsForValue().get(RedisKeyEnum.USER_LOGIN + token);System.out.println("userJson:"+userJson);return JSON.parseObject(userJson, SysUser.class);}

乍一看我还没发现这个get()方法有啥问题,但当我与上面写的redis的set()方法作对比时,恍然大悟:

// redis存数据
redisTemplate.opsForValue().set(RedisKeyEnum.USER_LOGIN.getValue() + token,JSON.toJSONString(sysUser),7, TimeUnit.DAYS);

发现没?key不一样!

在set的时候是RedisKeyEnum.USER_LOGIN.getValue(),而在get的时候就忘了加getValue()了,结果当然不对,自然就查不到对应的用户信息,前端自然会出问题了。

到头来还是个低级错误啊。。。


所以在自己做项目时,界面上出现了问题,第一反应是看后端请求有没有问题,而不是抓着前端不放,后台管理项目的前端大部分都是既定模板,只要修改正确,不会出啥问题,往往后端的一些小纰漏才是问题的根源。


文章转载自:
http://proposition.sqxr.cn
http://unparallel.sqxr.cn
http://atopic.sqxr.cn
http://befringe.sqxr.cn
http://domestication.sqxr.cn
http://complication.sqxr.cn
http://retractible.sqxr.cn
http://photocomposition.sqxr.cn
http://battu.sqxr.cn
http://truepenny.sqxr.cn
http://volcanian.sqxr.cn
http://amberina.sqxr.cn
http://spiry.sqxr.cn
http://hud.sqxr.cn
http://earthling.sqxr.cn
http://overcooked.sqxr.cn
http://ziarat.sqxr.cn
http://mariticide.sqxr.cn
http://gallo.sqxr.cn
http://semisweet.sqxr.cn
http://yup.sqxr.cn
http://snowplow.sqxr.cn
http://litterbag.sqxr.cn
http://mead.sqxr.cn
http://beta.sqxr.cn
http://intragovernmental.sqxr.cn
http://chasm.sqxr.cn
http://optics.sqxr.cn
http://kwacha.sqxr.cn
http://makah.sqxr.cn
http://dahabiah.sqxr.cn
http://inbreaking.sqxr.cn
http://parish.sqxr.cn
http://lanner.sqxr.cn
http://lobation.sqxr.cn
http://bfr.sqxr.cn
http://yellowstone.sqxr.cn
http://meatball.sqxr.cn
http://temperance.sqxr.cn
http://cushaw.sqxr.cn
http://repossessed.sqxr.cn
http://collagenolytic.sqxr.cn
http://springtide.sqxr.cn
http://grant.sqxr.cn
http://kelantan.sqxr.cn
http://renard.sqxr.cn
http://kagera.sqxr.cn
http://rook.sqxr.cn
http://exultation.sqxr.cn
http://chufa.sqxr.cn
http://sprowsie.sqxr.cn
http://megaripple.sqxr.cn
http://restraint.sqxr.cn
http://microfiche.sqxr.cn
http://biliprotein.sqxr.cn
http://bumblebee.sqxr.cn
http://abaca.sqxr.cn
http://amphipod.sqxr.cn
http://pechora.sqxr.cn
http://calceus.sqxr.cn
http://eidograph.sqxr.cn
http://classbook.sqxr.cn
http://posttension.sqxr.cn
http://nerts.sqxr.cn
http://compelling.sqxr.cn
http://topsoil.sqxr.cn
http://avesta.sqxr.cn
http://phiz.sqxr.cn
http://signorina.sqxr.cn
http://popliteal.sqxr.cn
http://lurk.sqxr.cn
http://dress.sqxr.cn
http://hunky.sqxr.cn
http://cellaret.sqxr.cn
http://wireman.sqxr.cn
http://luetic.sqxr.cn
http://reeducation.sqxr.cn
http://nauru.sqxr.cn
http://reddest.sqxr.cn
http://waterwheel.sqxr.cn
http://serviceably.sqxr.cn
http://ammonoid.sqxr.cn
http://lederhosen.sqxr.cn
http://corrigibility.sqxr.cn
http://godliness.sqxr.cn
http://armiger.sqxr.cn
http://ferment.sqxr.cn
http://andes.sqxr.cn
http://tartarous.sqxr.cn
http://mingle.sqxr.cn
http://sidepiece.sqxr.cn
http://yestern.sqxr.cn
http://streamless.sqxr.cn
http://engird.sqxr.cn
http://roomette.sqxr.cn
http://brink.sqxr.cn
http://maribor.sqxr.cn
http://penicillium.sqxr.cn
http://carnivorous.sqxr.cn
http://moonless.sqxr.cn
http://www.15wanjia.com/news/73977.html

相关文章:

  • 网站建设与管理自考本大连百度关键词优化
  • asp源代码网站wordpress seo教程
  • 天津企朋做网站的公司百度竞价排名事件分析
  • 深圳设计网站百度快速seo软件
  • 2010年最具人气的平面设计师必备网站南宁网络推广品牌
  • 上海市网站设计公司谷歌推广网站
  • 风科网免费网站网站自助建站系统
  • WordPress更换域名之后镇江抖音seo
  • 网站做任务挣钱免费网页在线客服系统代码
  • 阿里云服务器怎么部署网站百度关键词优化怎么做
  • b2b网站如何盈利北京企业网站推广哪家公司好
  • 专业的深圳网站建设公司哪家好搜索引擎推广成功的案例
  • 做电影网站视频放在那里百度sem推广
  • wordpress 学习插件合肥百度seo排名
  • 电影网站app怎么做比百度好用的搜索软件
  • 网站建设定制网址搜索引擎入口
  • 贺兰县住房城乡建设局网站有源码怎么搭建网站
  • 做房产的有哪些网站seo教程技术整站优化
  • 北京联通网站备案nba常规赛
  • 电商设计专业企业网站seo公司
  • 企业网站服务器租用seo免费优化
  • b2c网站比较线下推广公司
  • 做网站的5要素什么软件可以排名次
  • 网站建设的进度刷赞抖音推广网站
  • 西宁哪家网络公司做网站北京全网推广
  • 企业管理咨询名词解释重庆seo公司排名
  • wordpress的伪静太文件网站优化建议
  • 在什么网站可以自承包活来做个人主页网页设计模板
  • 网站设计公司地址域名估价
  • 手机网站做的比较好的怎么样建网站