Browse Source

修改标题

shuhao 2 days ago
parent
commit
77528c759c

+ 1 - 1
public/index.html

@@ -15,7 +15,7 @@
         <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
         <link rel="icon" href="favicon.ico" />
         <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/qweather-icons@1.3.0/font/qweather-icons.css">
-        <title>高州"Al+低空"智慧农业平台</title>
+        <title>高州"Al+低空"智慧农业标准化与溯源平台</title>
     </head>
     <body>
         <noscript>

+ 26 - 26
src/components/fnHeader.vue

@@ -2,7 +2,7 @@
     <div class="header">
         <div class="title">
             <img class="logo" src="@/assets/images/common/logo.png" alt="" />
-            <span>高州"Al+低空"智慧农业平台</span>
+            <span>高州"Al+低空"智慧农业标准化与溯源平台</span>
             <img class="logo-icon" src="@/assets/images/common/logo-icon.png" alt="" />
         </div>
         <div class="focus-farm" v-show="!hideSwitch">
@@ -155,32 +155,32 @@ onUnmounted(() => {
     position: relative;
 
     .title {
-        width: 100%;
-        height: 100%;
-        font-size: 24px;
-        letter-spacing: 2px;
-        padding-left: 20px;
-        display: flex;
-        align-items: center;
-        box-sizing: border-box;
-        background: url("@/assets/images/common/header-bg.png") no-repeat center center / 100% 100%;
-        background-size: 120% 100%;
-        background-position: left center;
-        .logo {
-            width: 23px;
-            height: 26px;
-        }
-        .logo-icon {
-            width: 33px;
-            height: 12px;
-        }
-        span {
-            margin: 0 5px;
-            font-family: "PangMenZhengDao";
-            text-shadow: 0 0 5px rgba(243, 251, 254, 0.53);
-        }
+      width: 100%;
+      height: 100%;
+      font-size: 24px;
+      letter-spacing: 2px;
+      padding-left: 20px;
+      display: flex;
+      align-items: center;
+      box-sizing: border-box;
+      background: url("@/assets/images/common/header-bg.png") no-repeat center center / 100% 100%;
+      background-size: 155% 100%;
+      background-position: left center;
+      .logo {
+        width: 23px;
+        height: 26px;
+      }
+      .logo-icon {
+        width: 33px;
+        height: 12px;
+      }
+      span {
+        margin: 0 5px;
+        cursor: pointer;
+        font-family: "PangMenZhengDao";
+      }
     }
-    .focus-farm {
+      .focus-farm {
         position: absolute;
         right: 192px;
         top: 23px;

+ 5 - 0
src/router/globalRoutes.js

@@ -13,6 +13,11 @@ export default [
         component: () => import("@/views/Login.vue"),
     },
     {
+        path: "/auto_login",
+        name: "AutoLogin",
+        component: () => import("@/views/AutoLogin.vue"),
+    },
+    {
         path: "/404",
         name: "404",
         component: () => import("@/views/404.vue"),

+ 128 - 0
src/views/AutoLogin.vue

@@ -0,0 +1,128 @@
+<!--
+ * @Author: your name
+ * @Date: 2021-01-11 11:14:26
+ * @LastEditTime: 2022-04-28 18:35:39
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: \vue3-element-admin\src\views\Login.vue
+-->
+<template>
+  <div style="background-color: #fff; height: 100%;"></div>
+</template>
+
+<script setup>
+import {SET_TOKEN, SET_UNAME, SET_USER_INFO} from "@/store/modules/app/type";
+import Common from "@/components/Common";
+import { ref, reactive, toRefs } from "vue";
+import { useStore } from "vuex";
+import { useRouter } from "vue-router";
+
+// const rules = {
+//   phone: [{ required: true, message: "请输入用户名", trigger: "blur" }]
+// };
+
+const rules = {
+  userName: [{ required: true, message: "请输入用户名", trigger: "blur" }]
+  ,
+  pwd: [{ required: true, message: "请输入验证码", trigger: "blur" }
+  ],
+};
+
+const store = useStore();
+const router = useRouter();
+// 定义两个账号
+const guestAccount = { "pwd": "游客", "userName": "游客" };
+const regularAccount = { "pwd": "", "userName": "13797066447" };
+const form = reactive({
+  "pwd": "qz123456789",
+  "userName": "13797066447"
+});
+
+const { userName, pwd } = toRefs(form);
+const ref_form = ref(null);
+const success = ref(false);
+sessionStorage.clear();
+store.commit(`app/${SET_TOKEN}`, "");
+router.options.isAddDynamicMenuRoutes = false;
+
+
+const onSubmit = async () => {
+  const res = await VE_API.system.login(form);
+  if (res.code == 0) {
+    const { token, userName, djiCloudToken } = res.data;
+    store.commit(`app/${SET_TOKEN}`, token);
+    store.commit(`app/djiCloudToken`, djiCloudToken);
+    store.commit(`app/${SET_UNAME}`, userName);
+    res.data["token"] = undefined
+    res.data["x-auth-token"] = undefined
+    res.data["pwd"] = undefined
+    store.commit(`app/${SET_USER_INFO}`, JSON.stringify(res.data));
+    success.value = true;
+    router.push({ name: "Home" });
+  }
+};
+onSubmit()
+</script>
+
+<style lang="scss" scoped>
+.ve_container {
+  position: absolute;
+  z-index: 1;
+  width: 400px;
+  top: calc(50%);
+  left: calc(50% - 250px);
+  transform: translateY(-50%);
+  transition: all 1s;
+  min-height: 273px;
+  text-align: center;
+  h1 {
+    font-size: 24px;
+    transition: all 1s;
+    font-weight: normal;
+    text-align: left;
+    margin-bottom: 36px;
+  }
+  .ve_form {
+    .ve_submit {
+      width: 100%;
+      height: 45px;
+      background: #0BC678;
+    }
+  }
+}
+.backdrop-layer{
+  position: absolute;
+  top: 0px;
+  bottom: 0px;
+  left: 0px;
+  right: 0px;
+  background: url(@/assets/login_bg.jpg) no-repeat;
+  background-size:100% 100%;
+  z-index: 1;
+  overflow: hidden;
+}
+.head{
+  position: absolute;
+  left: 300px;
+  top: 100px;
+  display: flex;
+  align-items: center;
+  padding: 50px;
+  .title{
+    font-size: 30px;
+    font-weight: bold;
+    color:#006600;
+    float: left;
+    line-height: 50px;
+    margin-left: 20px;
+  }
+  .logo{
+    width: calc(167px * 0.5);
+    height: calc(245px * 0.5);
+    background: url('@/assets/logo-verticle.png') no-repeat;
+    background-size:100% 100%;
+    float: left;
+    z-index: 1000;
+  }
+}
+</style>

+ 1 - 1
src/views/Login.vue

@@ -11,7 +11,7 @@
     <div class="head">
       <div class="logo"></div>
       <div class="title">
-        高州"Al+低空"智慧农业平台
+        高州"Al+低空"智慧农业标准化与溯源平台
       </div>
     </div>
     <div class="ve_container">

+ 2 - 2
src/views/home/index.vue

@@ -6,7 +6,7 @@
             <div class="left yes-events">
                 <component :is="components[currentComponent]" @backHome="backHome"/>
             </div>
-            
+
             <div class="right yes-events">
                 <div class="list adopt-list-wrap">
                     <chart-box name="认养管理" arrow="">
@@ -637,4 +637,4 @@ function backHome() {
         }
     }
 }
-</style>
+</style>