seimin před 3 roky
rodič
revize
e43de1f79b
3 změnil soubory, kde provedl 345 přidání a 38 odebrání
  1. 219 4
      package-lock.json
  2. 1 0
      package.json
  3. 125 34
      src/views/Login.vue

+ 219 - 4
package-lock.json

@@ -2401,6 +2401,14 @@
2401 2401
             "js-base64": "^2.1.9",
2402 2402
             "source-map": "^0.5.6",
2403 2403
             "supports-color": "^3.2.3"
2404
+          },
2405
+          "dependencies": {
2406
+            "js-base64": {
2407
+              "version": "2.6.4",
2408
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
2409
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
2410
+              "dev": true
2411
+            }
2404 2412
           }
2405 2413
         },
2406 2414
         "source-map": {
@@ -2624,6 +2632,14 @@
2624 2632
             "js-base64": "^2.1.9",
2625 2633
             "source-map": "^0.5.6",
2626 2634
             "supports-color": "^3.2.3"
2635
+          },
2636
+          "dependencies": {
2637
+            "js-base64": {
2638
+              "version": "2.6.4",
2639
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
2640
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
2641
+              "dev": true
2642
+            }
2627 2643
           }
2628 2644
         },
2629 2645
         "source-map": {
@@ -5965,10 +5981,9 @@
5965 5981
       "optional": true
5966 5982
     },
5967 5983
     "js-base64": {
5968
-      "version": "2.5.2",
5969
-      "resolved": "https://registry.npm.taobao.org/js-base64/download/js-base64-2.5.2.tgz",
5970
-      "integrity": "sha1-MTtidN2nGPcU0AszMLuubjjpAgk=",
5971
-      "dev": true
5984
+      "version": "3.6.1",
5985
+      "resolved": "https://registry.nlark.com/js-base64/download/js-base64-3.6.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-3.6.1.tgz",
5986
+      "integrity": "sha1-VVquOYt0aUtAN68filpiCdFw774="
5972 5987
     },
5973 5988
     "js-tokens": {
5974 5989
       "version": "3.0.2",
@@ -7424,6 +7439,14 @@
7424 7439
             "js-base64": "^2.1.9",
7425 7440
             "source-map": "^0.5.6",
7426 7441
             "supports-color": "^3.2.3"
7442
+          },
7443
+          "dependencies": {
7444
+            "js-base64": {
7445
+              "version": "2.6.4",
7446
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
7447
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7448
+              "dev": true
7449
+            }
7427 7450
           }
7428 7451
         },
7429 7452
         "source-map": {
@@ -7497,6 +7520,14 @@
7497 7520
             "js-base64": "^2.1.9",
7498 7521
             "source-map": "^0.5.6",
7499 7522
             "supports-color": "^3.2.3"
7523
+          },
7524
+          "dependencies": {
7525
+            "js-base64": {
7526
+              "version": "2.6.4",
7527
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
7528
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7529
+              "dev": true
7530
+            }
7500 7531
           }
7501 7532
         },
7502 7533
         "source-map": {
@@ -7569,6 +7600,14 @@
7569 7600
             "js-base64": "^2.1.9",
7570 7601
             "source-map": "^0.5.6",
7571 7602
             "supports-color": "^3.2.3"
7603
+          },
7604
+          "dependencies": {
7605
+            "js-base64": {
7606
+              "version": "2.6.4",
7607
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
7608
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7609
+              "dev": true
7610
+            }
7572 7611
           }
7573 7612
         },
7574 7613
         "source-map": {
@@ -7640,6 +7679,14 @@
7640 7679
             "js-base64": "^2.1.9",
7641 7680
             "source-map": "^0.5.6",
7642 7681
             "supports-color": "^3.2.3"
7682
+          },
7683
+          "dependencies": {
7684
+            "js-base64": {
7685
+              "version": "2.6.4",
7686
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
7687
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7688
+              "dev": true
7689
+            }
7643 7690
           }
7644 7691
         },
7645 7692
         "source-map": {
@@ -7711,6 +7758,14 @@
7711 7758
             "js-base64": "^2.1.9",
7712 7759
             "source-map": "^0.5.6",
7713 7760
             "supports-color": "^3.2.3"
7761
+          },
7762
+          "dependencies": {
7763
+            "js-base64": {
7764
+              "version": "2.6.4",
7765
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
7766
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7767
+              "dev": true
7768
+            }
7714 7769
           }
7715 7770
         },
7716 7771
         "source-map": {
@@ -7782,6 +7837,14 @@
7782 7837
             "js-base64": "^2.1.9",
7783 7838
             "source-map": "^0.5.6",
7784 7839
             "supports-color": "^3.2.3"
7840
+          },
7841
+          "dependencies": {
7842
+            "js-base64": {
7843
+              "version": "2.6.4",
7844
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
7845
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7846
+              "dev": true
7847
+            }
7785 7848
           }
7786 7849
         },
7787 7850
         "source-map": {
@@ -7853,6 +7916,14 @@
7853 7916
             "js-base64": "^2.1.9",
7854 7917
             "source-map": "^0.5.6",
7855 7918
             "supports-color": "^3.2.3"
7919
+          },
7920
+          "dependencies": {
7921
+            "js-base64": {
7922
+              "version": "2.6.4",
7923
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
7924
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7925
+              "dev": true
7926
+            }
7856 7927
           }
7857 7928
         },
7858 7929
         "source-map": {
@@ -7925,6 +7996,14 @@
7925 7996
             "js-base64": "^2.1.9",
7926 7997
             "source-map": "^0.5.6",
7927 7998
             "supports-color": "^3.2.3"
7999
+          },
8000
+          "dependencies": {
8001
+            "js-base64": {
8002
+              "version": "2.6.4",
8003
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
8004
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8005
+              "dev": true
8006
+            }
7928 8007
           }
7929 8008
         },
7930 8009
         "source-map": {
@@ -7996,6 +8075,14 @@
7996 8075
             "js-base64": "^2.1.9",
7997 8076
             "source-map": "^0.5.6",
7998 8077
             "supports-color": "^3.2.3"
8078
+          },
8079
+          "dependencies": {
8080
+            "js-base64": {
8081
+              "version": "2.6.4",
8082
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
8083
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8084
+              "dev": true
8085
+            }
7999 8086
           }
8000 8087
         },
8001 8088
         "source-map": {
@@ -8187,6 +8274,14 @@
8187 8274
             "js-base64": "^2.1.9",
8188 8275
             "source-map": "^0.5.6",
8189 8276
             "supports-color": "^3.2.3"
8277
+          },
8278
+          "dependencies": {
8279
+            "js-base64": {
8280
+              "version": "2.6.4",
8281
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
8282
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8283
+              "dev": true
8284
+            }
8190 8285
           }
8191 8286
         },
8192 8287
         "source-map": {
@@ -8258,6 +8353,14 @@
8258 8353
             "js-base64": "^2.1.9",
8259 8354
             "source-map": "^0.5.6",
8260 8355
             "supports-color": "^3.2.3"
8356
+          },
8357
+          "dependencies": {
8358
+            "js-base64": {
8359
+              "version": "2.6.4",
8360
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
8361
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8362
+              "dev": true
8363
+            }
8261 8364
           }
8262 8365
         },
8263 8366
         "source-map": {
@@ -8343,6 +8446,14 @@
8343 8446
             "js-base64": "^2.1.9",
8344 8447
             "source-map": "^0.5.6",
8345 8448
             "supports-color": "^3.2.3"
8449
+          },
8450
+          "dependencies": {
8451
+            "js-base64": {
8452
+              "version": "2.6.4",
8453
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
8454
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8455
+              "dev": true
8456
+            }
8346 8457
           }
8347 8458
         },
8348 8459
         "source-map": {
@@ -8422,6 +8533,14 @@
8422 8533
             "js-base64": "^2.1.9",
8423 8534
             "source-map": "^0.5.6",
8424 8535
             "supports-color": "^3.2.3"
8536
+          },
8537
+          "dependencies": {
8538
+            "js-base64": {
8539
+              "version": "2.6.4",
8540
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
8541
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8542
+              "dev": true
8543
+            }
8425 8544
           }
8426 8545
         },
8427 8546
         "source-map": {
@@ -8494,6 +8613,14 @@
8494 8613
             "js-base64": "^2.1.9",
8495 8614
             "source-map": "^0.5.6",
8496 8615
             "supports-color": "^3.2.3"
8616
+          },
8617
+          "dependencies": {
8618
+            "js-base64": {
8619
+              "version": "2.6.4",
8620
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
8621
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8622
+              "dev": true
8623
+            }
8497 8624
           }
8498 8625
         },
8499 8626
         "source-map": {
@@ -8568,6 +8695,14 @@
8568 8695
             "js-base64": "^2.1.9",
8569 8696
             "source-map": "^0.5.6",
8570 8697
             "supports-color": "^3.2.3"
8698
+          },
8699
+          "dependencies": {
8700
+            "js-base64": {
8701
+              "version": "2.6.4",
8702
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
8703
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8704
+              "dev": true
8705
+            }
8571 8706
           }
8572 8707
         },
8573 8708
         "source-map": {
@@ -8642,6 +8777,14 @@
8642 8777
             "js-base64": "^2.1.9",
8643 8778
             "source-map": "^0.5.6",
8644 8779
             "supports-color": "^3.2.3"
8780
+          },
8781
+          "dependencies": {
8782
+            "js-base64": {
8783
+              "version": "2.6.4",
8784
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
8785
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8786
+              "dev": true
8787
+            }
8645 8788
           }
8646 8789
         },
8647 8790
         "source-map": {
@@ -8752,6 +8895,14 @@
8752 8895
             "js-base64": "^2.1.9",
8753 8896
             "source-map": "^0.5.6",
8754 8897
             "supports-color": "^3.2.3"
8898
+          },
8899
+          "dependencies": {
8900
+            "js-base64": {
8901
+              "version": "2.6.4",
8902
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
8903
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8904
+              "dev": true
8905
+            }
8755 8906
           }
8756 8907
         },
8757 8908
         "source-map": {
@@ -9038,6 +9189,14 @@
9038 9189
             "js-base64": "^2.1.9",
9039 9190
             "source-map": "^0.5.6",
9040 9191
             "supports-color": "^3.2.3"
9192
+          },
9193
+          "dependencies": {
9194
+            "js-base64": {
9195
+              "version": "2.6.4",
9196
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
9197
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9198
+              "dev": true
9199
+            }
9041 9200
           }
9042 9201
         },
9043 9202
         "source-map": {
@@ -9142,6 +9301,14 @@
9142 9301
             "js-base64": "^2.1.9",
9143 9302
             "source-map": "^0.5.6",
9144 9303
             "supports-color": "^3.2.3"
9304
+          },
9305
+          "dependencies": {
9306
+            "js-base64": {
9307
+              "version": "2.6.4",
9308
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
9309
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9310
+              "dev": true
9311
+            }
9145 9312
           }
9146 9313
         },
9147 9314
         "source-map": {
@@ -9214,6 +9381,14 @@
9214 9381
             "js-base64": "^2.1.9",
9215 9382
             "source-map": "^0.5.6",
9216 9383
             "supports-color": "^3.2.3"
9384
+          },
9385
+          "dependencies": {
9386
+            "js-base64": {
9387
+              "version": "2.6.4",
9388
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
9389
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9390
+              "dev": true
9391
+            }
9217 9392
           }
9218 9393
         },
9219 9394
         "source-map": {
@@ -9285,6 +9460,14 @@
9285 9460
             "js-base64": "^2.1.9",
9286 9461
             "source-map": "^0.5.6",
9287 9462
             "supports-color": "^3.2.3"
9463
+          },
9464
+          "dependencies": {
9465
+            "js-base64": {
9466
+              "version": "2.6.4",
9467
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
9468
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9469
+              "dev": true
9470
+            }
9288 9471
           }
9289 9472
         },
9290 9473
         "source-map": {
@@ -9358,6 +9541,14 @@
9358 9541
             "js-base64": "^2.1.9",
9359 9542
             "source-map": "^0.5.6",
9360 9543
             "supports-color": "^3.2.3"
9544
+          },
9545
+          "dependencies": {
9546
+            "js-base64": {
9547
+              "version": "2.6.4",
9548
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
9549
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9550
+              "dev": true
9551
+            }
9361 9552
           }
9362 9553
         },
9363 9554
         "source-map": {
@@ -9443,6 +9634,14 @@
9443 9634
             "js-base64": "^2.1.9",
9444 9635
             "source-map": "^0.5.6",
9445 9636
             "supports-color": "^3.2.3"
9637
+          },
9638
+          "dependencies": {
9639
+            "js-base64": {
9640
+              "version": "2.6.4",
9641
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
9642
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9643
+              "dev": true
9644
+            }
9446 9645
           }
9447 9646
         },
9448 9647
         "source-map": {
@@ -9516,6 +9715,14 @@
9516 9715
             "js-base64": "^2.1.9",
9517 9716
             "source-map": "^0.5.6",
9518 9717
             "supports-color": "^3.2.3"
9718
+          },
9719
+          "dependencies": {
9720
+            "js-base64": {
9721
+              "version": "2.6.4",
9722
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
9723
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9724
+              "dev": true
9725
+            }
9519 9726
           }
9520 9727
         },
9521 9728
         "source-map": {
@@ -9608,6 +9815,14 @@
9608 9815
             "js-base64": "^2.1.9",
9609 9816
             "source-map": "^0.5.6",
9610 9817
             "supports-color": "^3.2.3"
9818
+          },
9819
+          "dependencies": {
9820
+            "js-base64": {
9821
+              "version": "2.6.4",
9822
+              "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz",
9823
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9824
+              "dev": true
9825
+            }
9611 9826
           }
9612 9827
         },
9613 9828
         "source-map": {

+ 1 - 0
package.json

@@ -12,6 +12,7 @@
12 12
   "dependencies": {
13 13
     "axios": "^0.18.0",
14 14
     "cube-ui": "^1.12.10",
15
+    "js-base64": "^3.6.1",
15 16
     "less": "^3.9.0",
16 17
     "less-loader": "^4.1.0",
17 18
     "lib-flexible": "^0.3.2",

+ 125 - 34
src/views/Login.vue

@@ -1,17 +1,43 @@
1 1
 <template>
2
-  <div class="fle bgColor">
3
-    <!-- <div class="login">登录中</div> -->
4
-    <load-ing></load-ing>
2
+  <div class="fle bgColor" v-if="!isSSo">
3
+    <load-ing v-show="requesterLgoinType == 'wechat'"></load-ing>
4
+    <h2
5
+      v-if="requesterLgoinType == 'web'"
6
+      style="font-size: 0.36rem; margin-bottom: 0.36rem; font-weight: 700"
7
+    >
8
+      网络与信息化运维管理系统
9
+    </h2>
10
+    <div v-if="requesterLgoinType == 'web'" style="width: 5rem">
11
+      <cube-input
12
+        v-model="zhanghao"
13
+        placeholder="您的账号为工号或学号"
14
+      ></cube-input>
15
+      <br />
16
+      <cube-input
17
+        v-model="mima"
18
+        type="password"
19
+        placeholder="您的初始密码为学号或工号后四位"
20
+      ></cube-input>
21
+      <br />
22
+      <cube-button @click="zlogin()" style="background: #005395"
23
+        >登录</cube-button
24
+      >
25
+    </div>
5 26
   </div>
6 27
 </template>
7 28
 
8 29
 <script>
9 30
 // 注意事项:个人微信需要关注微工作台,否则会导致没有userId(userId为openID)登录失败
10
-
31
+import { decode } from "js-base64";
11 32
 import LoadIng from "./../views/loading.vue";
12 33
 export default {
13 34
   data() {
14
-    return {};
35
+    return {
36
+      zhanghao: "",
37
+      mima: "",
38
+      requesterLgoinType: "",
39
+      isSSo: true // 是否单点登录
40
+    };
15 41
   },
16 42
   components: {
17 43
     LoadIng
@@ -21,13 +47,9 @@ export default {
21 47
     login() {
22 48
       var that = this;
23 49
       that.$http.post("service/auth/wechatlogin", {}).then(function(res) {
24
-        // alert(1);
25
-        // alert(JSON.stringify(res.data));
26 50
         if (res.data.url) {
27
-          // alert("拿到了url(code)");
28 51
           window.location.href = res.data.url;
29 52
         } else {
30
-          // alert("登录成功,即将跳转");
31 53
           if (res.data.user) {
32 54
             that.getConfig();
33 55
             localStorage.setItem(
@@ -38,7 +60,11 @@ export default {
38 60
               "login_requester",
39 61
               JSON.stringify(res.data.user.requester)
40 62
             );
41
-            that.$router.push({ path: "/main" });
63
+            if (this.isSSo) {
64
+              location.href = "http://" + location.host + "/user/#/main/indes";
65
+            } else {
66
+              this.$router.push({ path: "/main" });
67
+            }
42 68
           }
43 69
         }
44 70
       });
@@ -59,7 +85,7 @@ export default {
59 85
         // alert("2--传code参数:");
60 86
         // alert(JSON.stringify(code));
61 87
         that.$http.post("service/auth/wechatlogin2", code).then(function(res) {
62
-          if (res.data.state==200) {
88
+          if (res.data.state == 200) {
63 89
             // alert(3);
64 90
             // alert(JSON.stringify(res.data));
65 91
             if (res.data.user) {
@@ -72,20 +98,29 @@ export default {
72 98
                 "login_requester",
73 99
                 JSON.stringify(res.data.user.requester)
74 100
               );
75
-              that.$router.push({ path: "/main" });
101
+              if (this.isSSo) {
102
+                location.href =
103
+                  "http://" + location.host + "/user/#/main/indes";
104
+              } else {
105
+                this.$router.push({ path: "/main" });
106
+              }
76 107
             }
77
-          }else if(res.data.state == 501){
78
-            that.$createDialog({
79
-              type: 'alert',
80
-              title: '您的账号被删除,请联系管理员',
81
-              icon: 'cubeic-alert'
82
-            }).show()
83
-          }else{
84
-            that.$createDialog({
85
-              type: 'alert',
86
-              title: res.data.remarks,
87
-              icon: 'cubeic-alert'
88
-            }).show()
108
+          } else if (res.data.state == 501) {
109
+            that
110
+              .$createDialog({
111
+                type: "alert",
112
+                title: "您的账号被删除,请联系管理员",
113
+                icon: "cubeic-alert"
114
+              })
115
+              .show();
116
+          } else {
117
+            that
118
+              .$createDialog({
119
+                type: "alert",
120
+                title: res.data.remarks,
121
+                icon: "cubeic-alert"
122
+              })
123
+              .show();
89 124
           }
90 125
         });
91 126
       }
@@ -126,20 +161,80 @@ export default {
126 161
         })
127 162
         .then(function(res) {
128 163
           console.log(res);
129
-          // if (res.data && res.data.state == 200) {
130 164
           localStorage.setItem(
131 165
             "valConfig",
132 166
             JSON.stringify(res.data.list[0].valueconfig)
133 167
           );
134
-          // localStorage.setItem("valConfig", 2);
135
-          //   that.$router.push({ path: "/main" });
136
-          // }
137 168
         });
169
+    },
170
+    // 获取报修人登录方式
171
+    getLoginType() {
172
+      this.$http.post("service/wechat/getLoginType", {}).then(result => {
173
+        if (result.data.status == 200) {
174
+          this.requesterLgoinType = result.data.data;
175
+          window.localStorage.setItem(
176
+            "requesterLgoinType",
177
+            this.requesterLgoinType
178
+          );
179
+          if (this.requesterLgoinType == "wechat") {
180
+            this.getCode();
181
+          } else if (this.requesterLgoinType == "web") {
182
+            // this.$router.push({ path: "/login" });
183
+          }
184
+        }
185
+      });
186
+    },
187
+    // 账号密码登录
188
+    zlogin() {
189
+      console.log(this);
190
+      var that = this;
191
+      var ssoStr = "";
192
+      var ssoJson;
193
+      if (this.isSSo) {
194
+        ssoStr = location.search
195
+          .replace("?", "")
196
+          .split("&")[0]
197
+          .split("=")[1];
198
+        ssoStr = decode(decodeURIComponent(ssoStr));
199
+        ssoJson = JSON.parse(ssoStr);
200
+      }
201
+      var postData = this.isSSo
202
+        ? { username: ssoJson.a, password: ssoJson.u, t: false }
203
+        : { username: this.zhanghao, password: this.mima };
204
+      this.$http.post("service/auth/loginEncrypt", postData).then(res => {
205
+        that.loading = false;
206
+        if (res.data && res.data.state == 200) {
207
+          this.getConfig();
208
+          localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
209
+          localStorage.setItem(
210
+            "login_requester",
211
+            JSON.stringify(res.data.data.requester)
212
+          );
213
+          if (this.isSSo) {
214
+            location.href = "http://" + location.host + "/user/#/main/indes";
215
+          } else {
216
+            this.$router.push({ path: "/main" });
217
+          }
218
+        } else {
219
+          that
220
+            .$createDialog({
221
+              type: "alert",
222
+              title: "系统错误",
223
+              content: "请稍后再试",
224
+              icon: "cubeic-wrong",
225
+              color: "red"
226
+            })
227
+            .show();
228
+        }
229
+      });
138 230
     }
139 231
   },
140 232
   created() {
141
-    this.getCode();
142
-    // this.login2();
233
+    this.isSSo = location.search.length > 0;
234
+    if (this.isSSo) {
235
+      this.zlogin();
236
+    }
237
+    this.getLoginType();
143 238
   }
144 239
 };
145 240
 </script>
@@ -187,7 +282,3 @@ input:focus {
187 282
   border-radius: 10px;
188 283
 }
189 284
 </style>
190
-
191
-
192
-
193
-