Skip to content

Commit

Permalink
feat: 注册step3创建账号
Browse files Browse the repository at this point in the history
  • Loading branch information
AsakiRain committed Jan 18, 2023
1 parent c54113c commit b153565
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/api/reg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const postEmailForm = async (
const postAccountForm = async (
accountReq: AccountReq
): Promise<MyRes<EmailRes>> => {
const res = await apiPost("reg/flow/2", accountReq);
const res = await apiPost("reg/flow/3", accountReq);
if (res.code !== 20000) {
message.error(res.message);
checkExistence(res);
Expand Down
11 changes: 5 additions & 6 deletions src/views/reg/Step3.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ const accountForm = reactive<AccountForm>({
serial: localStorage.reg_serial,
});
const handleStepAcount = async (emailForm: EmailForm) => {
const handleStepAcount = async (accountForm: AccountForm) => {
setLoading(true);
console.log(emailForm);
try {
const res = await reg.postAccountForm({
username: accountForm.username,
Expand Down Expand Up @@ -154,11 +153,11 @@ const rules: Record<string, Rule[]> = {
message: "请再次输入密码",
},
{
validator: (rule, value, callback) => {
if (accountForm.password !== accountForm.password_confirm) {
callback("两次密码输入不一致");
validator: (_rule, value, _callback) => {
if (accountForm.password !== value) {
return Promise.reject("两次密码输入不一致")
} else {
callback();
return Promise.resolve();
}
},
},
Expand Down

0 comments on commit b153565

Please sign in to comment.