|
@@ -18,19 +18,23 @@
|
|
|
</div>
|
|
|
|
|
|
<PhoneVerifyForDD />
|
|
|
+ <PrivacyDialog />
|
|
|
</main-layout>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import EcsOnlineList from "./OnlineExamList.vue";
|
|
|
import PhoneVerifyForDD from "./PhoneVerifyForDD.vue";
|
|
|
-import { mapMutations, mapState, mapGetters } from "vuex";
|
|
|
+import PrivacyDialog from "./PrivacyDialog.vue";
|
|
|
+import { mapMutations, mapState } from "vuex";
|
|
|
+import { PRIVACY_READ_VERSION_NUMBER } from "@/constants/constants";
|
|
|
|
|
|
export default {
|
|
|
name: "OnlineExamHome",
|
|
|
components: {
|
|
|
"ecs-online-list": EcsOnlineList,
|
|
|
PhoneVerifyForDD,
|
|
|
+ PrivacyDialog,
|
|
|
},
|
|
|
beforeRouteEnter(to, from, next) {
|
|
|
next((vm) => {
|
|
@@ -52,13 +56,12 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
previousUrl: "",
|
|
|
- autoCloseModal: 10,
|
|
|
+ autoCloseModal: 100000, // 直到隐私框和电话框确认通过后
|
|
|
courses: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(["user", "siteMessagesTimeStamp", "menus"]),
|
|
|
- ...mapGetters(["isEpcc"]),
|
|
|
locationTitle() {
|
|
|
return (
|
|
|
this.menus.find(
|
|
@@ -90,14 +93,6 @@ export default {
|
|
|
this.previousUrl.startsWith("/login/") &&
|
|
|
process.env.NODE_ENV !== "development"
|
|
|
) {
|
|
|
- const os = window.navigator.userAgent.match(
|
|
|
- /Intel Mac OS X (\d+)_(\d+)_(\d+)/
|
|
|
- );
|
|
|
-
|
|
|
- let macosVersionTooLow = false;
|
|
|
- if (os && +(os[2] + "." + os[3]) < 14.6) {
|
|
|
- macosVersionTooLow = true;
|
|
|
- }
|
|
|
this.$Modal.info({
|
|
|
render: () => (
|
|
|
<div class="welcome-modal">
|
|
@@ -110,17 +105,9 @@ export default {
|
|
|
姓名:{this.$store.state.user.name} -{" "}
|
|
|
{this.$store.state.user.studentCodeList.join(",")}
|
|
|
</div>
|
|
|
- {!this.isEpcc && (
|
|
|
- <div style="font-weight:bold; line-height: 25px;">
|
|
|
- 专业:{this.$store.state.user.specialty}
|
|
|
- </div>
|
|
|
- )}
|
|
|
- {macosVersionTooLow && (
|
|
|
- <div style="font-weight:bold; line-height: 25px; color: red">
|
|
|
- 您的操作系统版本过低,为保证考试过程顺利完成,请更新操作系统到
|
|
|
- macOS Mojave (10.14.5) 以上!
|
|
|
- </div>
|
|
|
- )}
|
|
|
+ <div style="font-weight:bold; line-height: 25px;">
|
|
|
+ 专业:{this.$store.state.user.specialty}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
),
|
|
@@ -129,6 +116,26 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
this.interval = setInterval(() => {
|
|
|
+ const privacyReadVersionUserId = localStorage.getItem(
|
|
|
+ "privacy-read-version-" + this.user.id
|
|
|
+ );
|
|
|
+ const shouldPhoneCheck = [
|
|
|
+ "cugr.ecs.qmth.com.cn",
|
|
|
+ "test.cugr.qmth.com.cn",
|
|
|
+ ].includes(localStorage.getItem("domain"));
|
|
|
+ const passPhoneCheck = localStorage.getItem("phoneVerified");
|
|
|
+ // console.log(
|
|
|
+ // privacyReadVersionUserId,
|
|
|
+ // shouldPhoneCheck,
|
|
|
+ // passPhoneCheck
|
|
|
+ // );
|
|
|
+ if (
|
|
|
+ privacyReadVersionUserId === PRIVACY_READ_VERSION_NUMBER &&
|
|
|
+ (shouldPhoneCheck ? passPhoneCheck : true) &&
|
|
|
+ this.autoCloseModal > 10
|
|
|
+ ) {
|
|
|
+ this.autoCloseModal = 10;
|
|
|
+ }
|
|
|
this.autoCloseModal--;
|
|
|
if (this.autoCloseModal <= 0) {
|
|
|
this.$Modal.remove();
|
|
@@ -151,6 +158,7 @@ export default {
|
|
|
await this.getData();
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
+ this.$Modal.remove();
|
|
|
clearInterval(this.interval);
|
|
|
},
|
|
|
methods: {
|