Refactor code structure for improved readability and maintainability

This commit is contained in:
bighuixiang
2025-06-19 10:21:17 +08:00
parent 9b15d988f0
commit 505c79665b
4 changed files with 3768 additions and 3848 deletions

View File

@@ -8,19 +8,19 @@
<!-- v-show="loginType == 'username'" --> <!-- v-show="loginType == 'username'" -->
<div> <div>
<div class="login_form_content" :state="emailStap"> <div class="login_form_content" :state="emailStap">
<div v-show="emailStap === 1"> <div v-show="emailStap === 1">
<div class="login_form_title marign_top30"> <div class="login_form_title marign_top30">Enterprise</div>
Enterprise
</div>
<div class="generalModel_state"> <div class="generalModel_state">
<div class="generalModel_state_item" style="width: 100%; margin: 0;"> <div
class="generalModel_state_item"
style="width: 100%; margin: 0"
>
<a-select <a-select
placeholder="Select a school" placeholder="Select a school"
v-model:value="selectEnterprise" v-model:value="selectEnterprise"
:options="schoolList" :options="schoolList"
@change="schoolListChange" @change="schoolListChange"
style="width:100%" style="width: 100%"
show-search show-search
size="large" size="large"
:fieldNames="{ label: 'name', value: 'value' }" :fieldNames="{ label: 'name', value: 'value' }"
@@ -36,9 +36,7 @@
</a-select> </a-select>
</div> </div>
</div> </div>
<div class="login_form_title marign_top30"> <div class="login_form_title marign_top30">Email</div>
Email
</div>
<input <input
class="login_form_input" class="login_form_input"
placeholder="Enter your email address" placeholder="Enter your email address"
@@ -63,21 +61,16 @@
</div> </div>
</div> </div>
<!-- 邮箱登录 start --> <!-- 邮箱登录 start -->
<div <div
v-show="emailStap === 2" v-show="emailStap === 2"
class="login_form_email" class="login_form_email"
:class="{ active: emailStap === 2 }" :class="{ active: emailStap === 2 }"
> >
<div <div v-show="emailStap === 2" class="email_last_step">
v-show="emailStap === 2"
class="email_last_step"
>
<div class="email_last_step_block"> <div class="email_last_step_block">
<span class="email_last_step_content" <span class="email_last_step_content"
>Verify with one-time verification >Verify with one-time verification code</span
code</span
> >
<i <i
class="fi fi-br-cross email_last_step_block_icon" class="fi fi-br-cross email_last_step_block_icon"
@@ -86,34 +79,23 @@
</div> </div>
<div class="email_last_step_bottom"> <div class="email_last_step_bottom">
<div class="email_last_step_des"> <div class="email_last_step_des">
<div class="sent_email_content"> <div class="sent_email_content">Sent to {{ email }}</div>
Sent to {{ email }}
</div>
<div class="tip_content"> <div class="tip_content">
<span v-show="time" <span v-show="time">{{ time }}s</span>
>{{ time }}s</span <span v-show="!time" @click="emailNextStepFun()"
>
<span
v-show="!time"
@click="emailNextStepFun()"
>Resend</span >Resend</span
> >
</div> </div>
</div> </div>
<VerificationCodeInput <VerificationCodeInput
:ct="emailCode" :ct="emailCode"
@sendCaptcha=" @sendCaptcha="submitEmailLogin($event)"
submitEmailLogin($event)
"
></VerificationCodeInput> ></VerificationCodeInput>
<div class="email_last_step_des"> <div class="email_last_step_des">
<div <div class="sent_email_content email_tip_content">
class="sent_email_content email_tip_content" Please check the junk box if you haven't received
> verification code
Please check the junk box if you
haven't received verification
code
</div> </div>
</div> </div>
</div> </div>
@@ -123,15 +105,8 @@
<div class="login_form_title marign_top30"> <div class="login_form_title marign_top30">
<label :class="{ active: emailStap == 2 }"> <label :class="{ active: emailStap == 2 }">
<input <input :state="emailStap" type="checkbox" v-model="checked" />
:state="emailStap" <span>I agree to all Term, Privacy Policy and Fees</span>
type="checkbox"
v-model="checked"
/>
<span
>I agree to all Term, Privacy Policy and
Fees</span
>
</label> </label>
</div> </div>
<!-- <div class="thirdPartyLogin marign_top30"> <!-- <div class="thirdPartyLogin marign_top30">
@@ -165,7 +140,6 @@
</div> </div>
<!-- 邮箱登录 end --> <!-- 邮箱登录 end -->
</div> </div>
<!-- 忘记密码 start --> <!-- 忘记密码 start -->
@@ -175,9 +149,7 @@
@click="forgetPasswordLastStepFun()" @click="forgetPasswordLastStepFun()"
> >
<i class="fi fi-br-arrow-left"></i> <i class="fi fi-br-arrow-left"></i>
<span class="forget_password_content_title" <span class="forget_password_content_title">Retrieve password</span>
>Retrieve password</span
>
</div> </div>
<div v-show="frogetPasswordStep === 1"> <div v-show="frogetPasswordStep === 1">
<div class="forget_passored_form_content"> <div class="forget_passored_form_content">
@@ -205,9 +177,7 @@
</div> </div>
<div class="tip_content"> <div class="tip_content">
<span v-show="time">{{ time }}s</span> <span v-show="time">{{ time }}s</span>
<span <span v-show="!time" @click="forgetPasswordNextStepFun()"
v-show="!time"
@click="forgetPasswordNextStepFun()"
>Resend</span >Resend</span
> >
</div> </div>
@@ -245,7 +215,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, ref, onMounted, reactive,toRefs } from "vue"; import { defineComponent, ref, onMounted, reactive, toRefs } from "vue";
import { Https } from "@/tool/https"; import { Https } from "@/tool/https";
import { isEmail } from "@/tool/util"; import { isEmail } from "@/tool/util";
import { setCookie, WriteCookie } from "@/tool/cookie"; import { setCookie, WriteCookie } from "@/tool/cookie";
@@ -257,42 +227,47 @@ import phoneLogin from "@/component/LoginPage/phoneLogin.vue";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { setLang } from "@/tool/guide"; import { setLang } from "@/tool/guide";
const md5 = require("md5"); import md5 from "md5";
export default defineComponent({ export default defineComponent({
components: { components: {
VerificationCodeInput,googleLogin,weiXinLogin,phoneLogin VerificationCodeInput,
googleLogin,
weiXinLogin,
phoneLogin,
}, },
setup() { setup() {
let timer: any = 0; let timer: any = 0;
const { locale } = useI18n(); const { locale } = useI18n();
const store = useStore(); const store = useStore();
let loadingShow = ref(false) let loadingShow = ref(false);
const data = reactive({ const data = reactive({
selectEnterprise:'', selectEnterprise: "",
schoolList:[] as any, schoolList: [] as any,
}) });
const schoolListChange = (e:any)=>{ const schoolListChange = (e: any) => {};
} const filterOption = (e: any) => {
const filterOption = (e:any)=>{
let params = { let params = {
name:e, name: e,
type:'Enterprise' type: "Enterprise",
} };
Https.axiosPost(Https.httpUrls.organizationNameSearch,{},{params:params}).then((rv:any)=>{ Https.axiosPost(
data.schoolList = rv.map((item:any)=>{ Https.httpUrls.organizationNameSearch,
{},
{ params: params }
).then((rv: any) => {
data.schoolList = rv.map((item: any) => {
return { return {
label:item, label: item,
value:item, value: item,
} };
}) });
}) });
};
} const handleFocus = () => {
const handleFocus= ()=>{ if (data.schoolList.length == 0) {
if(data.schoolList.length == 0){ filterOption("");
filterOption('')
}
} }
};
return { return {
...toRefs(data), ...toRefs(data),
store, store,
@@ -300,7 +275,8 @@ export default defineComponent({
locale, locale,
loadingShow, loadingShow,
schoolListChange, schoolListChange,
filterOption,handleFocus filterOption,
handleFocus,
}; };
}, },
data() { data() {
@@ -312,8 +288,8 @@ export default defineComponent({
emailCode: ["", "", "", "", "", ""], //邮箱验证码 emailCode: ["", "", "", "", "", ""], //邮箱验证码
emailNextStep: true, emailNextStep: true,
username: "", username: "",
password: localStorage.getItem("loginPassword") || '', password: localStorage.getItem("loginPassword") || "",
email: localStorage.getItem("loginEmail") || '', //邮箱登录邮箱 email: localStorage.getItem("loginEmail") || "", //邮箱登录邮箱
frogetPasswordStep: 1, //忘记密码的步骤 frogetPasswordStep: 1, //忘记密码的步骤
forgetPasswordEmail: "", forgetPasswordEmail: "",
forgetEmailCode: ["", "", "", "", "", ""], //忘记密码的邮箱验证码 forgetEmailCode: ["", "", "", "", "", ""], //忘记密码的邮箱验证码
@@ -358,16 +334,14 @@ export default defineComponent({
email: this.email, email: this.email,
operationType: "LOGIN", operationType: "LOGIN",
}; };
Https.axiosPost(Https.httpUrls.accountSendEmail, data).then( Https.axiosPost(Https.httpUrls.accountSendEmail, data).then((rv: any) => {
(rv: any) => {
if (rv) { if (rv) {
this.emailStap = 2; this.emailStap = 2;
this.time = 60; this.time = 60;
this.emailCode = ["", "", "", "", "", ""]; this.emailCode = ["", "", "", "", "", ""];
this.createTimer(); this.createTimer();
} }
} });
);
}, },
//邮箱登录的上一步 //邮箱登录的上一步
@@ -390,15 +364,12 @@ export default defineComponent({
email: this.forgetPasswordEmail, email: this.forgetPasswordEmail,
operationType: "FORGET_PWD", operationType: "FORGET_PWD",
}; };
Https.axiosPost(Https.httpUrls.accountSendEmail, data).then( Https.axiosPost(Https.httpUrls.accountSendEmail, data).then((rv: any) => {
(rv: any) => {
if (rv) { if (rv) {
this.frogetPasswordStep = 2; this.frogetPasswordStep = 2;
(this.forgetEmailCode = ["", "", "", "", "", ""]), (this.forgetEmailCode = ["", "", "", "", "", ""]), this.createTimer();
this.createTimer();
} }
} });
);
}, },
//忘记密码的上一步 //忘记密码的上一步
forgetPasswordLastStepFun() { forgetPasswordLastStepFun() {
@@ -407,8 +378,7 @@ export default defineComponent({
} else { } else {
this.frogetPasswordStep = this.frogetPasswordStep - 1; this.frogetPasswordStep = this.frogetPasswordStep - 1;
this.forgetPasswordEmail = ""; this.forgetPasswordEmail = "";
(this.forgetEmailCode = ["", "", "", "", "", ""]), (this.forgetEmailCode = ["", "", "", "", "", ""]), this.clearTimer();
this.clearTimer();
} }
}, },
@@ -421,15 +391,13 @@ export default defineComponent({
password: "", password: "",
verifyEmail: true, verifyEmail: true,
}; };
Https.axiosPost(Https.httpUrls.accountResetPwd, data).then( Https.axiosPost(Https.httpUrls.accountResetPwd, data).then((rv: any) => {
(rv: any) => {
if (rv) { if (rv) {
this.forgetEmailValue = emailVerifyCode; this.forgetEmailValue = emailVerifyCode;
this.frogetPasswordStep = 3; this.frogetPasswordStep = 3;
this.clearTimer(); this.clearTimer();
} }
} });
);
}, },
//改变勾选是否是机器人 //改变勾选是否是机器人
@@ -444,9 +412,7 @@ export default defineComponent({
return; return;
} else { } else {
if (!this.password) { if (!this.password) {
message.info( message.info("Please enter your account number or password");
"Please enter your account number or password"
);
return; return;
} }
//输入邮箱 //输入邮箱
@@ -465,16 +431,14 @@ export default defineComponent({
} }
//判断是否同意隐私政策 //判断是否同意隐私政策
if (!this.checked) { if (!this.checked) {
message.info( message.info("Agree to all terms, privacy fees and policies");
"Agree to all terms, privacy fees and policies"
);
return; return;
} }
let data = { let data = {
password: md5(this.password + "abc"), password: md5(this.password + "abc"),
userName: 'a', userName: "a",
// userName: this.username, // userName: this.username,
organizationName:this.selectEnterprise, organizationName: this.selectEnterprise,
email: this.email, email: this.email,
operationType: "LOGIN", operationType: "LOGIN",
ip: "", ip: "",
@@ -484,7 +448,7 @@ export default defineComponent({
Https.axiosPost(Https.httpUrls.enterpriseLogin, data) Https.axiosPost(Https.httpUrls.enterpriseLogin, data)
.then((rv: any) => { .then((rv: any) => {
if (rv) { if (rv) {
this.clearTimer() this.clearTimer();
this.time = 60; this.time = 60;
this.emailStap = 2; this.emailStap = 2;
this.emailCode = ["", "", "", "", "", ""]; this.emailCode = ["", "", "", "", "", ""];
@@ -495,8 +459,7 @@ export default defineComponent({
localStorage.setItem("loginPassword", this.password); localStorage.setItem("loginPassword", this.password);
} }
}) })
.catch((res) => { .catch((res) => {});
});
setTimeout(() => { setTimeout(() => {
this.loginTime = true; this.loginTime = true;
}, 2000); }, 2000);
@@ -516,44 +479,44 @@ export default defineComponent({
emailVerifyCode: emailVerifyCode, emailVerifyCode: emailVerifyCode,
loginType: "EMAIL", loginType: "EMAIL",
userId: this.userId, userId: this.userId,
organizationName:this.selectEnterprise organizationName: this.selectEnterprise,
}; };
Https.axiosPost(Https.httpUrls.accountLogin, data) Https.axiosPost(Https.httpUrls.accountLogin, data)
.then((rv: any) => { .then((rv: any) => {
this.setSuccessLogin(rv) this.setSuccessLogin(rv);
}) })
.catch((res) => {}); .catch((res) => {});
}, },
isCheckAgreement(){ isCheckAgreement() {
message.info( message.info("Agree to all terms, privacy fees and policies");
"Agree to all terms, privacy fees and policies"
);
}, },
//微信登录 //微信登录
wechatLogin(value:any) { wechatLogin(value: any) {
let data = { let data = {
code : value.code, code: value.code,
type:2 type: 2,
} };
this.loadingShow = true this.loadingShow = true;
Https.axiosGet(Https.httpUrls.parseWeChatCode, {params:data}) Https.axiosGet(Https.httpUrls.parseWeChatCode, { params: data })
.then((rv: any) => { .then((rv: any) => {
this.loadingShow = false this.loadingShow = false;
this.setSuccessLogin(rv) this.setSuccessLogin(rv);
}) })
.catch((res) => {this.loadingShow = false}); .catch((res) => {
this.loadingShow = false;
});
}, },
//谷歌登录 //谷歌登录
googelLogin(value:any) { googelLogin(value: any) {
let data = {credential : value,type:2} let data = { credential: value, type: 2 };
Https.axiosGet(Https.httpUrls.parseGoogleCredential, {params:data}) Https.axiosGet(Https.httpUrls.parseGoogleCredential, { params: data })
.then((rv: any) => { .then((rv: any) => {
this.setSuccessLogin(rv) this.setSuccessLogin(rv);
}) })
.catch((res) => {}); .catch((res) => {});
}, },
//登陆成功设置参数 //登陆成功设置参数
setSuccessLogin(rv:any){ setSuccessLogin(rv: any) {
if (rv) { if (rv) {
if (rv.systemUser == 4) { if (rv.systemUser == 4) {
rv.systemUser = 1; rv.systemUser = 1;
@@ -568,11 +531,11 @@ export default defineComponent({
setCookie("isBeginner", isBeginner); setCookie("isBeginner", isBeginner);
setCookie("isBeginnerNum", 0); //从第一步开始,机器人开始的话就是从第二部开始 setCookie("isBeginnerNum", 0); //从第一步开始,机器人开始的话就是从第二部开始
setCookie("userInfo", JSON.stringify(rv)); setCookie("userInfo", JSON.stringify(rv));
let userid:any = { let userid: any = {
ueserId:rv.userId, ueserId: rv.userId,
systemUser:rv.systemUser, systemUser: rv.systemUser,
} };
if(rv.email)userid.email = rv.email if (rv.email) userid.email = rv.email;
this.store.commit("upUserDetail", userid); this.store.commit("upUserDetail", userid);
if (window.innerWidth < 768) { if (window.innerWidth < 768) {
@@ -583,13 +546,9 @@ export default defineComponent({
} else { } else {
this.turnToHomePage("/home"); this.turnToHomePage("/home");
} }
sessionStorage.setItem( sessionStorage.setItem("isTimeOne", JSON.stringify(false)); //是否需要公告 提示 弹窗
"isTimeOne",
JSON.stringify(false)
); //是否需要公告 提示 弹窗
let randomNum: any = let randomNum: any =
Math.floor(Math.random() * 9000000000000000) + Math.floor(Math.random() * 9000000000000000) + 1000000000000000;
1000000000000000;
sessionStorage.setItem("sessionId", randomNum); sessionStorage.setItem("sessionId", randomNum);
sessionStorage.setItem("record", JSON.stringify([])); sessionStorage.setItem("record", JSON.stringify([]));
} }
@@ -602,14 +561,12 @@ export default defineComponent({
password: md5(this.newPassword + "abc"), password: md5(this.newPassword + "abc"),
verifyEmail: false, verifyEmail: false,
}; };
Https.axiosPost(Https.httpUrls.accountResetPwd, data).then( Https.axiosPost(Https.httpUrls.accountResetPwd, data).then((rv: any) => {
(rv: any) => {
if (rv) { if (rv) {
message.success("Changing the password successfully"); message.success("Changing the password successfully");
this.changeIsLogin(1); this.changeIsLogin(1);
} }
} });
);
}, },
//创建定时器 //创建定时器
@@ -655,9 +612,9 @@ export default defineComponent({
// }, // },
}, },
mounted() { mounted() {
const data = this.$route.query const data = this.$route.query;
if(data?.state == 'weiXin'){ if (data?.state == "weiXin") {
this.wechatLogin(data) this.wechatLogin(data);
} }
}, },
}); });
@@ -729,15 +686,15 @@ export default defineComponent({
} }
} }
} }
.generalModel_state{ .generalModel_state {
>.generalModel_state_item{ > .generalModel_state_item {
:deep(.ant-select-selector){ :deep(.ant-select-selector) {
border: 0.1rem solid #dfdfdf; border: 0.1rem solid #dfdfdf;
border-radius: 2.5rem; border-radius: 2.5rem;
height: 5rem !important; height: 5rem !important;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
&:hover{ &:hover {
border: 0.1rem solid #000; border: 0.1rem solid #000;
} }
} }
@@ -778,8 +735,8 @@ export default defineComponent({
font-size: 1.4rem; font-size: 1.4rem;
box-sizing: border-box; box-sizing: border-box;
outline: none; outline: none;
transition: all .3s; transition: all 0.3s;
&:hover{ &:hover {
border: 0.1rem solid #000; border: 0.1rem solid #000;
} }
&::placeholder { &::placeholder {
@@ -832,9 +789,9 @@ export default defineComponent({
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
cursor: pointer; cursor: pointer;
transition: all .3s; transition: all 0.3s;
&:hover{ &:hover {
background: #3C3C3C; background: #3c3c3c;
} }
&[state="2"] { &[state="2"] {
cursor: not-allowed; cursor: not-allowed;
@@ -980,13 +937,13 @@ export default defineComponent({
.marign_top40 { .marign_top40 {
margin-top: 4rem; margin-top: 4rem;
} }
.thirdPartyLogin{ .thirdPartyLogin {
display: flex; display: flex;
// justify-content: flex-start; // justify-content: flex-start;
> div{ > div {
position: relative; position: relative;
margin-right: 1rem; margin-right: 1rem;
> .mask{ > .mask {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;

View File

@@ -4,7 +4,6 @@
<!-- 账号密码和邮箱登录 start--> <!-- 账号密码和邮箱登录 start-->
<div class="login_content" v-if="isLogin === 1"> <div class="login_content" v-if="isLogin === 1">
<div class="login_content_left"> <div class="login_content_left">
<!-- v-show="loginType == 'username'" --> <!-- v-show="loginType == 'username'" -->
<div> <div>
<div class="login_form_content" :state="emailStap"> <div class="login_form_content" :state="emailStap">
@@ -15,9 +14,7 @@
v-model="username" v-model="username"
/> --> /> -->
<div v-show="emailStap === 1"> <div v-show="emailStap === 1">
<div class="login_form_title marign_top30"> <div class="login_form_title marign_top30">Email</div>
Email
</div>
<input <input
class="login_form_input" class="login_form_input"
placeholder="Enter your email address" placeholder="Enter your email address"
@@ -42,21 +39,16 @@
</div> </div>
</div> </div>
<!-- 邮箱登录 start --> <!-- 邮箱登录 start -->
<div <div
v-show="emailStap === 2" v-show="emailStap === 2"
class="login_form_email" class="login_form_email"
:class="{ active: emailStap === 2 }" :class="{ active: emailStap === 2 }"
> >
<div <div v-show="emailStap === 2" class="email_last_step">
v-show="emailStap === 2"
class="email_last_step"
>
<div class="email_last_step_block"> <div class="email_last_step_block">
<span class="email_last_step_content" <span class="email_last_step_content"
>Verify with one-time verification >Verify with one-time verification code</span
code</span
> >
<i <i
class="fi fi-br-cross email_last_step_block_icon" class="fi fi-br-cross email_last_step_block_icon"
@@ -65,34 +57,23 @@
</div> </div>
<div class="email_last_step_bottom"> <div class="email_last_step_bottom">
<div class="email_last_step_des"> <div class="email_last_step_des">
<div class="sent_email_content"> <div class="sent_email_content">Sent to {{ email }}</div>
Sent to {{ email }}
</div>
<div class="tip_content"> <div class="tip_content">
<span v-show="time" <span v-show="time">{{ time }}s</span>
>{{ time }}s</span <span v-show="!time" @click="emailNextStepFun()"
>
<span
v-show="!time"
@click="emailNextStepFun()"
>Resend</span >Resend</span
> >
</div> </div>
</div> </div>
<VerificationCodeInput <VerificationCodeInput
:ct="emailCode" :ct="emailCode"
@sendCaptcha=" @sendCaptcha="submitEmailLogin($event)"
submitEmailLogin($event)
"
></VerificationCodeInput> ></VerificationCodeInput>
<div class="email_last_step_des"> <div class="email_last_step_des">
<div <div class="sent_email_content email_tip_content">
class="sent_email_content email_tip_content" Please check the junk box if you haven't received
> verification code
Please check the junk box if you
haven't received verification
code
</div> </div>
</div> </div>
</div> </div>
@@ -102,24 +83,25 @@
<div class="login_form_title marign_top30"> <div class="login_form_title marign_top30">
<label :class="{ active: emailStap == 2 }"> <label :class="{ active: emailStap == 2 }">
<input <input :state="emailStap" type="checkbox" v-model="checked" />
:state="emailStap" <span>I agree to all Term, Privacy Policy and Fees</span>
type="checkbox"
v-model="checked"
/>
<span
>I agree to all Term, Privacy Policy and
Fees</span
>
</label> </label>
</div> </div>
<div class="thirdPartyLogin marign_top30"> <div class="thirdPartyLogin marign_top30">
<div class="label"> <div class="label">
<div class="mask" v-show="!checked" @click="isCheckAgreement"></div> <div
class="mask"
v-show="!checked"
@click="isCheckAgreement"
></div>
<googleLogin @googelLogin="googelLogin"></googleLogin> <googleLogin @googelLogin="googelLogin"></googleLogin>
</div> </div>
<div class="label"> <div class="label">
<div class="mask" v-show="!checked" @click="isCheckAgreement"></div> <div
class="mask"
v-show="!checked"
@click="isCheckAgreement"
></div>
<weiXinLogin></weiXinLogin> <weiXinLogin></weiXinLogin>
</div> </div>
<!-- <phoneLogin></phoneLogin> --> <!-- <phoneLogin></phoneLogin> -->
@@ -133,10 +115,7 @@
</div> </div>
<div class="login_text"> <div class="login_text">
<div <div class="forget_password_text" @click="changeIsLogin(2)">
class="forget_password_text"
@click="changeIsLogin(2)"
>
Forgot your password Forgot your password
</div> </div>
</div> </div>
@@ -156,9 +135,7 @@
<!-- <span class="icon iconfont fi-br-arrow-left"></span <!-- <span class="icon iconfont fi-br-arrow-left"></span
> --> > -->
<i class="fi fi-br-arrow-left"></i> <i class="fi fi-br-arrow-left"></i>
<span class="forget_password_content_title" <span class="forget_password_content_title">Retrieve password</span>
>Retrieve password</span
>
</div> </div>
<div v-show="frogetPasswordStep === 1"> <div v-show="frogetPasswordStep === 1">
<div class="forget_passored_form_content"> <div class="forget_passored_form_content">
@@ -186,9 +163,7 @@
</div> </div>
<div class="tip_content"> <div class="tip_content">
<span v-show="time">{{ time }}s</span> <span v-show="time">{{ time }}s</span>
<span <span v-show="!time" @click="forgetPasswordNextStepFun()"
v-show="!time"
@click="forgetPasswordNextStepFun()"
>Resend</span >Resend</span
> >
</div> </div>
@@ -220,8 +195,6 @@
<!-- 忘记密码 end --> <!-- 忘记密码 end -->
</div> </div>
<!-- <div class="login_footer"> <!-- <div class="login_footer">
<div class="login_footer_item"> <div class="login_footer_item">
<div class="login_footer_item_text"> <div class="login_footer_item_text">
@@ -271,16 +244,19 @@ import phoneLogin from "@/component/LoginPage/phoneLogin.vue";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { setLang } from "@/tool/guide"; import { setLang } from "@/tool/guide";
const md5 = require("md5"); import md5 from "md5";
export default defineComponent({ export default defineComponent({
components: { components: {
VerificationCodeInput,googleLogin,weiXinLogin,phoneLogin VerificationCodeInput,
googleLogin,
weiXinLogin,
phoneLogin,
}, },
setup() { setup() {
let timer: any = 0; let timer: any = 0;
const { locale } = useI18n(); const { locale } = useI18n();
const store = useStore(); const store = useStore();
let loadingShow = ref(false) let loadingShow = ref(false);
return { return {
store, store,
timer, timer,
@@ -297,8 +273,8 @@ export default defineComponent({
emailCode: ["", "", "", "", "", ""], //邮箱验证码 emailCode: ["", "", "", "", "", ""], //邮箱验证码
emailNextStep: true, emailNextStep: true,
username: "", username: "",
password: localStorage.getItem("loginPassword") || '', password: localStorage.getItem("loginPassword") || "",
email: localStorage.getItem("loginEmail") || '', //邮箱登录邮箱 email: localStorage.getItem("loginEmail") || "", //邮箱登录邮箱
frogetPasswordStep: 1, //忘记密码的步骤 frogetPasswordStep: 1, //忘记密码的步骤
forgetPasswordEmail: "", forgetPasswordEmail: "",
forgetEmailCode: ["", "", "", "", "", ""], //忘记密码的邮箱验证码 forgetEmailCode: ["", "", "", "", "", ""], //忘记密码的邮箱验证码
@@ -343,16 +319,14 @@ export default defineComponent({
email: this.email, email: this.email,
operationType: "LOGIN", operationType: "LOGIN",
}; };
Https.axiosPost(Https.httpUrls.accountSendEmail, data).then( Https.axiosPost(Https.httpUrls.accountSendEmail, data).then((rv: any) => {
(rv: any) => {
if (rv) { if (rv) {
this.emailStap = 2; this.emailStap = 2;
this.time = 60; this.time = 60;
this.emailCode = ["", "", "", "", "", ""]; this.emailCode = ["", "", "", "", "", ""];
this.createTimer(); this.createTimer();
} }
} });
);
}, },
//邮箱登录的上一步 //邮箱登录的上一步
@@ -375,15 +349,12 @@ export default defineComponent({
email: this.forgetPasswordEmail, email: this.forgetPasswordEmail,
operationType: "FORGET_PWD", operationType: "FORGET_PWD",
}; };
Https.axiosPost(Https.httpUrls.accountSendEmail, data).then( Https.axiosPost(Https.httpUrls.accountSendEmail, data).then((rv: any) => {
(rv: any) => {
if (rv) { if (rv) {
this.frogetPasswordStep = 2; this.frogetPasswordStep = 2;
(this.forgetEmailCode = ["", "", "", "", "", ""]), (this.forgetEmailCode = ["", "", "", "", "", ""]), this.createTimer();
this.createTimer();
} }
} });
);
}, },
//忘记密码的上一步 //忘记密码的上一步
forgetPasswordLastStepFun() { forgetPasswordLastStepFun() {
@@ -392,8 +363,7 @@ export default defineComponent({
} else { } else {
this.frogetPasswordStep = this.frogetPasswordStep - 1; this.frogetPasswordStep = this.frogetPasswordStep - 1;
this.forgetPasswordEmail = ""; this.forgetPasswordEmail = "";
(this.forgetEmailCode = ["", "", "", "", "", ""]), (this.forgetEmailCode = ["", "", "", "", "", ""]), this.clearTimer();
this.clearTimer();
} }
}, },
@@ -406,15 +376,13 @@ export default defineComponent({
password: "", password: "",
verifyEmail: true, verifyEmail: true,
}; };
Https.axiosPost(Https.httpUrls.accountResetPwd, data).then( Https.axiosPost(Https.httpUrls.accountResetPwd, data).then((rv: any) => {
(rv: any) => {
if (rv) { if (rv) {
this.forgetEmailValue = emailVerifyCode; this.forgetEmailValue = emailVerifyCode;
this.frogetPasswordStep = 3; this.frogetPasswordStep = 3;
this.clearTimer(); this.clearTimer();
} }
} });
);
}, },
//改变勾选是否是机器人 //改变勾选是否是机器人
@@ -429,9 +397,7 @@ export default defineComponent({
return; return;
} else { } else {
if (!this.password) { if (!this.password) {
message.info( message.info("Please enter your account number or password");
"Please enter your account number or password"
);
return; return;
} }
//输入邮箱 //输入邮箱
@@ -446,14 +412,12 @@ export default defineComponent({
} }
//判断是否同意隐私政策 //判断是否同意隐私政策
if (!this.checked) { if (!this.checked) {
message.info( message.info("Agree to all terms, privacy fees and policies");
"Agree to all terms, privacy fees and policies"
);
return; return;
} }
let data = { let data = {
password: md5(this.password + "abc"), password: md5(this.password + "abc"),
userName: 'a', userName: "a",
// userName: this.username, // userName: this.username,
email: this.email, email: this.email,
operationType: "LOGIN", operationType: "LOGIN",
@@ -469,7 +433,7 @@ export default defineComponent({
// this.loginType = 'email' // this.loginType = 'email'
// } // }
if (rv) { if (rv) {
this.clearTimer() this.clearTimer();
this.time = 60; this.time = 60;
this.emailStap = 2; this.emailStap = 2;
this.emailCode = ["", "", "", "", "", ""]; this.emailCode = ["", "", "", "", "", ""];
@@ -482,8 +446,7 @@ export default defineComponent({
localStorage.setItem("loginPassword", this.password); localStorage.setItem("loginPassword", this.password);
} }
}) })
.catch((res) => { .catch((res) => {});
});
setTimeout(() => { setTimeout(() => {
this.loginTime = true; this.loginTime = true;
}, 2000); }, 2000);
@@ -506,40 +469,40 @@ export default defineComponent({
}; };
Https.axiosPost(Https.httpUrls.accountLogin, data) Https.axiosPost(Https.httpUrls.accountLogin, data)
.then((rv: any) => { .then((rv: any) => {
this.setSuccessLogin(rv) this.setSuccessLogin(rv);
}) })
.catch((res) => {}); .catch((res) => {});
}, },
isCheckAgreement(){ isCheckAgreement() {
message.info( message.info("Agree to all terms, privacy fees and policies");
"Agree to all terms, privacy fees and policies"
);
}, },
//微信登录 //微信登录
wechatLogin(value:any) { wechatLogin(value: any) {
let data = { let data = {
code : value.code, code: value.code,
type:2 type: 2,
} };
this.loadingShow = true this.loadingShow = true;
Https.axiosGet(Https.httpUrls.parseWeChatCode, {params:data}) Https.axiosGet(Https.httpUrls.parseWeChatCode, { params: data })
.then((rv: any) => { .then((rv: any) => {
this.loadingShow = false this.loadingShow = false;
this.setSuccessLogin(rv) this.setSuccessLogin(rv);
}) })
.catch((res) => {this.loadingShow = false}); .catch((res) => {
this.loadingShow = false;
});
}, },
//谷歌登录 //谷歌登录
googelLogin(value:any) { googelLogin(value: any) {
let data = {credential : value,type:2} let data = { credential: value, type: 2 };
Https.axiosGet(Https.httpUrls.parseGoogleCredential, {params:data}) Https.axiosGet(Https.httpUrls.parseGoogleCredential, { params: data })
.then((rv: any) => { .then((rv: any) => {
this.setSuccessLogin(rv) this.setSuccessLogin(rv);
}) })
.catch((res) => {}); .catch((res) => {});
}, },
//登陆成功设置参数 //登陆成功设置参数
setSuccessLogin(rv:any){ setSuccessLogin(rv: any) {
if (rv) { if (rv) {
if (rv.systemUser == 4) { if (rv.systemUser == 4) {
rv.systemUser = 1; rv.systemUser = 1;
@@ -554,11 +517,11 @@ export default defineComponent({
setCookie("isBeginner", isBeginner); setCookie("isBeginner", isBeginner);
setCookie("isBeginnerNum", 0); //从第一步开始,机器人开始的话就是从第二部开始 setCookie("isBeginnerNum", 0); //从第一步开始,机器人开始的话就是从第二部开始
setCookie("userInfo", JSON.stringify(rv)); setCookie("userInfo", JSON.stringify(rv));
let userid:any = { let userid: any = {
ueserId:rv.userId, ueserId: rv.userId,
systemUser:rv.systemUser, systemUser: rv.systemUser,
} };
if(rv.email)userid.email = rv.email if (rv.email) userid.email = rv.email;
this.store.commit("upUserDetail", userid); this.store.commit("upUserDetail", userid);
if (window.innerWidth < 768) { if (window.innerWidth < 768) {
@@ -569,13 +532,9 @@ export default defineComponent({
} else { } else {
this.turnToHomePage("/home"); this.turnToHomePage("/home");
} }
sessionStorage.setItem( sessionStorage.setItem("isTimeOne", JSON.stringify(false)); //是否需要公告 提示 弹窗
"isTimeOne",
JSON.stringify(false)
); //是否需要公告 提示 弹窗
let randomNum: any = let randomNum: any =
Math.floor(Math.random() * 9000000000000000) + Math.floor(Math.random() * 9000000000000000) + 1000000000000000;
1000000000000000;
sessionStorage.setItem("sessionId", randomNum); sessionStorage.setItem("sessionId", randomNum);
sessionStorage.setItem("record", JSON.stringify([])); sessionStorage.setItem("record", JSON.stringify([]));
} }
@@ -588,14 +547,12 @@ export default defineComponent({
password: md5(this.newPassword + "abc"), password: md5(this.newPassword + "abc"),
verifyEmail: false, verifyEmail: false,
}; };
Https.axiosPost(Https.httpUrls.accountResetPwd, data).then( Https.axiosPost(Https.httpUrls.accountResetPwd, data).then((rv: any) => {
(rv: any) => {
if (rv) { if (rv) {
message.success("Changing the password successfully"); message.success("Changing the password successfully");
this.changeIsLogin(1); this.changeIsLogin(1);
} }
} });
);
}, },
//创建定时器 //创建定时器
@@ -641,9 +598,9 @@ export default defineComponent({
// }, // },
}, },
mounted() { mounted() {
const data = this.$route.query const data = this.$route.query;
if(data?.state == 'weiXin'){ if (data?.state == "weiXin") {
this.wechatLogin(data) this.wechatLogin(data);
} }
}, },
}); });
@@ -749,8 +706,8 @@ export default defineComponent({
font-size: 1.4rem; font-size: 1.4rem;
box-sizing: border-box; box-sizing: border-box;
outline: none; outline: none;
transition: all .3s; transition: all 0.3s;
&:hover{ &:hover {
border: 0.1rem solid #000; border: 0.1rem solid #000;
} }
&::placeholder { &::placeholder {
@@ -803,9 +760,9 @@ export default defineComponent({
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
cursor: pointer; cursor: pointer;
transition: all .3s; transition: all 0.3s;
&:hover{ &:hover {
background: #3C3C3C; background: #3c3c3c;
} }
&[state="2"] { &[state="2"] {
cursor: not-allowed; cursor: not-allowed;
@@ -951,13 +908,13 @@ export default defineComponent({
.marign_top40 { .marign_top40 {
margin-top: 4rem; margin-top: 4rem;
} }
.thirdPartyLogin{ .thirdPartyLogin {
display: flex; display: flex;
// justify-content: flex-start; // justify-content: flex-start;
> div{ > div {
position: relative; position: relative;
margin-right: 1rem; margin-right: 1rem;
> .mask{ > .mask {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;

View File

@@ -8,19 +8,19 @@
<!-- v-show="loginType == 'username'" --> <!-- v-show="loginType == 'username'" -->
<div> <div>
<div class="login_form_content" :state="emailStap"> <div class="login_form_content" :state="emailStap">
<div v-show="emailStap === 1"> <div v-show="emailStap === 1">
<div class="login_form_title marign_top30"> <div class="login_form_title marign_top30">School</div>
School
</div>
<div class="generalModel_state"> <div class="generalModel_state">
<div class="generalModel_state_item" style="width: 100%; margin: 0;"> <div
class="generalModel_state_item"
style="width: 100%; margin: 0"
>
<a-select <a-select
placeholder="Select a school" placeholder="Select a school"
v-model:value="selectSchool" v-model:value="selectSchool"
:options="schoolList" :options="schoolList"
@change="schoolListChange" @change="schoolListChange"
style="width:100%" style="width: 100%"
show-search show-search
size="large" size="large"
:fieldNames="{ label: 'name', value: 'value' }" :fieldNames="{ label: 'name', value: 'value' }"
@@ -36,9 +36,7 @@
</a-select> </a-select>
</div> </div>
</div> </div>
<div class="login_form_title marign_top30"> <div class="login_form_title marign_top30">Email</div>
Email
</div>
<input <input
class="login_form_input" class="login_form_input"
placeholder="Enter your email address" placeholder="Enter your email address"
@@ -63,21 +61,16 @@
</div> </div>
</div> </div>
<!-- 邮箱登录 start --> <!-- 邮箱登录 start -->
<div <div
v-show="emailStap === 2" v-show="emailStap === 2"
class="login_form_email" class="login_form_email"
:class="{ active: emailStap === 2 }" :class="{ active: emailStap === 2 }"
> >
<div <div v-show="emailStap === 2" class="email_last_step">
v-show="emailStap === 2"
class="email_last_step"
>
<div class="email_last_step_block"> <div class="email_last_step_block">
<span class="email_last_step_content" <span class="email_last_step_content"
>Verify with one-time verification >Verify with one-time verification code</span
code</span
> >
<i <i
class="fi fi-br-cross email_last_step_block_icon" class="fi fi-br-cross email_last_step_block_icon"
@@ -86,34 +79,23 @@
</div> </div>
<div class="email_last_step_bottom"> <div class="email_last_step_bottom">
<div class="email_last_step_des"> <div class="email_last_step_des">
<div class="sent_email_content"> <div class="sent_email_content">Sent to {{ email }}</div>
Sent to {{ email }}
</div>
<div class="tip_content"> <div class="tip_content">
<span v-show="time" <span v-show="time">{{ time }}s</span>
>{{ time }}s</span <span v-show="!time" @click="emailNextStepFun()"
>
<span
v-show="!time"
@click="emailNextStepFun()"
>Resend</span >Resend</span
> >
</div> </div>
</div> </div>
<VerificationCodeInput <VerificationCodeInput
:ct="emailCode" :ct="emailCode"
@sendCaptcha=" @sendCaptcha="submitEmailLogin($event)"
submitEmailLogin($event)
"
></VerificationCodeInput> ></VerificationCodeInput>
<div class="email_last_step_des"> <div class="email_last_step_des">
<div <div class="sent_email_content email_tip_content">
class="sent_email_content email_tip_content" Please check the junk box if you haven't received
> verification code
Please check the junk box if you
haven't received verification
code
</div> </div>
</div> </div>
</div> </div>
@@ -123,15 +105,8 @@
<div class="login_form_title marign_top30"> <div class="login_form_title marign_top30">
<label :class="{ active: emailStap == 2 }"> <label :class="{ active: emailStap == 2 }">
<input <input :state="emailStap" type="checkbox" v-model="checked" />
:state="emailStap" <span>I agree to all Term, Privacy Policy and Fees</span>
type="checkbox"
v-model="checked"
/>
<span
>I agree to all Term, Privacy Policy and
Fees</span
>
</label> </label>
</div> </div>
<!-- <div class="thirdPartyLogin marign_top30"> <!-- <div class="thirdPartyLogin marign_top30">
@@ -174,9 +149,7 @@
@click="forgetPasswordLastStepFun()" @click="forgetPasswordLastStepFun()"
> >
<i class="fi fi-br-arrow-left"></i> <i class="fi fi-br-arrow-left"></i>
<span class="forget_password_content_title" <span class="forget_password_content_title">Retrieve password</span>
>Retrieve password</span
>
</div> </div>
<div v-show="frogetPasswordStep === 1"> <div v-show="frogetPasswordStep === 1">
<div class="forget_passored_form_content"> <div class="forget_passored_form_content">
@@ -204,9 +177,7 @@
</div> </div>
<div class="tip_content"> <div class="tip_content">
<span v-show="time">{{ time }}s</span> <span v-show="time">{{ time }}s</span>
<span <span v-show="!time" @click="forgetPasswordNextStepFun()"
v-show="!time"
@click="forgetPasswordNextStepFun()"
>Resend</span >Resend</span
> >
</div> </div>
@@ -244,7 +215,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, ref, onMounted, reactive,toRefs } from "vue"; import { defineComponent, ref, onMounted, reactive, toRefs } from "vue";
import { Https } from "@/tool/https"; import { Https } from "@/tool/https";
import { isEmail } from "@/tool/util"; import { isEmail } from "@/tool/util";
import { setCookie, WriteCookie } from "@/tool/cookie"; import { setCookie, WriteCookie } from "@/tool/cookie";
@@ -256,42 +227,47 @@ import phoneLogin from "@/component/LoginPage/phoneLogin.vue";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { setLang } from "@/tool/guide"; import { setLang } from "@/tool/guide";
const md5 = require("md5"); import md5 from "md5";
export default defineComponent({ export default defineComponent({
components: { components: {
VerificationCodeInput,googleLogin,weiXinLogin,phoneLogin VerificationCodeInput,
googleLogin,
weiXinLogin,
phoneLogin,
}, },
setup() { setup() {
let timer: any = 0; let timer: any = 0;
const { locale } = useI18n(); const { locale } = useI18n();
const store = useStore(); const store = useStore();
let loadingShow = ref(false) let loadingShow = ref(false);
const data = reactive({ const data = reactive({
selectSchool:'', selectSchool: "",
schoolList:[] as any, schoolList: [] as any,
}) });
const schoolListChange = (e:any)=>{ const schoolListChange = (e: any) => {};
} const filterOption = (e: any) => {
const filterOption = (e:any)=>{
let params = { let params = {
name:e, name: e,
type:'School' type: "School",
} };
Https.axiosPost(Https.httpUrls.organizationNameSearch,{},{params:params}).then((rv:any)=>{ Https.axiosPost(
data.schoolList = rv.map((item:any)=>{ Https.httpUrls.organizationNameSearch,
{},
{ params: params }
).then((rv: any) => {
data.schoolList = rv.map((item: any) => {
return { return {
label:item, label: item,
value:item, value: item,
} };
}) });
}) });
};
} const handleFocus = () => {
const handleFocus= ()=>{ if (data.schoolList.length == 0) {
if(data.schoolList.length == 0){ filterOption("");
filterOption('')
}
} }
};
return { return {
...toRefs(data), ...toRefs(data),
store, store,
@@ -299,7 +275,8 @@ export default defineComponent({
locale, locale,
loadingShow, loadingShow,
schoolListChange, schoolListChange,
filterOption,handleFocus filterOption,
handleFocus,
}; };
}, },
data() { data() {
@@ -311,8 +288,8 @@ export default defineComponent({
emailCode: ["", "", "", "", "", ""], //邮箱验证码 emailCode: ["", "", "", "", "", ""], //邮箱验证码
emailNextStep: true, emailNextStep: true,
username: "", username: "",
password: localStorage.getItem("loginPassword") || '', password: localStorage.getItem("loginPassword") || "",
email: localStorage.getItem("loginEmail") || '', //邮箱登录邮箱 email: localStorage.getItem("loginEmail") || "", //邮箱登录邮箱
frogetPasswordStep: 1, //忘记密码的步骤 frogetPasswordStep: 1, //忘记密码的步骤
forgetPasswordEmail: "", forgetPasswordEmail: "",
forgetEmailCode: ["", "", "", "", "", ""], //忘记密码的邮箱验证码 forgetEmailCode: ["", "", "", "", "", ""], //忘记密码的邮箱验证码
@@ -357,16 +334,14 @@ export default defineComponent({
email: this.email, email: this.email,
operationType: "LOGIN", operationType: "LOGIN",
}; };
Https.axiosPost(Https.httpUrls.accountSendEmail, data).then( Https.axiosPost(Https.httpUrls.accountSendEmail, data).then((rv: any) => {
(rv: any) => {
if (rv) { if (rv) {
this.emailStap = 2; this.emailStap = 2;
this.time = 60; this.time = 60;
this.emailCode = ["", "", "", "", "", ""]; this.emailCode = ["", "", "", "", "", ""];
this.createTimer(); this.createTimer();
} }
} });
);
}, },
//邮箱登录的上一步 //邮箱登录的上一步
@@ -389,15 +364,12 @@ export default defineComponent({
email: this.forgetPasswordEmail, email: this.forgetPasswordEmail,
operationType: "FORGET_PWD", operationType: "FORGET_PWD",
}; };
Https.axiosPost(Https.httpUrls.accountSendEmail, data).then( Https.axiosPost(Https.httpUrls.accountSendEmail, data).then((rv: any) => {
(rv: any) => {
if (rv) { if (rv) {
this.frogetPasswordStep = 2; this.frogetPasswordStep = 2;
(this.forgetEmailCode = ["", "", "", "", "", ""]), (this.forgetEmailCode = ["", "", "", "", "", ""]), this.createTimer();
this.createTimer();
} }
} });
);
}, },
//忘记密码的上一步 //忘记密码的上一步
forgetPasswordLastStepFun() { forgetPasswordLastStepFun() {
@@ -406,8 +378,7 @@ export default defineComponent({
} else { } else {
this.frogetPasswordStep = this.frogetPasswordStep - 1; this.frogetPasswordStep = this.frogetPasswordStep - 1;
this.forgetPasswordEmail = ""; this.forgetPasswordEmail = "";
(this.forgetEmailCode = ["", "", "", "", "", ""]), (this.forgetEmailCode = ["", "", "", "", "", ""]), this.clearTimer();
this.clearTimer();
} }
}, },
@@ -420,15 +391,13 @@ export default defineComponent({
password: "", password: "",
verifyEmail: true, verifyEmail: true,
}; };
Https.axiosPost(Https.httpUrls.accountResetPwd, data).then( Https.axiosPost(Https.httpUrls.accountResetPwd, data).then((rv: any) => {
(rv: any) => {
if (rv) { if (rv) {
this.forgetEmailValue = emailVerifyCode; this.forgetEmailValue = emailVerifyCode;
this.frogetPasswordStep = 3; this.frogetPasswordStep = 3;
this.clearTimer(); this.clearTimer();
} }
} });
);
}, },
//改变勾选是否是机器人 //改变勾选是否是机器人
@@ -443,9 +412,7 @@ export default defineComponent({
return; return;
} else { } else {
if (!this.password) { if (!this.password) {
message.info( message.info("Please enter your account number or password");
"Please enter your account number or password"
);
return; return;
} }
//输入邮箱 //输入邮箱
@@ -464,16 +431,14 @@ export default defineComponent({
} }
//判断是否同意隐私政策 //判断是否同意隐私政策
if (!this.checked) { if (!this.checked) {
message.info( message.info("Agree to all terms, privacy fees and policies");
"Agree to all terms, privacy fees and policies"
);
return; return;
} }
let data = { let data = {
password: md5(this.password + "abc"), password: md5(this.password + "abc"),
userName: 'a', userName: "a",
// userName: this.username, // userName: this.username,
organizationName:this.selectSchool, organizationName: this.selectSchool,
email: this.email, email: this.email,
operationType: "LOGIN", operationType: "LOGIN",
ip: "", ip: "",
@@ -484,7 +449,7 @@ export default defineComponent({
Https.axiosPost(Https.httpUrls.schoolLogin, data) Https.axiosPost(Https.httpUrls.schoolLogin, data)
.then((rv: any) => { .then((rv: any) => {
if (rv) { if (rv) {
this.clearTimer() this.clearTimer();
this.time = 60; this.time = 60;
this.emailStap = 2; this.emailStap = 2;
this.emailCode = ["", "", "", "", "", ""]; this.emailCode = ["", "", "", "", "", ""];
@@ -517,44 +482,44 @@ export default defineComponent({
emailVerifyCode: emailVerifyCode, emailVerifyCode: emailVerifyCode,
loginType: "EMAIL", loginType: "EMAIL",
userId: this.userId, userId: this.userId,
organizationName:this.selectSchool organizationName: this.selectSchool,
}; };
Https.axiosPost(Https.httpUrls.accountLogin, data) Https.axiosPost(Https.httpUrls.accountLogin, data)
.then((rv: any) => { .then((rv: any) => {
this.setSuccessLogin(rv) this.setSuccessLogin(rv);
}) })
.catch((res) => {}); .catch((res) => {});
}, },
isCheckAgreement(){ isCheckAgreement() {
message.info( message.info("Agree to all terms, privacy fees and policies");
"Agree to all terms, privacy fees and policies"
);
}, },
//微信登录 //微信登录
wechatLogin(value:any) { wechatLogin(value: any) {
let data = { let data = {
code : value.code, code: value.code,
type:2 type: 2,
} };
this.loadingShow = true this.loadingShow = true;
Https.axiosGet(Https.httpUrls.parseWeChatCode, {params:data}) Https.axiosGet(Https.httpUrls.parseWeChatCode, { params: data })
.then((rv: any) => { .then((rv: any) => {
this.loadingShow = false this.loadingShow = false;
this.setSuccessLogin(rv) this.setSuccessLogin(rv);
}) })
.catch((res) => {this.loadingShow = false}); .catch((res) => {
this.loadingShow = false;
});
}, },
//谷歌登录 //谷歌登录
googelLogin(value:any) { googelLogin(value: any) {
let data = {credential : value,type:2} let data = { credential: value, type: 2 };
Https.axiosGet(Https.httpUrls.parseGoogleCredential, {params:data}) Https.axiosGet(Https.httpUrls.parseGoogleCredential, { params: data })
.then((rv: any) => { .then((rv: any) => {
this.setSuccessLogin(rv) this.setSuccessLogin(rv);
}) })
.catch((res) => {}); .catch((res) => {});
}, },
//登陆成功设置参数 //登陆成功设置参数
setSuccessLogin(rv:any){ setSuccessLogin(rv: any) {
if (rv) { if (rv) {
if (rv.systemUser == 4) { if (rv.systemUser == 4) {
rv.systemUser = 1; rv.systemUser = 1;
@@ -569,11 +534,11 @@ export default defineComponent({
setCookie("isBeginner", isBeginner); setCookie("isBeginner", isBeginner);
setCookie("isBeginnerNum", 0); //从第一步开始,机器人开始的话就是从第二部开始 setCookie("isBeginnerNum", 0); //从第一步开始,机器人开始的话就是从第二部开始
setCookie("userInfo", JSON.stringify(rv)); setCookie("userInfo", JSON.stringify(rv));
let userid:any = { let userid: any = {
ueserId:rv.userId, ueserId: rv.userId,
systemUser:rv.systemUser, systemUser: rv.systemUser,
} };
if(rv.email)userid.email = rv.email if (rv.email) userid.email = rv.email;
this.store.commit("upUserDetail", userid); this.store.commit("upUserDetail", userid);
if (window.innerWidth < 768) { if (window.innerWidth < 768) {
@@ -584,13 +549,9 @@ export default defineComponent({
} else { } else {
this.turnToHomePage("/home"); this.turnToHomePage("/home");
} }
sessionStorage.setItem( sessionStorage.setItem("isTimeOne", JSON.stringify(false)); //是否需要公告 提示 弹窗
"isTimeOne",
JSON.stringify(false)
); //是否需要公告 提示 弹窗
let randomNum: any = let randomNum: any =
Math.floor(Math.random() * 9000000000000000) + Math.floor(Math.random() * 9000000000000000) + 1000000000000000;
1000000000000000;
sessionStorage.setItem("sessionId", randomNum); sessionStorage.setItem("sessionId", randomNum);
sessionStorage.setItem("record", JSON.stringify([])); sessionStorage.setItem("record", JSON.stringify([]));
} }
@@ -603,14 +564,12 @@ export default defineComponent({
password: md5(this.newPassword + "abc"), password: md5(this.newPassword + "abc"),
verifyEmail: false, verifyEmail: false,
}; };
Https.axiosPost(Https.httpUrls.accountResetPwd, data).then( Https.axiosPost(Https.httpUrls.accountResetPwd, data).then((rv: any) => {
(rv: any) => {
if (rv) { if (rv) {
message.success("Changing the password successfully"); message.success("Changing the password successfully");
this.changeIsLogin(1); this.changeIsLogin(1);
} }
} });
);
}, },
//创建定时器 //创建定时器
@@ -656,9 +615,9 @@ export default defineComponent({
// }, // },
}, },
mounted() { mounted() {
const data = this.$route.query const data = this.$route.query;
if(data?.state == 'weiXin'){ if (data?.state == "weiXin") {
this.wechatLogin(data) this.wechatLogin(data);
} }
}, },
}); });
@@ -730,15 +689,15 @@ export default defineComponent({
} }
} }
} }
.generalModel_state{ .generalModel_state {
>.generalModel_state_item{ > .generalModel_state_item {
:deep(.ant-select-selector){ :deep(.ant-select-selector) {
border: 0.1rem solid #dfdfdf; border: 0.1rem solid #dfdfdf;
border-radius: 2.5rem; border-radius: 2.5rem;
height: 5rem !important; height: 5rem !important;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
&:hover{ &:hover {
border: 0.1rem solid #000; border: 0.1rem solid #000;
} }
} }
@@ -779,8 +738,8 @@ export default defineComponent({
font-size: 1.4rem; font-size: 1.4rem;
box-sizing: border-box; box-sizing: border-box;
outline: none; outline: none;
transition: all .3s; transition: all 0.3s;
&:hover{ &:hover {
border: 0.1rem solid #000; border: 0.1rem solid #000;
} }
&::placeholder { &::placeholder {
@@ -833,9 +792,9 @@ export default defineComponent({
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
cursor: pointer; cursor: pointer;
transition: all .3s; transition: all 0.3s;
&:hover{ &:hover {
background: #3C3C3C; background: #3c3c3c;
} }
&[state="2"] { &[state="2"] {
cursor: not-allowed; cursor: not-allowed;
@@ -981,13 +940,13 @@ export default defineComponent({
.marign_top40 { .marign_top40 {
margin-top: 4rem; margin-top: 4rem;
} }
.thirdPartyLogin{ .thirdPartyLogin {
display: flex; display: flex;
// justify-content: flex-start; // justify-content: flex-start;
> div{ > div {
position: relative; position: relative;
margin-right: 1rem; margin-right: 1rem;
> .mask{ > .mask {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;

File diff suppressed because it is too large Load Diff