|
@@ -14,6 +14,7 @@ import { onMounted, onUnmounted, watch } from "vue";
|
|
|
import { Person, LockClosed, CloseCircleOutline } from "@vicons/ionicons5";
|
|
|
import { FormRules, FormItemInst } from "naive-ui";
|
|
|
import GeeTest from "./GeeTest.vue";
|
|
|
+import GlobalNotice from "./GlobalNotice.vue";
|
|
|
|
|
|
logger({
|
|
|
cnl: ["console", "local", "server"],
|
|
@@ -21,6 +22,7 @@ logger({
|
|
|
act: "首次渲染",
|
|
|
});
|
|
|
|
|
|
+//#region service worker通知是否有版本更新
|
|
|
let newVersionAvailable = $ref(false);
|
|
|
const checkNewVersionListener = () => {
|
|
|
newVersionAvailable = true;
|
|
@@ -35,6 +37,7 @@ onMounted(() =>
|
|
|
onUnmounted(() =>
|
|
|
document.removeEventListener("__newSWAvailable", checkNewVersionListener)
|
|
|
);
|
|
|
+//#endregion
|
|
|
|
|
|
let isGeeTestEnabled = $ref(false);
|
|
|
onMounted(async () => {
|
|
@@ -46,26 +49,18 @@ onMounted(async () => {
|
|
|
|
|
|
const QECSConfig = store.QECSConfig;
|
|
|
|
|
|
-const logoPath = $computed(() => store.QECSConfig.LOGO_FILE_URL || "");
|
|
|
+const logoPath = $computed(() => QECSConfig.LOGO_FILE_URL || "");
|
|
|
const backgroundUrl = $computed(
|
|
|
() =>
|
|
|
`url(${
|
|
|
- store.QECSConfig.STUDENT_CLIENT_BG_PICTURE_URL ||
|
|
|
+ QECSConfig.STUDENT_CLIENT_BG_PICTURE_URL ||
|
|
|
"https://cdn.qmth.com.cn/ui/ecs-client-bg.jpg!/progressive/true"
|
|
|
})`
|
|
|
);
|
|
|
const productName = $computed(
|
|
|
- () => store.QECSConfig.OE_STUDENT_SYS_NAME || "远程教育网络考试"
|
|
|
+ () => QECSConfig.OE_STUDENT_SYS_NAME || "远程教育网络考试"
|
|
|
);
|
|
|
-const allowLoginType = $computed(() => store.QECSConfig.LOGIN_TYPE ?? []);
|
|
|
-// const isGeeTestEnabled = $computed(() => {
|
|
|
-// const thisOrg = this.GeeTestConfig[QECSConfig.ROOT_ORG_ID];
|
|
|
-// const isThisOrgUndefined = thisOrg === undefined;
|
|
|
-// const allOrg = this.GeeTestConfig["-1"];
|
|
|
-// return isThisOrgUndefined ? allOrg : thisOrg;
|
|
|
-// });
|
|
|
-
|
|
|
-const domain = DOMAIN;
|
|
|
+const allowLoginType = $computed(() => QECSConfig.LOGIN_TYPE ?? []);
|
|
|
|
|
|
let disableLoginBtn = $computed(
|
|
|
() => false
|
|
@@ -79,6 +74,8 @@ let disableLoginBtn = $computed(
|
|
|
|
|
|
let loginBtnLoading = $ref(false);
|
|
|
|
|
|
+//#region form校验
|
|
|
+const domain = DOMAIN;
|
|
|
type FormModel = {
|
|
|
accountType: "STUDENT_CODE" | "IDENTITY_NUMBER";
|
|
|
accountValue: string;
|
|
@@ -110,7 +107,9 @@ const fromRules: FormRules = {
|
|
|
|
|
|
let errorInfo = $ref("");
|
|
|
watch([formValue], () => (errorInfo = ""));
|
|
|
+//#endregion
|
|
|
|
|
|
+//#region 极验
|
|
|
type Captcha = {
|
|
|
appendTo(sel: string): void;
|
|
|
onReady(cb: () => void): void;
|
|
@@ -131,6 +130,7 @@ watch(
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
+//#endregion
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
@@ -170,7 +170,7 @@ async function loginForuser() {
|
|
|
formValue.accountValue,
|
|
|
formValue.password,
|
|
|
domain,
|
|
|
- store.QECSConfig.ROOT_ORG_ID,
|
|
|
+ QECSConfig.ROOT_ORG_ID,
|
|
|
geeParams
|
|
|
);
|
|
|
|
|
@@ -247,7 +247,7 @@ function closeApp() {
|
|
|
<!-- 加上它,在logo加载失败的时候有用 -->
|
|
|
<!-- @load="(e: any) => (e.target.style = '')" -->
|
|
|
</div>
|
|
|
- <a class="close" @click="closeApp"> 关闭 </a>
|
|
|
+ <a class="close" @click="closeApp">关闭</a>
|
|
|
</header>
|
|
|
|
|
|
<div class="center" :style="{ backgroundImage: backgroundUrl }">
|
|
@@ -256,7 +256,7 @@ function closeApp() {
|
|
|
<a
|
|
|
v-if="allowLoginType.includes('STUDENT_CODE')"
|
|
|
key="STUDENT_CODE"
|
|
|
- :class="[formValue.accountType === 'STUDENT_CODE' && 'active-type']"
|
|
|
+ :class="{ 'active-type': formValue.accountType === 'STUDENT_CODE' }"
|
|
|
@click="formValue.accountType = 'STUDENT_CODE'"
|
|
|
>
|
|
|
{{ QECSConfig.STUDENT_CODE_LOGIN_ALIAS }}
|
|
@@ -264,12 +264,14 @@ function closeApp() {
|
|
|
<a
|
|
|
v-if="allowLoginType.includes('IDENTITY_NUMBER')"
|
|
|
key="IDENTITY_NUMBER"
|
|
|
- :class="[formValue.accountType !== 'STUDENT_CODE' && 'active-type']"
|
|
|
+ :class="{
|
|
|
+ 'active-type': formValue.accountType === 'IDENTITY_NUMBER',
|
|
|
+ }"
|
|
|
@click="formValue.accountType = 'IDENTITY_NUMBER'"
|
|
|
>
|
|
|
{{ QECSConfig.IDENTITY_NUMBER_LOGIN_ALIAS }}
|
|
|
</a>
|
|
|
- <a v-if="allowLoginType.length === 0" key="loading"> loading... </a>
|
|
|
+ <a v-if="allowLoginType.length === 0" key="loading">loading...</a>
|
|
|
</div>
|
|
|
|
|
|
<div class="qm-title-text tw-text-center tw-mt-10">
|
|
@@ -341,7 +343,7 @@ function closeApp() {
|
|
|
版本: {{ VITE_GIT_REPO_VERSION }}
|
|
|
</div>
|
|
|
</footer>
|
|
|
- <!-- <GlobalNotice /> -->
|
|
|
+ <GlobalNotice />
|
|
|
</div>
|
|
|
</template>
|
|
|
|