|
@@ -0,0 +1,91 @@
|
|
|
+<template>
|
|
|
+ <div class="login-flex">
|
|
|
+ <div class="login">
|
|
|
+ <div class="logo"><img src="img/logo_blue.png" /></div>
|
|
|
+ <form>
|
|
|
+ <div>
|
|
|
+ <select id="server-select">
|
|
|
+ <option value="">请选择服务地址</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <input id="loginName-input" type="text" placeholder="请输入账号" />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <input id="password-input" type="password" placeholder="请输入密码" />
|
|
|
+ </div>
|
|
|
+ <div><a href="##" id="login-button">登录</a></div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ <div class="ft">
|
|
|
+ Copyright © 2011-2021 www.qmth.com.cn, All Rights Reserved
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import { onMounted } from "@vue/runtime-core";
|
|
|
+
|
|
|
+Object.assign(
|
|
|
+ electron.env,
|
|
|
+ JSON.parse(window.localStorage.getItem("env") || "{}")
|
|
|
+);
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ window.localStorage.clear();
|
|
|
+ for (let i = 0; i < electron.config.servers.length; i++) {
|
|
|
+ let server = electron.config.servers[i];
|
|
|
+ // $('<option value="' + i + '">' + server.name + "</option>").appendTo(
|
|
|
+ // $("#server-select")
|
|
|
+ // );
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+// document.onkeydown = function (event) {
|
|
|
+// var e = event || window.event;
|
|
|
+// if (e && e.keyCode == 13) { //回车键的键值为13
|
|
|
+// $('#login-button').click() //调用登录按钮的登录事件
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// $('#login-button').click(() => {
|
|
|
+// let index = $('#server-select').val()
|
|
|
+// if (index != '') {
|
|
|
+// env.server = config.servers[parseInt(index)]
|
|
|
+// } else {
|
|
|
+// env.server = undefined
|
|
|
+// }
|
|
|
+// env.loginName = $('#loginName-input').val()
|
|
|
+// env.password = $('#password-input').val()
|
|
|
+// if (env.server == undefined) {
|
|
|
+// alert('请选择服务地址')
|
|
|
+// return
|
|
|
+// }
|
|
|
+// if (env.loginName == '') {
|
|
|
+// alert('请输入账号')
|
|
|
+// return
|
|
|
+// }
|
|
|
+// if (env.password == '') {
|
|
|
+// alert('请输入密码')
|
|
|
+// return
|
|
|
+// }
|
|
|
+// api.login().then(user => {
|
|
|
+// env.user = user
|
|
|
+// window.localStorage.setItem('env', JSON.stringify(env))
|
|
|
+// window.location.href = 'exam-list.html'
|
|
|
+// }).catch(err => {
|
|
|
+// alert('登陆失败,用户名或密码错误')
|
|
|
+// })
|
|
|
+// })
|
|
|
+
|
|
|
+// const {
|
|
|
+// user: { userName },
|
|
|
+// exam: { iid, name, examTime },
|
|
|
+// } = env;
|
|
|
+
|
|
|
+// $("#user-name").html(env.user.userName);
|
|
|
+
|
|
|
+// $("#exam-title").find(".id").html(env.exam.id);
|
|
|
+// $("#exam-title").find(".name").html(env.exam.name);
|
|
|
+// $("#exam-title").find(".time").html(env.exam.examTime);
|
|
|
+</script>
|