duandian8251
duandian8251
2017-12-11 08:50
浏览 37
已采纳

检查Angular4和GO中是否存在用户名

I'm Using Angular4 as front end and Go service as Back end. When user is log in,I need to check whether username already exist to do that GO service back end will check about that user. If the user is not exists and it displays message. How to display message that "Invalid user details".

Please refer some inputs about that.

Thank you

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongzhimin2231
    dongzhimin2231 2017-12-23 04:09
    已采纳

    You can just check the response from the service if its sending the message back to the client catch the errror and display it.

      this.http.post('http://localhost:8080/log', JSON.stringify(this.login))
        .subscribe((response) => {
          console.log('response data from golang ' + response);
        },
        errmess => { alert(errmess) });
      } 
    
    点赞 评论

相关推荐