|
@@ -2,23 +2,26 @@
|
|
import { DOMAIN } from "@/constants/constants";
|
|
import { DOMAIN } from "@/constants/constants";
|
|
import { httpApp } from "@/plugins/axiosApp";
|
|
import { httpApp } from "@/plugins/axiosApp";
|
|
import { store } from "@/store/store";
|
|
import { store } from "@/store/store";
|
|
-import { onMounted, onUnmounted } from "vue";
|
|
|
|
|
|
+import { onUnmounted } from "vue";
|
|
import { showLogout } from "@/utils/utils";
|
|
import { showLogout } from "@/utils/utils";
|
|
|
|
|
|
|
|
+defineProps<{ modelValue: boolean }>();
|
|
|
|
+const emit = defineEmits<{ (e: "update:modelValue", value: boolean): void }>();
|
|
|
|
+
|
|
let phoneModal = $ref(false);
|
|
let phoneModal = $ref(false);
|
|
let code = $ref("");
|
|
let code = $ref("");
|
|
let interval = $ref(-1);
|
|
let interval = $ref(-1);
|
|
let remainTime = $ref(0);
|
|
let remainTime = $ref(0);
|
|
let btnText = "发送验证码";
|
|
let btnText = "发送验证码";
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
- if (
|
|
|
|
- ["cugr.ecs.qmth.com.cn", "test.cugr.qmth.com.cn"].includes(DOMAIN) &&
|
|
|
|
- !localStorage.getItem("phoneVerified")
|
|
|
|
- ) {
|
|
|
|
- phoneModal = true;
|
|
|
|
- }
|
|
|
|
-});
|
|
|
|
|
|
+if (
|
|
|
|
+ ["cugr.ecs.qmth.com.cn", "test.cugr.qmth.com.cn"].includes(DOMAIN) &&
|
|
|
|
+ !localStorage.getItem("phoneVerified")
|
|
|
|
+) {
|
|
|
|
+ phoneModal = true;
|
|
|
|
+} else {
|
|
|
|
+ emit("update:modelValue", true);
|
|
|
|
+}
|
|
onUnmounted(() => clearInterval(interval));
|
|
onUnmounted(() => clearInterval(interval));
|
|
|
|
|
|
async function getCode() {
|
|
async function getCode() {
|
|
@@ -65,6 +68,7 @@ async function verify() {
|
|
);
|
|
);
|
|
phoneModal = false;
|
|
phoneModal = false;
|
|
localStorage.setItem("phoneVerified", "true");
|
|
localStorage.setItem("phoneVerified", "true");
|
|
|
|
+ emit("update:modelValue", true);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
$message.error("验证手机号接口失败,请重试!", {
|
|
$message.error("验证手机号接口失败,请重试!", {
|
|
duration: 15,
|
|
duration: 15,
|