Skip to content

Commit 7c11d00

Browse files
committed
11
1 parent 3097fcf commit 7c11d00

File tree

2 files changed

+33
-14
lines changed

2 files changed

+33
-14
lines changed

src/common/config.js

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

src/views/Signup.vue

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
font-size: 30px;
55
}
66
</style>
7-
7+
user_id,
8+
email,
9+
pwd,
10+
sign_time
811
<template>
912
<div>
1013
<div class="title">注册</div>
@@ -19,11 +22,11 @@
1922
<el-form-item label="注册邮箱" prop="email">
2023
<el-input v-model="signForm.email"></el-input>
2124
</el-form-item>
22-
<el-form-item label="登录密码" prop="pass">
23-
<el-input type="password" v-model="signForm.pass" autocomplete="off"></el-input>
25+
<el-form-item label="登录密码" prop="pwd">
26+
<el-input type="password" v-model="signForm.pwd" autocomplete="off"></el-input>
2427
</el-form-item>
25-
<el-form-item label="确认密码" prop="checkPass">
26-
<el-input type="password" v-model="signForm.checkPass" autocomplete="off"></el-input>
28+
<el-form-item label="确认密码" prop="check_pwd">
29+
<el-input type="password" v-model="signForm.check_pwd" autocomplete="off"></el-input>
2730
</el-form-item>
2831
<el-form-item label-width="0px">
2932
<el-button type="primary" @click="submitForm('signForm')">注册</el-button>
@@ -68,12 +71,12 @@ export default {
6871
return {
6972
signForm: {
7073
email: "",
71-
pass: "",
72-
checkPass: ""
74+
pwd: "",
75+
check_pwd: ""
7376
},
7477
rules: {
75-
pass: [{ validator: validatePass, trigger: "blur" }],
76-
checkPass: [{ validator: validatePass2, trigger: "blur" }],
78+
pwd: [{ validator: validatePass, trigger: "blur" }],
79+
check_pwd: [{ validator: validatePass2, trigger: "blur" }],
7780
email: [{ validator: checkEmail, trigger: "blur" }]
7881
}
7982
};
@@ -92,14 +95,30 @@ export default {
9295
},
9396
sign() {
9497
console.log("signService", signService);
95-
98+
let that = this;
9699
return signService
97100
.sign(this.signForm)
98-
.then(() => {
99-
//
101+
.then(res => {
102+
if (res.data.success) {
103+
that.$message({
104+
showClose: true,
105+
message: res.data.errorMsg,
106+
type: "success"
107+
});
108+
} else {
109+
that.$message({
110+
showClose: true,
111+
message: res.data.errorMsg,
112+
type: "error"
113+
});
114+
}
100115
})
101116
.catch(error => {
102-
throw new Error(error);
117+
that.$message({
118+
showClose: true,
119+
message: error,
120+
type: "error"
121+
});
103122
});
104123
}
105124
}

0 commit comments

Comments
 (0)