Commit a5be666f authored by zhengke's avatar zhengke

微信 登录

parent 217a1772
...@@ -10,7 +10,7 @@ const router = createRouter({ ...@@ -10,7 +10,7 @@ const router = createRouter({
}) })
const whiteList = ['/autoLogin','/login','/notfound','/regist','/','/forgot','/newpass','/notsupported'] const whiteList = ['/autoLogin','/login','/notfound','/regist','/','/forgot','/newpass','/notsupported','/BindToWechat']
const managerMenu = ['/market','/editor_admin'] const managerMenu = ['/market','/editor_admin']
let loadingInstance:any = null let loadingInstance:any = null
......
<template> <template>
<div class="window-height regist-box column flex-center items-center"> <div class="window-height bind-box column flex-center items-center">
<div class="column flex-center items-center rounded light-shadow q-pa-xl bg-white" style="margin: 60px 0;"> <div class="column flex-center items-center rounded light-shadow q-pa-xl bg-white" style="margin: 60px 0;">
<div class="text-center"> <div class="text-center">
<div style="font-size: 1.88vw; line-height: 1;" class="text-dark text-weight-bolder row items-end flex-center"> <div style="font-size: 1.88vw; line-height: 1;padding-top: 40px;" class="text-dark text-weight-bolder row items-end flex-center">
<span>立即绑定</span> <span>立即绑定</span>
</div> </div>
<div class="text-small" style="color:#404B5B;margin-top:0.99vw">绑定账号,登录更轻松</div> <div class="text-small" style="color:#404B5B;margin-top:0.99vw">绑定账号,登录更轻松</div>
</div> </div>
<div style="width:400px;padding:0 50px;"> <div style="width:400px;padding:0 50px;">
<el-form ref="registFormRef" :model="model" :rules="rules" label-width="0px" size="large" class="full-width q-mt-lg" :disabled="loading"> <el-form ref="bindFormRef" :model="model" :rules="rules" label-width="0px" size="large" class="full-width q-mt-lg" :disabled="loading">
<!-- <el-form-item label="" prop="nickname">
<el-input v-model="model.nickname" placeholder="昵称" class="q-mt-lg" />
</el-form-item> -->
<!-- <el-form-item label="" prop="account">
<el-input v-model="model.account" placeholder="账号" />
</el-form-item> -->
<el-form-item label="" prop="mail"> <el-form-item label="" prop="mail">
<el-input v-model="model.mail" placeholder="邮箱"> <el-input v-model="model.mail" placeholder="邮箱">
<template #suffix> <template #suffix>
...@@ -39,12 +33,12 @@ ...@@ -39,12 +33,12 @@
<!-- <vue-hcaptcha ref="invisibleHcaptcha" sitekey="46e00e53-ddb2-4e7b-9c51-621534c2f1f5" @verify="verifyHandler"></vue-hcaptcha> --> <!-- <vue-hcaptcha ref="invisibleHcaptcha" sitekey="46e00e53-ddb2-4e7b-9c51-621534c2f1f5" @verify="verifyHandler"></vue-hcaptcha> -->
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" class="full-width q-mb-lg" @click="submitForm(registFormRef)" :loading="loading">立即绑定</el-button> <el-button type="primary" class="full-width q-mb-lg" @click="submitForm(bindFormRef)" :loading="loading">立即绑定</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="text-info text-small row flex-center"> <div class="text-info text-small row flex-center">
<span>&nbsp;</span> <span>密码登录?</span>
<el-button link type="primary" class="q-mb-lg" >&nbsp;</el-button> <el-button link type="primary" class="q-mb-lg" @click="redicetToLogin">立即登录</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -78,7 +72,7 @@ const model = ref<{password:string,confirmPwd:string,mail:string,code:string}>({ ...@@ -78,7 +72,7 @@ const model = ref<{password:string,confirmPwd:string,mail:string,code:string}>({
phone: '' phone: ''
}) })
const validateToken = ref('') const validateToken = ref('')
const registFormRef = ref<FormInstance>() const bindFormRef = ref<FormInstance>()
const invisibleHcaptcha = ref<VueHcaptcha|null>(null) const invisibleHcaptcha = ref<VueHcaptcha|null>(null)
const loading = ref(false) const loading = ref(false)
const sending = ref(false) const sending = ref(false)
...@@ -142,16 +136,16 @@ const submitForm = async (formEl: FormInstance | undefined) => { ...@@ -142,16 +136,16 @@ const submitForm = async (formEl: FormInstance | undefined) => {
loading.value=false loading.value=false
return return
} }
await registHandler() await bindHandler()
} }
loading.value=false loading.value=false
}) })
} }
const registHandler = async () =>{ const bindHandler = async () =>{
const response = await UserServices.RegistUserAsync(model.value.mail,model.value.password,model.value.code,validateToken.value) const response = await UserServices.RegistUserAsync(model.value.mail,model.value.password,model.value.code,validateToken.value)
if(response.data.resultCode == ApiResult.SUCCESS){ if(response.data.resultCode == ApiResult.SUCCESS){
ElMessage.success({message:'注册成功,正在跳转'}) ElMessage.success({message:'绑定成功,正在跳转'})
setTimeout(() => { setTimeout(() => {
redicetToLogin() redicetToLogin()
}, 1000); }, 1000);
...@@ -185,7 +179,7 @@ const sendVerifyCode = async () => { ...@@ -185,7 +179,7 @@ const sendVerifyCode = async () => {
} }
</script> </script>
<style> <style>
.regist-box{ .bind-box{
background-image: url('../../assets/img/regist.png'),linear-gradient(0deg, #E3ECFF, #FFFFFF); background-image: url('../../assets/img/regist.png'),linear-gradient(0deg, #E3ECFF, #FFFFFF);
background-size: 100% auto; background-size: 100% auto;
background-repeat: no-repeat; background-repeat: no-repeat;
......
...@@ -61,6 +61,9 @@ ...@@ -61,6 +61,9 @@
<span>还没有账号?</span> <span>还没有账号?</span>
<el-button link type="primary" class="q-mb-lg" @click="redicetToRegist">立即注册</el-button> <el-button link type="primary" class="q-mb-lg" @click="redicetToRegist">立即注册</el-button>
</div> </div>
<div class="text-info text-small row flex-center">
<img class="cursor-pointer" src="../../assets/img/wechatLogin.png" style="width:1.67vw;" alt="" @click="redicetToWechat">
</div>
</el-form> </el-form>
</template> </template>
<template v-if="multipleUsers && multipleUsers.length>0"> <template v-if="multipleUsers && multipleUsers.length>0">
...@@ -185,6 +188,9 @@ const userLoginHandler = async ()=>{ ...@@ -185,6 +188,9 @@ const userLoginHandler = async ()=>{
} }
} }
const redicetToWechat = () => {
location.href='/BindToWechat'
}
const forwardWorkspaceHandler = ()=>{ const forwardWorkspaceHandler = ()=>{
location.href='/space'; location.href='/space';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment