|
@@ -0,0 +1,140 @@
|
|
|
+<template>
|
|
|
+ <div class="background-image">
|
|
|
+ <Header :color="'aliceblue'"/>
|
|
|
+
|
|
|
+ <div class="content">
|
|
|
+ <h1>用户登录</h1>
|
|
|
+ <button>企业微信一键登录</button>
|
|
|
+ <button @click="WXLogin('login')">企业微信扫码登录</button>
|
|
|
+ <div class="agreementBox">
|
|
|
+ <div class="checkBox">
|
|
|
+ <input type="checkbox" v-model="agreement">
|
|
|
+ </div>
|
|
|
+ <div class="text">
|
|
|
+ 阅读并同意 <span class="bold">《使用协议》《隐私协议》</span>
|
|
|
+ </div>
|
|
|
+ <router-view></router-view>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import Header from "../../components/Header.vue";
|
|
|
+import { ServerAPI } from '../../app/lib/ServerAPI';
|
|
|
+
|
|
|
+let agreement = ref(false);
|
|
|
+
|
|
|
+let WXLogin = function () {
|
|
|
+ if (!agreement.value) {
|
|
|
+ ElMessage({
|
|
|
+ message: "请仔细阅读并同意下方使用协议和隐私协议",
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const num = 0; //解决一个奇怪的bug,需要登录两次
|
|
|
+ ServerAPI.WXWorkUrl(num, 'login', (res) => {
|
|
|
+ if (!res || res.code !== 0 || !res.data.url)
|
|
|
+ return ElMessage.error(`请求登录失败!${res.msg}`)
|
|
|
+ window.location.href = res.data.url
|
|
|
+ });
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.background-image {
|
|
|
+ position: relative;
|
|
|
+ background-image: url("../../assets/img/background.jpg");
|
|
|
+ background-size: cover;
|
|
|
+ background-position: center;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ height: 100vh;
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.content {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ flex-direction: column;
|
|
|
+ background-color: rgba(255, 255, 255, 0.7);
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ height: 400px;
|
|
|
+ width: 650px;
|
|
|
+ padding: 30px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.background-image h1 {
|
|
|
+ color: #337ecc;
|
|
|
+ font-size: 2em;
|
|
|
+ margin: 0;
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.background-image button {
|
|
|
+ display: block;
|
|
|
+ width: 100%;
|
|
|
+ height: 60px;
|
|
|
+ padding: 15px;
|
|
|
+ margin: 10px 0;
|
|
|
+ font-size: 1em;
|
|
|
+ border: none;
|
|
|
+ border-radius: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ background-color: #337ecc;
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.agreementBox {
|
|
|
+ margin-top: 10px;
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+
|
|
|
+.agreementBox .checkBox {
|
|
|
+ display: inline-block;
|
|
|
+ height: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.agreementBox .text {
|
|
|
+ margin-left: 5px;
|
|
|
+ display: inline;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.agreementBox .text .bold {
|
|
|
+ font-weight: bold;
|
|
|
+ color: #000;
|
|
|
+}
|
|
|
+
|
|
|
+@media only screen and (max-width: 768px) {
|
|
|
+ .content {
|
|
|
+ height: auto;
|
|
|
+ width: 80%;
|
|
|
+ height: 35%;
|
|
|
+ padding: 25px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .background-image button {
|
|
|
+ height: 50px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .background-image h1 {
|
|
|
+ font-size: 1.5em;
|
|
|
+ }
|
|
|
+
|
|
|
+ .background-image button {
|
|
|
+ font-size: 0.9em;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|