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 password: _ts.user.password
} }
_ts.axios.post('/console/login', _ts.qs.stringify(data)).then(function (res) { _ts.$axios.$post('/api/v1/console/login', data).then(function (res) {
if (res) { if (res.data) {
if (res.message) { if (res.data.message) {
_ts.$message(res.message); _ts.$message(res.data.message);
return false; return false;
} }
_ts.$store.commit('initLogin', res.user);
_ts.$router.push({ _ts.$router.push({
name: 'home' name: 'index'
}) })
} }
}) })

View File

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