Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Vue from 'vue'
- import Request from 'superagent'
- require('./css/style.css')
- new Vue({
- el: '#app',
- data: {
- username: '',
- password: ''
- },
- methods: {
- login() {
- if (this.username === '' || this.password === '') {
- return false
- }
- var login = {
- username: this.username,
- password: this.password
- }
- console.log(login)
- Request
- .put('http://localhost:8181/login')
- .send(JSON.stringify(login))
- .end(function(err, res) {
- if (err || !res.ok) {
- console.log(err)
- console.log("error!")
- } else {
- console.log(res.text)
- }
- })
- },
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement