Skip to content

Commit

Permalink
22
Browse files Browse the repository at this point in the history
  • Loading branch information
SpringHgui committed Mar 10, 2020
1 parent e00494c commit 3097fcf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
5 changes: 5 additions & 0 deletions src/assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ a:active {
.boder-bottom {
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sign-form {
width: 600px;
margin: auto;
}
2 changes: 1 addition & 1 deletion src/common/config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const API_URL = "https://conduit.productionready.io/api";
export const API_URL = "https://localhost:44309/api";
// export const API_URL = "http://localhost:56055/api";
export default API_URL;
8 changes: 5 additions & 3 deletions src/common/sign.service.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import ApiService from "@/common/api.service"

export const TagsService = {
get() {
return ApiService.get("tags");
sign(param) {
return ApiService.post("sign/sign", param);
}
};
};

export default TagsService;
28 changes: 13 additions & 15 deletions src/views/Signup.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<style>
.sign-form {
width: 600px;
margin: auto;
}
.title {
padding: 10px 0;
font-size: 30px;
Expand All @@ -13,24 +9,24 @@
<div>
<div class="title">注册</div>
<el-form
:model="ruleForm"
:model="signForm"
status-icon
:rules="rules"
ref="ruleForm"
ref="signForm"
label-width="100px"
class="sign-form"
>
<el-form-item label="注册邮箱" prop="email">
<el-input v-model="ruleForm.email"></el-input>
<el-input v-model="signForm.email"></el-input>
</el-form-item>
<el-form-item label="登录密码" prop="pass">
<el-input type="password" v-model="ruleForm.pass" autocomplete="off"></el-input>
<el-input type="password" v-model="signForm.pass" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="checkPass">
<el-input type="password" v-model="ruleForm.checkPass" autocomplete="off"></el-input>
<el-input type="password" v-model="signForm.checkPass" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label-width="0px">
<el-button type="primary" @click="submitForm('ruleForm')">注册</el-button>
<el-button type="primary" @click="submitForm('signForm')">注册</el-button>
</el-form-item>
</el-form>
</div>
Expand All @@ -53,24 +49,24 @@ export default {
if (value === "") {
callback(new Error("请输入密码"));
} else {
if (this.ruleForm.checkPass !== "") {
this.$refs.ruleForm.validateField("checkPass");
if (this.signForm.checkPass !== "") {
this.$refs.signForm.validateField("checkPass");
}
callback();
}
};
var validatePass2 = (rule, value, callback) => {
if (value === "") {
callback(new Error("请再次输入密码"));
} else if (value !== this.ruleForm.pass) {
} else if (value !== this.signForm.pass) {
callback(new Error("两次输入密码不一致!"));
} else {
callback();
}
};
return {
ruleForm: {
signForm: {
email: "",
pass: "",
checkPass: ""
Expand All @@ -95,8 +91,10 @@ export default {
});
},
sign() {
console.log("signService", signService);
return signService
.sign()
.sign(this.signForm)
.then(() => {
//
})
Expand Down

0 comments on commit 3097fcf

Please sign in to comment.