码迷,mamicode.com
首页 > 其他好文 > 详细

Vue 跳转

时间:2020-03-29 12:43:01      阅读:48      评论:0      收藏:0      [点我收藏+]

标签:成功   use   密码   lse   ons   用户名   back   添加   response   

1、可以在请求中添加跳转

myLogin(){
          console.log(this.account+"----"+this.accountPassword)
         if(this.account == ‘‘ || this.accountPassword == ‘‘) {
           console.log(this.account)
           this.show( ‘请填写用户名/密码‘)
         }else {
           this.$http.post(‘http://localhost:8081/getUserByNameAndPsw‘,
             {
               userName: this.account,
               password:this.accountPassword
             }).then((response) => {
                  console.log(response.body)
              if(response.body.code === 200){
                this.visibleFlag = true
                  console.log("成功登陆")
                this.$router.push(‘/navigation‘)  // 实现跳转
              }else {
                console.log(response.body.msg);
                this.visibleFlag = true
                this.show(response.body.msg)
              }
           })
         }
        }
      }

 

Vue 跳转

标签:成功   use   密码   lse   ons   用户名   back   添加   response   

原文地址:https://www.cnblogs.com/ywjfx/p/12591310.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!