完善注册页

main
xy 3 weeks ago
parent b40c10e3da
commit 9baff1e903
  1. 33
      src/layout/loginPage.vue

@ -145,7 +145,7 @@
注册
</el-button>
<el-button style="color: #3ad7e2; background-color: #0e2e5e; width: 165px" class="button" type="primary"
auto-insert-space @click="isRegister = false">
auto-insert-space @click="toLogin">
返回到登录页
</el-button>
</el-form-item>
@ -237,7 +237,7 @@
<el-form-item>
<el-button class="hexagon-button" type="primary" auto-insert-space @click="login">登录</el-button>
<el-button class="hexagon-button" type="primary" auto-insert-space
@click="isRegister = true">去注册</el-button>
@click="toRegister">去注册</el-button>
</el-form-item>
</el-form>
</el-col>
@ -250,6 +250,7 @@
<script setup lang="ts">
// import { ref } from "vue"
// import { onMounted, reactive, ref, toRefs, watch } from "vue";
import { ElMessage, ElMessageBox } from 'element-plus'
import settingStore from "@/store/modules/setting";
import { User, Lock, Avatar, Stamp,Grid,Iphone } from "@element-plus/icons-vue";
import { ref } from "vue";
@ -357,7 +358,7 @@ const rules = {
{ required: true, message: "请输入手机号", trigger: "blur" },
{
pattern: /^1[3-9]\d{9}$/,
message: "手机号长度最小六位最大十五位",
message: "手机号格式不正确",
trigger: ["change", "blur"],
},
]
@ -378,12 +379,24 @@ const register = async () => {
};
const res: any = await sturegister(data)
if (res.code === 200) {
// ElMessage.success(``)
// $emits('backLogin')
ElMessage.success(`注册成功`)
isRegister.value = false
formModel.value={
username: "",
password: "",
repassword: "",
name: "",
clssid: '',
studentNumb: "",
mobile: '',
captcha: "",
}
getcodeinfo()
} else {
// ElMessage.warning(res.message)
ElMessage.warning(res.message)
getcodeinfo()
}
console.log(res)
};
const codeUrl = ref("");
@ -413,6 +426,14 @@ const login = async () => {
}
};
const toRegister=()=>{
isRegister.value = true
getcodeinfo();
}
const toLogin=()=>{
isRegister.value = false
getcodeinfo();
}
</script>
<style lang="less" scoped>

Loading…
Cancel
Save