Commit 7c77730d by zhangjie

登录

parent 30bbe18b
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<el-form-item prop="email"> <el-form-item prop="email">
<el-input <el-input
prefix-icon="el-icon-message" prefix-icon="el-icon-message"
style="background:#fff" style="background: #fff"
v-model="ruleForm.email" v-model="ruleForm.email"
placeholder="Email"></el-input> placeholder="Email"></el-input>
</el-form-item> </el-form-item>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<el-input <el-input
:type="showPwd ? 'text' : 'password'" :type="showPwd ? 'text' : 'password'"
prefix-icon="el-icon-lock" prefix-icon="el-icon-lock"
style="background:#fff" style="background: #fff"
v-model="ruleForm.password" v-model="ruleForm.password"
placeholder="Password" placeholder="Password"
@keyup.enter.native="submitForm('ruleForm')"> @keyup.enter.native="submitForm('ruleForm')">
...@@ -430,8 +430,11 @@ export default { ...@@ -430,8 +430,11 @@ export default {
submitForm() { submitForm() {
this.$refs.ruleForm.validate((valid) => { this.$refs.ruleForm.validate((valid) => {
if (valid) { if (valid) {
let url = `user/login?email=${this.ruleForm.email}&password=${this.ruleForm.password}` let url = `user/login`
post(url).then((res) => { post(url, {
email: this.ruleForm.email,
password: this.ruleForm.password,
}).then((res) => {
this.$message.success(res.message) this.$message.success(res.message)
if (res.message == '操作成功') { if (res.message == '操作成功') {
this.ruleForm = {} this.ruleForm = {}
...@@ -468,7 +471,7 @@ export default { ...@@ -468,7 +471,7 @@ export default {
} }
.login_content { .login_content {
padding: 18px; padding: 18px;
background: rgba(255, 255, 255, 0.4);; background: rgba(255, 255, 255, 0.4);
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 80%; left: 80%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment