Skip to content

Commit 3097fcf

Browse files
committed
22
1 parent e00494c commit 3097fcf

File tree

4 files changed

+24
-19
lines changed

4 files changed

+24
-19
lines changed

src/assets/scss/main.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ a:active {
2525
.boder-bottom {
2626
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
2727
}
28+
29+
.sign-form {
30+
width: 600px;
31+
margin: auto;
32+
}

src/common/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const API_URL = "https://conduit.productionready.io/api";
1+
export const API_URL = "https://localhost:44309/api";
22
// export const API_URL = "http://localhost:56055/api";
33
export default API_URL;

src/common/sign.service.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import ApiService from "@/common/api.service"
22

33
export const TagsService = {
4-
get() {
5-
return ApiService.get("tags");
4+
sign(param) {
5+
return ApiService.post("sign/sign", param);
66
}
7-
};
7+
};
8+
9+
export default TagsService;

src/views/Signup.vue

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
<style>
2-
.sign-form {
3-
width: 600px;
4-
margin: auto;
5-
}
62
.title {
73
padding: 10px 0;
84
font-size: 30px;
@@ -13,24 +9,24 @@
139
<div>
1410
<div class="title">注册</div>
1511
<el-form
16-
:model="ruleForm"
12+
:model="signForm"
1713
status-icon
1814
:rules="rules"
19-
ref="ruleForm"
15+
ref="signForm"
2016
label-width="100px"
2117
class="sign-form"
2218
>
2319
<el-form-item label="注册邮箱" prop="email">
24-
<el-input v-model="ruleForm.email"></el-input>
20+
<el-input v-model="signForm.email"></el-input>
2521
</el-form-item>
2622
<el-form-item label="登录密码" prop="pass">
27-
<el-input type="password" v-model="ruleForm.pass" autocomplete="off"></el-input>
23+
<el-input type="password" v-model="signForm.pass" autocomplete="off"></el-input>
2824
</el-form-item>
2925
<el-form-item label="确认密码" prop="checkPass">
30-
<el-input type="password" v-model="ruleForm.checkPass" autocomplete="off"></el-input>
26+
<el-input type="password" v-model="signForm.checkPass" autocomplete="off"></el-input>
3127
</el-form-item>
3228
<el-form-item label-width="0px">
33-
<el-button type="primary" @click="submitForm('ruleForm')">注册</el-button>
29+
<el-button type="primary" @click="submitForm('signForm')">注册</el-button>
3430
</el-form-item>
3531
</el-form>
3632
</div>
@@ -53,24 +49,24 @@ export default {
5349
if (value === "") {
5450
callback(new Error("请输入密码"));
5551
} else {
56-
if (this.ruleForm.checkPass !== "") {
57-
this.$refs.ruleForm.validateField("checkPass");
52+
if (this.signForm.checkPass !== "") {
53+
this.$refs.signForm.validateField("checkPass");
5854
}
5955
callback();
6056
}
6157
};
6258
var validatePass2 = (rule, value, callback) => {
6359
if (value === "") {
6460
callback(new Error("请再次输入密码"));
65-
} else if (value !== this.ruleForm.pass) {
61+
} else if (value !== this.signForm.pass) {
6662
callback(new Error("两次输入密码不一致!"));
6763
} else {
6864
callback();
6965
}
7066
};
7167
7268
return {
73-
ruleForm: {
69+
signForm: {
7470
email: "",
7571
pass: "",
7672
checkPass: ""
@@ -95,8 +91,10 @@ export default {
9591
});
9692
},
9793
sign() {
94+
console.log("signService", signService);
95+
9896
return signService
99-
.sign()
97+
.sign(this.signForm)
10098
.then(() => {
10199
//
102100
})

0 commit comments

Comments
 (0)