Answer the question
In order to leave comments, you need to log in
Why does the code map error pop up?
When reloading the page, the following error flies to the browser console:
Code map error: request failed with status 404
Resource URL: localhost:3000/_nuxt/vendors.app.js
Code map URL: unfetch.mjs.map
sendRequestLogin(e) {
if (this.loginInput === '' || this.passwordInput === '') {
this.emptyInput = 'Invalid data'
}
this.$axios
.post('/login', {
name: this.loginInput,
password: this.passwordInput
})
.then(res => {
if (res.data.auth === true) {
this.$emit('close', res.data)
this.$emit('login', res.data)
}
if (res.data.auth === false) {
this.emptyInput = res.data.text
}
})
.catch(err => {
consola.log(err)
})
},
app.post('/login', function(req, res) {
// authorization
const nick = req.body.name
const password = req.body.password
db.all(SQLCHeck, [], (err, row) => {
if (row.length === '0') {
const jSON = JSON.stringify({
auth: false,
text: 'Wrong login or password!'
})
return res.send(jSON)
}
if (err) {
return consola.log(err.message)
}
const dataLogin = {
auth: true,
userNick: nick
}
const jSON = JSON.stringify(dataLogin)
return res.send(jSON) // send data{} to client
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question