first commit

This commit is contained in:
ronger 2020-06-29 16:57:49 +08:00
parent 96b870951a
commit eeca69ce6d
2 changed files with 13 additions and 12 deletions

View File

@ -77,15 +77,14 @@
password: _ts.user.password
}
_ts.axios.post('/console/login', _ts.qs.stringify(data)).then(function (res) {
if (res) {
if (res.message) {
_ts.$message(res.message);
_ts.$axios.$post('/api/v1/console/login', data).then(function (res) {
if (res.data) {
if (res.data.message) {
_ts.$message(res.data.message);
return false;
}
_ts.$store.commit('initLogin', res.user);
_ts.$router.push({
name: 'home'
name: 'index'
})
}
})

View File

@ -61,9 +61,11 @@
return false
}
let data = {
email: encodeURI(email)
email: email
}
_ts.$axios.$post('/api/v1/console/get-email-code', data).then(response => {
_ts.$axios.$get('/api/v1/console/get-email-code', {
params: data
}).then(response => {
if (response.data) {
_ts.$message(response.data.message)
}
@ -78,10 +80,10 @@
password: _ts.user.password,
code: _ts.user.code
}
_ts.$axios.$post('/console/register', _ts.qs.stringify(data)).then(function (res) {
if (res) {
_ts.$message(res.message);
if (res.flag && res.flag === 1) {
_ts.$axios.$post('/api/v1/console/register', data).then(function (res) {
if (res.data) {
_ts.$message(res.data.message);
if (res.data.flag && res.data.flag === 1) {
setTimeout(function () {
_ts.$router.push(
{