代号OL 2021-09-16 16:00 采纳率: 0%
浏览 54

vue+django 的项目 登录成功后页面不跳转

你好,新学的python和vue ,遇到一个入门级的坑 ,望请解答下,谢谢

 userlogin(this.loginForm.username,this.loginForm.password).then(
            function(resp) {
              const flag = resp.data.request['flag']
              if (flag == 'yes') {
                that.loading = true
                var dcs=that.redirect.replace('/','')
                return  that.$router.push({ path: that.redirect.replace('/','') || '/', query: that.otherQuery })  --问题点在这
                // console.log(resp.data.request['flag'])
              } else {
                alert('账号异常!')
                that.loading  = false
                console.log('error submit!!')
              }
            }
          )

这个是能获取成功的

但是就是不跳转页面

  • 写回答

1条回答 默认 最新

  • 关注
    return  that.$router.push({ path: that.redirect.replace('/','') || '/', query: that.otherQuery })  --问题点在这
    不需要return,改为
    that.$router.push({ path: that.redirect.replace('/','') || '/', query: that.otherQuery })  --问题点在这
    
    
    评论

报告相同问题?

问题事件

  • 创建了问题 9月16日

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料