|
|
|
@ -136,7 +136,7 @@ import { UserToken } from "@/types/user";
|
|
|
|
import { getBrowserFingerprint, getStoredFingerprint } from "@/utils/fingerprint";
|
|
|
|
import { getBrowserFingerprint, getStoredFingerprint } from "@/utils/fingerprint";
|
|
|
|
import { usePermissStore } from "@/store/permiss";
|
|
|
|
import { usePermissStore } from "@/store/permiss";
|
|
|
|
import Cookies from 'js-cookie';
|
|
|
|
import Cookies from 'js-cookie';
|
|
|
|
import { getThirdPartyUUID, getThirdPartyLoginStatus, getThirdPartyLoginUrl, sendLoginCode, loginByCode, secondAuthLoginService } from "@/api/user";
|
|
|
|
import { getThirdPartyUUID, getThirdPartyLoginStatus, getThirdPartyLoginUrl, sendLoginCode, loginByCode, secondAuthLoginService,SetTokenCodeStatusService } from "@/api/user";
|
|
|
|
import { log, time } from "console";
|
|
|
|
import { log, time } from "console";
|
|
|
|
import { pa } from "element-plus/es/locale";
|
|
|
|
import { pa } from "element-plus/es/locale";
|
|
|
|
import { state } from "mermaid/dist/rendering-util/rendering-elements/shapes/state";
|
|
|
|
import { state } from "mermaid/dist/rendering-util/rendering-elements/shapes/state";
|
|
|
|
@ -192,6 +192,8 @@ const maxLoginRepeatRequest = 60; //最大请求次数
|
|
|
|
const currentLoginRequest = ref(0); //当前请求次数
|
|
|
|
const currentLoginRequest = ref(0); //当前请求次数
|
|
|
|
const timer = ref(null); //定时器
|
|
|
|
const timer = ref(null); //定时器
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const code = ref('');
|
|
|
|
|
|
|
|
|
|
|
|
const secondAuthLogin = async () => {
|
|
|
|
const secondAuthLogin = async () => {
|
|
|
|
if (!second_auth_method.value) {
|
|
|
|
if (!second_auth_method.value) {
|
|
|
|
ElMessage.error("请选择认证方式");
|
|
|
|
ElMessage.error("请选择认证方式");
|
|
|
|
@ -302,6 +304,18 @@ onMounted(async () => {
|
|
|
|
if (queryParams.site) {
|
|
|
|
if (queryParams.site) {
|
|
|
|
querySite.value = queryParams.site as string;
|
|
|
|
querySite.value = queryParams.site as string;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (queryParams.code){
|
|
|
|
|
|
|
|
code.value = queryParams.code as string;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const token = localStorage.getItem("token") || "";
|
|
|
|
|
|
|
|
if (token !== "") {
|
|
|
|
|
|
|
|
await getMyUserInfo(0);
|
|
|
|
|
|
|
|
if (code.value !== ''){
|
|
|
|
|
|
|
|
//设置token code状态为已使用
|
|
|
|
|
|
|
|
await SetTokenCodeStatusService(code.value, token);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const thirdLogin = async (type) => {
|
|
|
|
const thirdLogin = async (type) => {
|
|
|
|
@ -517,6 +531,10 @@ const onLogin = async () => {
|
|
|
|
let now = new Date();
|
|
|
|
let now = new Date();
|
|
|
|
localStorage.setItem("end_time", (now.setDate(now.getHours())).toString()); //过期时间
|
|
|
|
localStorage.setItem("end_time", (now.setDate(now.getHours())).toString()); //过期时间
|
|
|
|
await getMyUserInfo(userTokenInfo.user_id);
|
|
|
|
await getMyUserInfo(userTokenInfo.user_id);
|
|
|
|
|
|
|
|
if (code.value !== ''){
|
|
|
|
|
|
|
|
//设置token code状态为已使用
|
|
|
|
|
|
|
|
await SetTokenCodeStatusService(code.value, userTokenInfo.access_token);
|
|
|
|
|
|
|
|
}
|
|
|
|
//token.value= result.data;
|
|
|
|
//token.value= result.data;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|