Browse Source

fix-新增登录

LAPTOP-U5GOA5HA\zz 1 year ago
parent
commit
861052b542

+ 8 - 0
app/src/api/index.js

@@ -268,4 +268,12 @@ export function getQyrs(params) {
     method: 'GET',
     params
   })
+}
+// 登录
+export function getLogin(data) {
+  return request({
+    url: '/login',
+    method: 'POST',
+    data
+  })
 }

BIN
app/src/assets/images/line-lo.png


BIN
app/src/assets/images/loding.png


BIN
app/src/assets/images/login-btn4.png


+ 5 - 0
app/src/components/Headers.vue

@@ -54,6 +54,7 @@
 </template>
 
 <script>
+import { innerDrawElementOnCanvas } from "echarts";
 import Image1 from "../assets/images/fxyj2.png";
 import Image2 from "../assets/images/fxyj4.png";
 import Image3 from "../assets/images/fxyj7.png";
@@ -115,6 +116,10 @@ export default {
   },
   methods: {
     ConfirmBtn(item) {
+      if(item.id==8){
+        sessionStorage.removeItem('token')
+        this.$router.push(item.url);
+      }
       if (item.url && this.$route.path !== item.url) {
         this.flag = item.id;
         this.$router.push(item.url);

+ 12 - 1
app/src/router/index.js

@@ -108,5 +108,16 @@ const router = new VueRouter({
     { path: "/login", name: "login", component: Login }
   ],
 });
-
+router.beforeEach((to, from, next) => {
+  const token = sessionStorage.getItem('token')
+  if (token) {
+    next()
+  } else {
+    if (to.path === '/login') {
+      next()
+    } else {
+      next('/login')
+    }
+  }
+})
 export default router;

+ 5 - 5
app/src/shared/mapInfoTemplate.js

@@ -77,7 +77,7 @@ function YBFX(params) {
   const item = params.data.meta;
   return  `<p style="color: #fff;">一般风险 <span style="font-size: 24px;color:red;font-weight:bold;">${
     item.sl || 0
-          }</span></ps>`
+          }</span></ps>`
 }
 /**
  * 重大风险数
@@ -122,7 +122,7 @@ function WZGYHS(params) {
   const item = params.data.meta;
   return  `<p style="color: #fff;">未整改隐患 <span style="font-size: 24px;color:red;font-weight:bold;">${
     item.sl || 0
-          }</span></ps>`
+          }</span></ps>`
 }
 
  /**
@@ -132,7 +132,7 @@ function WZGYHS(params) {
   const item = params.data.meta;
   return `<p style="color: #fff;">无管理主体 <span style="font-size: 24px;color:red;font-weight:bold;">${
     item.sl || 0
-  }</span></ps>`
+  }</span></ps>`
  }
  /**
   * 无维保形式
@@ -141,7 +141,7 @@ function WZGYHS(params) {
   const item = params.data.meta;
   return `<p style="color: #fff;">无维保形式 <span style="font-size: 24px;color:red;font-weight:bold;">${
     item.sl || 0
-  }</span></ps>`
+  }</span></ps>`
  }
  /**
   * 无大修基金(消防设施有问题)
@@ -150,7 +150,7 @@ function WZGYHS(params) {
   const item = params.data.meta;
   return `<p style="color: #fff;">无大修基金(消防设施有问题) <span style="font-size: 24px;color:red;font-weight:bold;">${
     item.sl || 0
-  }</span></ps>`
+  }</span></ps>`
  }
  /**
   * 接入物联网建筑数

+ 340 - 117
app/src/views/login/index.vue

@@ -18,35 +18,63 @@
           >
             <path
               d="M4.00003 4C2.50003 18.1667 6.5 42 25 52.5C40.9535 61.5547 273.5 56.5 291.5 71.5C303.018 81.0985 303.5 98.3333 302.5 109"
-              stroke="url(#paint0_linear_1063_94)" stroke-width="2" />
+              stroke="url(#paint0_linear_1063_94)"
+              stroke-width="2"
+            />
             <path
               d="M4.00003 4C2.50003 18.1667 6.5 42 25 52.5C40.9535 61.5547 273.5 56.5 291.5 71.5C303.018 81.0985 303.5 98.3333 302.5 109"
               fill="none"
-              class="g-rect-fill" stroke="#36f4fb"/>
+              class="g-rect-fill"
+              stroke="#36f4fb"
+            />
             <circle cx="4" cy="4" r="4" fill="#61DBFF" />
             <path
               d="M641.846 4C643.346 18.1667 639.346 42 620.846 52.5C604.892 61.5547 373.5 58.5 355.5 73.5C343.982 83.0985 343.5 100.333 344.5 111"
-              stroke="url(#paint1_linear_1063_94)" stroke-width="2" />
+              stroke="url(#paint1_linear_1063_94)"
+              stroke-width="2"
+            />
             <path
               d="M641.846 4C643.346 18.1667 639.346 42 620.846 52.5C604.892 61.5547 373.5 58.5 355.5 73.5C343.982 83.0985 343.5 100.333 344.5 111"
               fill="none"
-              class="g-rect-fill" stroke="#36f4fb" />
-            <circle cx="4" cy="4" r="4" transform="matrix(-1 0 0 1 645.846 0)" fill="#61DBFF" />
+              class="g-rect-fill"
+              stroke="#36f4fb"
+            />
+            <circle
+              cx="4"
+              cy="4"
+              r="4"
+              transform="matrix(-1 0 0 1 645.846 0)"
+              fill="#61DBFF"
+            />
             <path
               d="M206 4C204.5 18.1667 214 33.5 232.5 44C248.453 53.0547 286.5 56 304.5 71C316.018 80.5985 316.5 97.8333 315.5 108.5"
-              stroke="url(#paint2_linear_1063_94)" stroke-width="2" />
+              stroke="url(#paint2_linear_1063_94)"
+              stroke-width="2"
+            />
             <path
               d="M206 4C204.5 18.1667 214 33.5 232.5 44C248.453 53.0547 286.5 56 304.5 71C316.018 80.5985 316.5 97.8333 315.5 108.5"
-              class="g-rect-fill" stroke="#36f4fb" />
+              class="g-rect-fill"
+              stroke="#36f4fb"
+            />
             <circle cx="206" cy="4" r="4" fill="#61DBFF" />
             <path
               d="M439.846 4C441.346 18.1667 431.846 33.5 413.346 44C397.392 53.0547 359.346 56 341.346 71C329.828 80.5985 329.346 97.8333 330.346 108.5"
-              stroke="url(#paint3_linear_1063_94)" stroke-width="2" />
+              stroke="url(#paint3_linear_1063_94)"
+              stroke-width="2"
+            />
             <path
               d="M439.846 4C441.346 18.1667 431.846 33.5 413.346 44C397.392 53.0547 359.346 56 341.346 71C329.828 80.5985 329.346 97.8333 330.346 108.5"
               fill="none"
-              class="g-rect-fill" stroke="#36f4fb" />
-            <circle cx="4" cy="4" r="4" transform="matrix(-1 0 0 1 443.846 0)" fill="#61DBFF" />
+              class="g-rect-fill"
+              stroke="#36f4fb"
+            />
+            <circle
+              cx="4"
+              cy="4"
+              r="4"
+              transform="matrix(-1 0 0 1 443.846 0)"
+              fill="#61DBFF"
+            />
             <defs>
               <linearGradient
                 id="paint0_linear_1063_94"
@@ -105,25 +133,67 @@
         </div>
 
         <div class="line-left">
-          <svg width="448" height="359" viewBox="0 0 448 359" fill="none" xmlns="http://www.w3.org/2000/svg">
-            <path d="M419 321C322 345.5 269.5 321 189.5 259.5C78.8038 174.402 23 41.5 10 7"
-              stroke="url(#paint0_linear_1000_2088)" stroke-width="2" />
-            <path d="M419 321C322 345.5 269.5 321 189.5 259.5C78.8038 174.402 23 41.5 10 7"
-            fill="none"
-              class="g-rect-fill" stroke="#36f4fb"/>
-            <path d="M432.5 341C363.316 352.797 274.5 357.5 210.5 357.5C123.286 357.5 50 341 7.00006 319"
-              stroke="url(#paint1_linear_1000_2088)" stroke-width="2" />
-            <path d="M432.5 341C363.316 352.797 274.5 357.5 210.5 357.5C123.286 357.5 50 341 7.00006 319"
-            fill="none"
-              class="g-rect-fill" stroke="#36f4fb" />
-            <path d="M438 328.5C411 340.5 291.547 369.141 128 282.5C44 238 16.5 185 9.5 174"
-              stroke="url(#paint2_linear_1000_2088)" stroke-width="2" />
-            <path d="M438 328.5C411 340.5 291.547 369.141 128 282.5C44 238 16.5 185 9.5 174"
+          <svg
+            width="448"
+            height="359"
+            viewBox="0 0 448 359"
             fill="none"
-              class="g-rect-fill" stroke="#36f4fb" />
-            <circle cx="7" cy="7" r="7" transform="matrix(-1 0 0 1 14 312)" fill="#61FFBD" />
-            <circle cx="7" cy="7" r="7" transform="matrix(-1 0 0 1 17 167)" fill="#61DBFF" />
-            <circle cx="7" cy="7" r="7" transform="matrix(-1 0 0 1 17 0)" fill="#0085FF" />
+            xmlns="http://www.w3.org/2000/svg"
+          >
+            <path
+              d="M419 321C322 345.5 269.5 321 189.5 259.5C78.8038 174.402 23 41.5 10 7"
+              stroke="url(#paint0_linear_1000_2088)"
+              stroke-width="2"
+            />
+            <path
+              d="M419 321C322 345.5 269.5 321 189.5 259.5C78.8038 174.402 23 41.5 10 7"
+              fill="none"
+              class="g-rect-fill"
+              stroke="#36f4fb"
+            />
+            <path
+              d="M432.5 341C363.316 352.797 274.5 357.5 210.5 357.5C123.286 357.5 50 341 7.00006 319"
+              stroke="url(#paint1_linear_1000_2088)"
+              stroke-width="2"
+            />
+            <path
+              d="M432.5 341C363.316 352.797 274.5 357.5 210.5 357.5C123.286 357.5 50 341 7.00006 319"
+              fill="none"
+              class="g-rect-fill"
+              stroke="#36f4fb"
+            />
+            <path
+              d="M438 328.5C411 340.5 291.547 369.141 128 282.5C44 238 16.5 185 9.5 174"
+              stroke="url(#paint2_linear_1000_2088)"
+              stroke-width="2"
+            />
+            <path
+              d="M438 328.5C411 340.5 291.547 369.141 128 282.5C44 238 16.5 185 9.5 174"
+              fill="none"
+              class="g-rect-fill"
+              stroke="#36f4fb"
+            />
+            <circle
+              cx="7"
+              cy="7"
+              r="7"
+              transform="matrix(-1 0 0 1 14 312)"
+              fill="#61FFBD"
+            />
+            <circle
+              cx="7"
+              cy="7"
+              r="7"
+              transform="matrix(-1 0 0 1 17 167)"
+              fill="#61DBFF"
+            />
+            <circle
+              cx="7"
+              cy="7"
+              r="7"
+              transform="matrix(-1 0 0 1 17 0)"
+              fill="#0085FF"
+            />
             <path
               d="M425.722 319.186C426.403 319.546 426.439 320.507 425.787 320.917L418.456 325.526C417.804 325.936 416.953 325.487 416.924 324.717L416.598 316.063C416.569 315.294 417.384 314.782 418.064 315.141L425.722 319.186Z"
               fill="#61DBFF"
@@ -188,85 +258,227 @@
       </div>
       <div class="app-box">
         <!-- 箭头 -->
-        <div class="line-stream"> </div>
-          <div class="line-bottom">
-            <svg width="1336" height="61" viewBox="0 0 1336 61" fill="none" xmlns="http://www.w3.org/2000/svg">
-              <path d="M10 48C164.5 48 591 32.5 630.5 1.5" stroke="url(#paint0_linear_1104_101)" stroke-width="2" />
-              <path d="M188 53.5C345.5 53.5 586.5 45.5 649 3" stroke="url(#paint1_linear_1104_101)" stroke-width="2" />
-              <path d="M376.5 56C534 56 657.5 28 660.5 3.5" stroke="url(#paint2_linear_1104_101)" stroke-width="2" />
-              <path d="M572 54C608 48 645.5 37.5 667 8" stroke="url(#paint3_linear_1104_101)" stroke-width="2" />
-              <path d="M10 48C164.5 48 591 32.5 630.5 1.5" fill="none"
-              class="g-rect-fill-re" stroke="#36f4fb" />
-              <path d="M188 53.5C345.5 53.5 586.5 45.5 649 3" fill="none"
-              class="g-rect-fill-re" stroke="#36f4fb" />
-              <path d="M376.5 56C534 56 657.5 28 660.5 3.5" fill="none"
-              class="g-rect-fill-re" stroke="#36f4fb" />
-              <path d="M572 54C608 48 645.5 37.5 667 8" fill="none"
-              class="g-rect-fill-re" stroke="#36f4fb" />
-              <circle cx="5" cy="48" r="5" fill="#61DBFF" />
-              <circle cx="190" cy="53" r="5" fill="#61DBFF" />
-              <circle cx="377" cy="56" r="5" fill="#61DBFF" />
-              <circle cx="573" cy="56" r="5" fill="#61DBFF" />
-              <path d="M1326 48C1171.5 48 745 32.5 705.5 1.5" stroke="url(#paint4_linear_1104_101)" stroke-width="2" />
-              <path d="M1148 53.5C990.5 53.5 749.5 45.5 687 3" stroke="url(#paint5_linear_1104_101)" stroke-width="2" />
-              <path d="M959.5 56C802 56 678.5 28 675.5 3.5" stroke="url(#paint6_linear_1104_101)" stroke-width="2" />
-              <path d="M764 54C728 48 690.5 37.5 669 8" stroke="url(#paint7_linear_1104_101)" stroke-width="2" />
-              <path d="M1326 48C1171.5 48 745 32.5 705.5 1.5" fill="none"
-              class="g-rect-fill-re" stroke="#36f4fb" />
-              <path d="M1148 53.5C990.5 53.5 749.5 45.5 687 3" fill="none"
-              class="g-rect-fill-re" stroke="#36f4fb" />
-              <path d="M959.5 56C802 56 678.5 28 675.5 3.5" fill="none"
-              class="g-rect-fill-re" stroke="#36f4fb" />
-              <path d="M764 54C728 48 690.5 37.5 669 8" fill="none"
-              class="g-rect-fill-re" stroke="#36f4fb" />
-              <circle cx="5" cy="5" r="5" transform="matrix(-1 0 0 1 1336 43)" fill="#61DBFF" />
-              <circle cx="5" cy="5" r="5" transform="matrix(-1 0 0 1 1151 48)" fill="#61DBFF" />
-              <circle cx="5" cy="5" r="5" transform="matrix(-1 0 0 1 964 51)" fill="#61DBFF" />
-              <circle cx="5" cy="5" r="5" transform="matrix(-1 0 0 1 768 51)" fill="#61DBFF" />
-              <defs>
-                <linearGradient id="paint0_linear_1104_101" x1="7.5" y1="23.9999" x2="696" y2="-81.5"
-                  gradientUnits="userSpaceOnUse">
-                  <stop offset="0.416667" stop-color="#00D5FF" />
-                  <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
-                </linearGradient>
-                <linearGradient id="paint1_linear_1104_101" x1="179" y1="36.9996" x2="867.5" y2="-68.5003"
-                  gradientUnits="userSpaceOnUse">
-                  <stop offset="0.416667" stop-color="#00D5FF" />
-                  <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
-                </linearGradient>
-                <linearGradient id="paint2_linear_1104_101" x1="189" y1="42.9997" x2="877.5" y2="-62.5002"
-                  gradientUnits="userSpaceOnUse">
-                  <stop offset="0.416667" stop-color="#00D5FF" />
-                  <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
-                </linearGradient>
-                <linearGradient id="paint3_linear_1104_101" x1="198.5" y1="47.5" x2="887" y2="-57.9998"
-                  gradientUnits="userSpaceOnUse">
-                  <stop offset="0.416667" stop-color="#00D5FF" />
-                  <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
-                </linearGradient>
-                <linearGradient id="paint4_linear_1104_101" x1="1328.5" y1="23.9999" x2="640" y2="-81.5"
-                  gradientUnits="userSpaceOnUse">
-                  <stop offset="0.416667" stop-color="#00D5FF" />
-                  <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
-                </linearGradient>
-                <linearGradient id="paint5_linear_1104_101" x1="1157" y1="36.9996" x2="468.5" y2="-68.5003"
-                  gradientUnits="userSpaceOnUse">
-                  <stop offset="0.416667" stop-color="#00D5FF" />
-                  <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
-                </linearGradient>
-                <linearGradient id="paint6_linear_1104_101" x1="1147" y1="42.9997" x2="458.5" y2="-62.5002"
-                  gradientUnits="userSpaceOnUse">
-                  <stop offset="0.416667" stop-color="#00D5FF" />
-                  <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
-                </linearGradient>
-                <linearGradient id="paint7_linear_1104_101" x1="1137.5" y1="47.5" x2="449" y2="-57.9998"
-                  gradientUnits="userSpaceOnUse">
-                  <stop offset="0.416667" stop-color="#00D5FF" />
-                  <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
-                </linearGradient>
-              </defs>
-            </svg>
-          </div>
+        <div class="line-stream"></div>
+        <div class="line-bottom">
+          <svg
+            width="1336"
+            height="61"
+            viewBox="0 0 1336 61"
+            fill="none"
+            xmlns="http://www.w3.org/2000/svg"
+          >
+            <path
+              d="M10 48C164.5 48 591 32.5 630.5 1.5"
+              stroke="url(#paint0_linear_1104_101)"
+              stroke-width="2"
+            />
+            <path
+              d="M188 53.5C345.5 53.5 586.5 45.5 649 3"
+              stroke="url(#paint1_linear_1104_101)"
+              stroke-width="2"
+            />
+            <path
+              d="M376.5 56C534 56 657.5 28 660.5 3.5"
+              stroke="url(#paint2_linear_1104_101)"
+              stroke-width="2"
+            />
+            <path
+              d="M572 54C608 48 645.5 37.5 667 8"
+              stroke="url(#paint3_linear_1104_101)"
+              stroke-width="2"
+            />
+            <path
+              d="M10 48C164.5 48 591 32.5 630.5 1.5"
+              fill="none"
+              class="g-rect-fill-re"
+              stroke="#36f4fb"
+            />
+            <path
+              d="M188 53.5C345.5 53.5 586.5 45.5 649 3"
+              fill="none"
+              class="g-rect-fill-re"
+              stroke="#36f4fb"
+            />
+            <path
+              d="M376.5 56C534 56 657.5 28 660.5 3.5"
+              fill="none"
+              class="g-rect-fill-re"
+              stroke="#36f4fb"
+            />
+            <path
+              d="M572 54C608 48 645.5 37.5 667 8"
+              fill="none"
+              class="g-rect-fill-re"
+              stroke="#36f4fb"
+            />
+            <circle cx="5" cy="48" r="5" fill="#61DBFF" />
+            <circle cx="190" cy="53" r="5" fill="#61DBFF" />
+            <circle cx="377" cy="56" r="5" fill="#61DBFF" />
+            <circle cx="573" cy="56" r="5" fill="#61DBFF" />
+            <path
+              d="M1326 48C1171.5 48 745 32.5 705.5 1.5"
+              stroke="url(#paint4_linear_1104_101)"
+              stroke-width="2"
+            />
+            <path
+              d="M1148 53.5C990.5 53.5 749.5 45.5 687 3"
+              stroke="url(#paint5_linear_1104_101)"
+              stroke-width="2"
+            />
+            <path
+              d="M959.5 56C802 56 678.5 28 675.5 3.5"
+              stroke="url(#paint6_linear_1104_101)"
+              stroke-width="2"
+            />
+            <path
+              d="M764 54C728 48 690.5 37.5 669 8"
+              stroke="url(#paint7_linear_1104_101)"
+              stroke-width="2"
+            />
+            <path
+              d="M1326 48C1171.5 48 745 32.5 705.5 1.5"
+              fill="none"
+              class="g-rect-fill-re"
+              stroke="#36f4fb"
+            />
+            <path
+              d="M1148 53.5C990.5 53.5 749.5 45.5 687 3"
+              fill="none"
+              class="g-rect-fill-re"
+              stroke="#36f4fb"
+            />
+            <path
+              d="M959.5 56C802 56 678.5 28 675.5 3.5"
+              fill="none"
+              class="g-rect-fill-re"
+              stroke="#36f4fb"
+            />
+            <path
+              d="M764 54C728 48 690.5 37.5 669 8"
+              fill="none"
+              class="g-rect-fill-re"
+              stroke="#36f4fb"
+            />
+            <circle
+              cx="5"
+              cy="5"
+              r="5"
+              transform="matrix(-1 0 0 1 1336 43)"
+              fill="#61DBFF"
+            />
+            <circle
+              cx="5"
+              cy="5"
+              r="5"
+              transform="matrix(-1 0 0 1 1151 48)"
+              fill="#61DBFF"
+            />
+            <circle
+              cx="5"
+              cy="5"
+              r="5"
+              transform="matrix(-1 0 0 1 964 51)"
+              fill="#61DBFF"
+            />
+            <circle
+              cx="5"
+              cy="5"
+              r="5"
+              transform="matrix(-1 0 0 1 768 51)"
+              fill="#61DBFF"
+            />
+            <defs>
+              <linearGradient
+                id="paint0_linear_1104_101"
+                x1="7.5"
+                y1="23.9999"
+                x2="696"
+                y2="-81.5"
+                gradientUnits="userSpaceOnUse"
+              >
+                <stop offset="0.416667" stop-color="#00D5FF" />
+                <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
+              </linearGradient>
+              <linearGradient
+                id="paint1_linear_1104_101"
+                x1="179"
+                y1="36.9996"
+                x2="867.5"
+                y2="-68.5003"
+                gradientUnits="userSpaceOnUse"
+              >
+                <stop offset="0.416667" stop-color="#00D5FF" />
+                <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
+              </linearGradient>
+              <linearGradient
+                id="paint2_linear_1104_101"
+                x1="189"
+                y1="42.9997"
+                x2="877.5"
+                y2="-62.5002"
+                gradientUnits="userSpaceOnUse"
+              >
+                <stop offset="0.416667" stop-color="#00D5FF" />
+                <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
+              </linearGradient>
+              <linearGradient
+                id="paint3_linear_1104_101"
+                x1="198.5"
+                y1="47.5"
+                x2="887"
+                y2="-57.9998"
+                gradientUnits="userSpaceOnUse"
+              >
+                <stop offset="0.416667" stop-color="#00D5FF" />
+                <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
+              </linearGradient>
+              <linearGradient
+                id="paint4_linear_1104_101"
+                x1="1328.5"
+                y1="23.9999"
+                x2="640"
+                y2="-81.5"
+                gradientUnits="userSpaceOnUse"
+              >
+                <stop offset="0.416667" stop-color="#00D5FF" />
+                <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
+              </linearGradient>
+              <linearGradient
+                id="paint5_linear_1104_101"
+                x1="1157"
+                y1="36.9996"
+                x2="468.5"
+                y2="-68.5003"
+                gradientUnits="userSpaceOnUse"
+              >
+                <stop offset="0.416667" stop-color="#00D5FF" />
+                <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
+              </linearGradient>
+              <linearGradient
+                id="paint6_linear_1104_101"
+                x1="1147"
+                y1="42.9997"
+                x2="458.5"
+                y2="-62.5002"
+                gradientUnits="userSpaceOnUse"
+              >
+                <stop offset="0.416667" stop-color="#00D5FF" />
+                <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
+              </linearGradient>
+              <linearGradient
+                id="paint7_linear_1104_101"
+                x1="1137.5"
+                y1="47.5"
+                x2="449"
+                y2="-57.9998"
+                gradientUnits="userSpaceOnUse"
+              >
+                <stop offset="0.416667" stop-color="#00D5FF" />
+                <stop offset="1" stop-color="#00D5FF" stop-opacity="0" />
+              </linearGradient>
+            </defs>
+          </svg>
+        </div>
         <!-- 标签 -->
         <div style="display: flex">
           <div
@@ -290,15 +502,23 @@
       <canvas class="rain rain1"></canvas>
       <canvas class="rain rain2"></canvas>
     </div>
+    <basic-modal
+      @close="onClose"
+      top="120px"
+      width="700px"
+      ref="basicInfoModal"
+      name="用户登录"
+    >
+      <loginMulds ref="loginModuls" />
+    </basic-modal>
   </div>
 </template>
 
 <script>
 import { rainBg } from "./rain.js";
-
+import loginMulds from "./loginMulds.vue";
 export default {
-  name: "LoginPage",
-  components: {},
+  components: { loginMulds },
   data() {
     return {
       apps: [
@@ -368,7 +588,11 @@ export default {
   },
   methods: {
     ToHome() {
-      this.$router.push("/home");
+      // this.$router.push("/home");
+      this.showModal("basicInfoModal");
+    },
+    onClose() {
+      this.$refs.loginModuls.reset();
     },
   },
 };
@@ -505,12 +729,12 @@ export default {
 
 @media screen and (min-height: 800px) and (max-height: 1000px){
   .cicle3 {
-    top: 26%;
+    top: 24%;
   }
   .top-title {
     font-size: 35px;
   }
- 
+
   .center-title,
   .bottom-title {
     font-size: 30px;
@@ -665,7 +889,6 @@ export default {
         }
       }
 
-
       @keyframes ball2 {
         0% {
           transform: translateY(-50%);
@@ -689,8 +912,8 @@ export default {
 
       &:nth-child(2) {
         right: 9%;
-        top: 55%;
         transform: translateY(-50%);
+        top: 55%;
         animation-name: ball2;
         animation-duration: 5s;
         animation-delay: 0.5s;
@@ -700,8 +923,8 @@ export default {
 
       &:nth-child(3) {
         right: 23%;
-        top: 83%;
         transform: translateY(-10%);
+        top: 83%;
         animation-name: ball3;
         animation-duration: 5s;
         animation-delay: 0.5s;
@@ -831,5 +1054,5 @@ export default {
       margin: 0px 16px;
     }
   }
-}
+  }
 </style>

+ 179 - 0
app/src/views/login/loginMulds.vue

@@ -0,0 +1,179 @@
+<script>
+import { getLogin } from "../../api/index.js";
+export default {
+  data() {
+    return {
+      loginForm: {
+        username: "",
+        password: "",
+      },
+      loading: false,
+    };
+  },
+  methods: {
+    reset() {
+      this.loginForm.username = "";
+      this.loginForm.password = "";
+    },
+    handleLogin() {
+    
+      const params = {
+        username: this.loginForm.username,
+        password: this.loginForm.password,
+      };
+      if (this.loginForm.username == "") {
+         this.$message.error("请输入账号");
+         return
+      }
+      if (this.loginForm.password == "") {
+         this.$message.error("请输入密码");
+         return
+      }
+      this.loading = true;
+      getLogin(params).then((res) => {
+        if (res.data.code == 200) {
+          this.$message.success("登录成功");
+          sessionStorage.setItem("token", res.data.token);
+          this.loading = false;
+          this.$router.push("/home");
+        } 
+      }).catch(error=>{
+        this.$message.error(error.msg);
+        this.loading=false
+      });
+    },
+    addClass(){
+      return this.loading?'login-btn2 active':'login-btn2 '
+    }
+  },
+};
+</script>
+
+<template>
+  <div class="main">
+    <el-form ref="loginForm" :model="loginForm" class="login-form">
+      <!-- <h3 class="title">重庆消防现场执法检查系统</h3> -->
+      <!-- <div class="login-title">
+            <img src="@/assets/left.png" mode='widthFix' alt="">
+            <span>系统登录</span>
+            <img src="@/assets/right.png" mode='widthFix' alt="">
+          </div> -->
+      <el-form-item prop="username">
+        <el-input
+          v-model="loginForm.username"
+          type="text"
+          auto-complete="off"
+          placeholder="账号"
+        >
+          <div slot="prepend" class="d-flex a-center">
+            <div class="inp-text">账户</div>
+          </div>
+        </el-input>
+      </el-form-item>
+      <el-form-item prop="password" style="margin-bottom: 10px">
+        <el-input
+          v-model="loginForm.password"
+          type="password"
+          auto-complete="off"
+          placeholder="密码"
+          show-password
+          @keyup.enter.native="handleLogin"
+        >
+          <div slot="prepend" class="d-flex a-center">
+            <div class="inp-text">密码</div>
+          </div>
+        </el-input>
+      </el-form-item>
+      <!-- <span v-if="!loading">登 录</span> -->
+          <!-- <span v-else>登 录 中...</span> -->
+      <el-form-item style="width: 100%; margin-top: 40px">
+        <el-button
+          :loading="loading"
+          :class="addClass()"
+          size="medium"
+          type="primary"
+          style="width: 100%"
+          @click.native.prevent="handleLogin"
+        >
+        </el-button>
+     
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+
+<style scoped lang="less">
+.main {
+  width: 600px;
+  height: 400px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  //    background: url('../../assets/images/line-lo.png') no-repeat;
+  //    background-size: 100% 100%;
+  margin: auto;
+  border: 2px solid transparent;
+  position: relative;
+  animation: animateBorder 2.5s linear infinite;
+}
+@keyframes animateBorder {
+  0% {
+    border-image: linear-gradient(
+      to right,
+      rgba(23, 136, 203, 0.3) 0%,
+      #8ec5fc 100%
+    );
+    border-image-slice: 1;
+  }
+  50% {
+    border-image: linear-gradient(
+      to right,
+      #8ec5fc 0%,
+      rgba(23, 136, 203, 0.3) 100%
+    );
+    border-image-slice: 1;
+  }
+  100% {
+    border-image: linear-gradient(
+      to right,
+      rgba(23, 136, 203, 0.3) 0%,
+      #8ec5fc 100%
+    );
+    border-image-slice: 1;
+  }
+}
+/deep/.el-input__inner {
+  background: rgba(23, 136, 203, 0.3);
+  color: #fff;
+}
+.login-form {
+  width: 380px;
+}
+/deep/.el-input-group__prepend {
+  background: rgba(23, 136, 203, 0.3);
+}
+.login-btn2 {
+  // font-size: 16px;
+  height: 40px;
+  background: url('../../assets/images/login-btn4.png') no-repeat;
+  background-size: 100% 100%;
+}
+.login-btn2:hover{
+  background: url('../../assets/images/login-btn4.png') no-repeat;
+  background-size: 100% 100%;
+}
+.active{
+background: url('../../assets/images/loding.png') no-repeat;
+background-size: 100% 100%;
+}
+// /deep/input:-webkit-autofill {
+//   // -webkit-box-shadow: 0 0 0px 1000px rgba(23, 136, 203, 0.3) !important;
+// }
+// /deep/input:-webkit-autofill {
+//   -webkit-box-shadow: 0 0 0 1px rgb(225, 122, 122) inset !important;
+//   background-color: rgba(23, 136, 203, 0.3) ;
+// }
+/deep/.el-input-group__prepend {
+  color: #fff;
+}
+</style>

+ 6 - 3
utils/request.js

@@ -3,7 +3,7 @@ import axios from 'axios'
 // 创建一个axios实例
 const instance = axios.create({
   baseURL: 'http://183.66.101.53:8787/api'
-  // baseURL: 'http://172.20.16.134:8080'
+  // baseURL: 'http://192.168.31.129:8080'
   // baseURL: '/api'
 })
 
@@ -13,8 +13,8 @@ instance.interceptors.request.use(config => {
   /* 
 //     每一次请求的时候,往请求头(header)上添加一个token
 //   */
-//   const token = sessionStorage.getItem('token')
-//   config.headers.Authorization = token
+  const token = sessionStorage.getItem('token')
+  config.headers.Authorization = token
   return config
 }, err => {
   return Promise.reject(err)
@@ -22,6 +22,9 @@ instance.interceptors.request.use(config => {
 
 // 配置响应拦截器
 instance.interceptors.response.use(config => {
+  if(config.data.code==500){
+    return Promise.reject(config.data)
+  }
   return config
 }, err => {
   return Promise.reject(err)