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

View File

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

View File

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

File diff suppressed because it is too large Load Diff