Browse Source

单点登录

seimin 3 years ago
parent
commit
8fc115b11a
3 changed files with 281 additions and 46 deletions
  1. 219 4
      package-lock.json
  2. 1 0
      package.json
  3. 61 42
      src/views/Login.vue

+ 219 - 4
package-lock.json

@@ -2287,6 +2287,14 @@
2287 2287
             "js-base64": "^2.1.9",
2288 2288
             "source-map": "^0.5.6",
2289 2289
             "supports-color": "^3.2.3"
2290
+          },
2291
+          "dependencies": {
2292
+            "js-base64": {
2293
+              "version": "2.6.4",
2294
+              "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",
2295
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
2296
+              "dev": true
2297
+            }
2290 2298
           }
2291 2299
         },
2292 2300
         "source-map": {
@@ -2492,6 +2500,14 @@
2492 2500
             "js-base64": "^2.1.9",
2493 2501
             "source-map": "^0.5.6",
2494 2502
             "supports-color": "^3.2.3"
2503
+          },
2504
+          "dependencies": {
2505
+            "js-base64": {
2506
+              "version": "2.6.4",
2507
+              "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",
2508
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
2509
+              "dev": true
2510
+            }
2495 2511
           }
2496 2512
         },
2497 2513
         "source-map": {
@@ -5642,10 +5658,9 @@
5642 5658
       "dev": true
5643 5659
     },
5644 5660
     "js-base64": {
5645
-      "version": "2.5.1",
5646
-      "resolved": "https://registry.npm.taobao.org/js-base64/download/js-base64-2.5.1.tgz",
5647
-      "integrity": "sha1-Hvo57yxfeYC7F4St5KivLeMpESE=",
5648
-      "dev": true
5661
+      "version": "3.6.1",
5662
+      "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",
5663
+      "integrity": "sha1-VVquOYt0aUtAN68filpiCdFw774="
5649 5664
     },
5650 5665
     "js-tokens": {
5651 5666
       "version": "3.0.2",
@@ -7063,6 +7078,14 @@
7063 7078
             "js-base64": "^2.1.9",
7064 7079
             "source-map": "^0.5.6",
7065 7080
             "supports-color": "^3.2.3"
7081
+          },
7082
+          "dependencies": {
7083
+            "js-base64": {
7084
+              "version": "2.6.4",
7085
+              "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",
7086
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7087
+              "dev": true
7088
+            }
7066 7089
           }
7067 7090
         },
7068 7091
         "source-map": {
@@ -7136,6 +7159,14 @@
7136 7159
             "js-base64": "^2.1.9",
7137 7160
             "source-map": "^0.5.6",
7138 7161
             "supports-color": "^3.2.3"
7162
+          },
7163
+          "dependencies": {
7164
+            "js-base64": {
7165
+              "version": "2.6.4",
7166
+              "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",
7167
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7168
+              "dev": true
7169
+            }
7139 7170
           }
7140 7171
         },
7141 7172
         "source-map": {
@@ -7208,6 +7239,14 @@
7208 7239
             "js-base64": "^2.1.9",
7209 7240
             "source-map": "^0.5.6",
7210 7241
             "supports-color": "^3.2.3"
7242
+          },
7243
+          "dependencies": {
7244
+            "js-base64": {
7245
+              "version": "2.6.4",
7246
+              "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",
7247
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7248
+              "dev": true
7249
+            }
7211 7250
           }
7212 7251
         },
7213 7252
         "source-map": {
@@ -7279,6 +7318,14 @@
7279 7318
             "js-base64": "^2.1.9",
7280 7319
             "source-map": "^0.5.6",
7281 7320
             "supports-color": "^3.2.3"
7321
+          },
7322
+          "dependencies": {
7323
+            "js-base64": {
7324
+              "version": "2.6.4",
7325
+              "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",
7326
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7327
+              "dev": true
7328
+            }
7282 7329
           }
7283 7330
         },
7284 7331
         "source-map": {
@@ -7350,6 +7397,14 @@
7350 7397
             "js-base64": "^2.1.9",
7351 7398
             "source-map": "^0.5.6",
7352 7399
             "supports-color": "^3.2.3"
7400
+          },
7401
+          "dependencies": {
7402
+            "js-base64": {
7403
+              "version": "2.6.4",
7404
+              "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",
7405
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7406
+              "dev": true
7407
+            }
7353 7408
           }
7354 7409
         },
7355 7410
         "source-map": {
@@ -7421,6 +7476,14 @@
7421 7476
             "js-base64": "^2.1.9",
7422 7477
             "source-map": "^0.5.6",
7423 7478
             "supports-color": "^3.2.3"
7479
+          },
7480
+          "dependencies": {
7481
+            "js-base64": {
7482
+              "version": "2.6.4",
7483
+              "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",
7484
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7485
+              "dev": true
7486
+            }
7424 7487
           }
7425 7488
         },
7426 7489
         "source-map": {
@@ -7492,6 +7555,14 @@
7492 7555
             "js-base64": "^2.1.9",
7493 7556
             "source-map": "^0.5.6",
7494 7557
             "supports-color": "^3.2.3"
7558
+          },
7559
+          "dependencies": {
7560
+            "js-base64": {
7561
+              "version": "2.6.4",
7562
+              "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",
7563
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7564
+              "dev": true
7565
+            }
7495 7566
           }
7496 7567
         },
7497 7568
         "source-map": {
@@ -7564,6 +7635,14 @@
7564 7635
             "js-base64": "^2.1.9",
7565 7636
             "source-map": "^0.5.6",
7566 7637
             "supports-color": "^3.2.3"
7638
+          },
7639
+          "dependencies": {
7640
+            "js-base64": {
7641
+              "version": "2.6.4",
7642
+              "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",
7643
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7644
+              "dev": true
7645
+            }
7567 7646
           }
7568 7647
         },
7569 7648
         "source-map": {
@@ -7635,6 +7714,14 @@
7635 7714
             "js-base64": "^2.1.9",
7636 7715
             "source-map": "^0.5.6",
7637 7716
             "supports-color": "^3.2.3"
7717
+          },
7718
+          "dependencies": {
7719
+            "js-base64": {
7720
+              "version": "2.6.4",
7721
+              "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",
7722
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7723
+              "dev": true
7724
+            }
7638 7725
           }
7639 7726
         },
7640 7727
         "source-map": {
@@ -7862,6 +7949,14 @@
7862 7949
             "js-base64": "^2.1.9",
7863 7950
             "source-map": "^0.5.6",
7864 7951
             "supports-color": "^3.2.3"
7952
+          },
7953
+          "dependencies": {
7954
+            "js-base64": {
7955
+              "version": "2.6.4",
7956
+              "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",
7957
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
7958
+              "dev": true
7959
+            }
7865 7960
           }
7866 7961
         },
7867 7962
         "source-map": {
@@ -7933,6 +8028,14 @@
7933 8028
             "js-base64": "^2.1.9",
7934 8029
             "source-map": "^0.5.6",
7935 8030
             "supports-color": "^3.2.3"
8031
+          },
8032
+          "dependencies": {
8033
+            "js-base64": {
8034
+              "version": "2.6.4",
8035
+              "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",
8036
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8037
+              "dev": true
8038
+            }
7936 8039
           }
7937 8040
         },
7938 8041
         "source-map": {
@@ -8018,6 +8121,14 @@
8018 8121
             "js-base64": "^2.1.9",
8019 8122
             "source-map": "^0.5.6",
8020 8123
             "supports-color": "^3.2.3"
8124
+          },
8125
+          "dependencies": {
8126
+            "js-base64": {
8127
+              "version": "2.6.4",
8128
+              "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",
8129
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8130
+              "dev": true
8131
+            }
8021 8132
           }
8022 8133
         },
8023 8134
         "source-map": {
@@ -8097,6 +8208,14 @@
8097 8208
             "js-base64": "^2.1.9",
8098 8209
             "source-map": "^0.5.6",
8099 8210
             "supports-color": "^3.2.3"
8211
+          },
8212
+          "dependencies": {
8213
+            "js-base64": {
8214
+              "version": "2.6.4",
8215
+              "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",
8216
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8217
+              "dev": true
8218
+            }
8100 8219
           }
8101 8220
         },
8102 8221
         "source-map": {
@@ -8169,6 +8288,14 @@
8169 8288
             "js-base64": "^2.1.9",
8170 8289
             "source-map": "^0.5.6",
8171 8290
             "supports-color": "^3.2.3"
8291
+          },
8292
+          "dependencies": {
8293
+            "js-base64": {
8294
+              "version": "2.6.4",
8295
+              "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",
8296
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8297
+              "dev": true
8298
+            }
8172 8299
           }
8173 8300
         },
8174 8301
         "source-map": {
@@ -8243,6 +8370,14 @@
8243 8370
             "js-base64": "^2.1.9",
8244 8371
             "source-map": "^0.5.6",
8245 8372
             "supports-color": "^3.2.3"
8373
+          },
8374
+          "dependencies": {
8375
+            "js-base64": {
8376
+              "version": "2.6.4",
8377
+              "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",
8378
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8379
+              "dev": true
8380
+            }
8246 8381
           }
8247 8382
         },
8248 8383
         "source-map": {
@@ -8317,6 +8452,14 @@
8317 8452
             "js-base64": "^2.1.9",
8318 8453
             "source-map": "^0.5.6",
8319 8454
             "supports-color": "^3.2.3"
8455
+          },
8456
+          "dependencies": {
8457
+            "js-base64": {
8458
+              "version": "2.6.4",
8459
+              "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",
8460
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8461
+              "dev": true
8462
+            }
8320 8463
           }
8321 8464
         },
8322 8465
         "source-map": {
@@ -8427,6 +8570,14 @@
8427 8570
             "js-base64": "^2.1.9",
8428 8571
             "source-map": "^0.5.6",
8429 8572
             "supports-color": "^3.2.3"
8573
+          },
8574
+          "dependencies": {
8575
+            "js-base64": {
8576
+              "version": "2.6.4",
8577
+              "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",
8578
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8579
+              "dev": true
8580
+            }
8430 8581
           }
8431 8582
         },
8432 8583
         "source-map": {
@@ -8712,6 +8863,14 @@
8712 8863
             "js-base64": "^2.1.9",
8713 8864
             "source-map": "^0.5.6",
8714 8865
             "supports-color": "^3.2.3"
8866
+          },
8867
+          "dependencies": {
8868
+            "js-base64": {
8869
+              "version": "2.6.4",
8870
+              "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",
8871
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8872
+              "dev": true
8873
+            }
8715 8874
           }
8716 8875
         },
8717 8876
         "source-map": {
@@ -8816,6 +8975,14 @@
8816 8975
             "js-base64": "^2.1.9",
8817 8976
             "source-map": "^0.5.6",
8818 8977
             "supports-color": "^3.2.3"
8978
+          },
8979
+          "dependencies": {
8980
+            "js-base64": {
8981
+              "version": "2.6.4",
8982
+              "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",
8983
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
8984
+              "dev": true
8985
+            }
8819 8986
           }
8820 8987
         },
8821 8988
         "source-map": {
@@ -8888,6 +9055,14 @@
8888 9055
             "js-base64": "^2.1.9",
8889 9056
             "source-map": "^0.5.6",
8890 9057
             "supports-color": "^3.2.3"
9058
+          },
9059
+          "dependencies": {
9060
+            "js-base64": {
9061
+              "version": "2.6.4",
9062
+              "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",
9063
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9064
+              "dev": true
9065
+            }
8891 9066
           }
8892 9067
         },
8893 9068
         "source-map": {
@@ -8959,6 +9134,14 @@
8959 9134
             "js-base64": "^2.1.9",
8960 9135
             "source-map": "^0.5.6",
8961 9136
             "supports-color": "^3.2.3"
9137
+          },
9138
+          "dependencies": {
9139
+            "js-base64": {
9140
+              "version": "2.6.4",
9141
+              "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",
9142
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9143
+              "dev": true
9144
+            }
8962 9145
           }
8963 9146
         },
8964 9147
         "source-map": {
@@ -9032,6 +9215,14 @@
9032 9215
             "js-base64": "^2.1.9",
9033 9216
             "source-map": "^0.5.6",
9034 9217
             "supports-color": "^3.2.3"
9218
+          },
9219
+          "dependencies": {
9220
+            "js-base64": {
9221
+              "version": "2.6.4",
9222
+              "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",
9223
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9224
+              "dev": true
9225
+            }
9035 9226
           }
9036 9227
         },
9037 9228
         "source-map": {
@@ -9117,6 +9308,14 @@
9117 9308
             "js-base64": "^2.1.9",
9118 9309
             "source-map": "^0.5.6",
9119 9310
             "supports-color": "^3.2.3"
9311
+          },
9312
+          "dependencies": {
9313
+            "js-base64": {
9314
+              "version": "2.6.4",
9315
+              "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",
9316
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9317
+              "dev": true
9318
+            }
9120 9319
           }
9121 9320
         },
9122 9321
         "source-map": {
@@ -9190,6 +9389,14 @@
9190 9389
             "js-base64": "^2.1.9",
9191 9390
             "source-map": "^0.5.6",
9192 9391
             "supports-color": "^3.2.3"
9392
+          },
9393
+          "dependencies": {
9394
+            "js-base64": {
9395
+              "version": "2.6.4",
9396
+              "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",
9397
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9398
+              "dev": true
9399
+            }
9193 9400
           }
9194 9401
         },
9195 9402
         "source-map": {
@@ -9282,6 +9489,14 @@
9282 9489
             "js-base64": "^2.1.9",
9283 9490
             "source-map": "^0.5.6",
9284 9491
             "supports-color": "^3.2.3"
9492
+          },
9493
+          "dependencies": {
9494
+            "js-base64": {
9495
+              "version": "2.6.4",
9496
+              "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",
9497
+              "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=",
9498
+              "dev": true
9499
+            }
9285 9500
           }
9286 9501
         },
9287 9502
         "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
     "lib-flexible": "^0.3.2",
16 17
     "vue": "^2.5.2",
17 18
     "vue-axios": "^2.1.4",

+ 61 - 42
src/views/Login.vue

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="fle bgColor">
2
+  <div class="fle bgColor" v-if="!isSSo">
3 3
     <load-ing v-show="requesterLgoinType == 'wechat'"></load-ing>
4 4
     <h2
5 5
       v-if="requesterLgoinType == 'web'"
@@ -27,6 +27,7 @@
27 27
 </template>
28 28
 
29 29
 <script>
30
+import { decode } from "js-base64";
30 31
 import LoadIng from "./../views/loading.vue";
31 32
 export default {
32 33
   data() {
@@ -34,16 +35,17 @@ export default {
34 35
       zhanghao: "",
35 36
       mima: "",
36 37
       requesterLgoinType: "",
38
+      isSSo: true // 是否单点登录
37 39
     };
38 40
   },
39 41
   components: {
40
-    LoadIng,
42
+    LoadIng
41 43
   },
42 44
   methods: {
43 45
     // 登陆
44 46
     login() {
45 47
       var that = this;
46
-      that.$http.post("service/auth/reqwechatlogin", {}).then((res) => {
48
+      that.$http.post("service/auth/reqwechatlogin", {}).then(res => {
47 49
         if (res.data.url) {
48 50
           window.location.href = res.data.url;
49 51
         } else {
@@ -66,9 +68,9 @@ export default {
66 68
       } else {
67 69
         var code = {
68 70
           code: url[1],
69
-          name: "微信报修",
71
+          name: "微信报修"
70 72
         };
71
-        that.$http.post("service/auth/reqwechatlogin2", code).then((res) => {
73
+        that.$http.post("service/auth/reqwechatlogin2", code).then(res => {
72 74
           if (res.data.state == 200) {
73 75
             if (res.data.user) {
74 76
               localStorage.setItem(
@@ -82,7 +84,7 @@ export default {
82 84
               .$createDialog({
83 85
                 type: "alert",
84 86
                 title: "您的账号被删除,请联系管理员",
85
-                icon: "cubeic-alert",
87
+                icon: "cubeic-alert"
86 88
               })
87 89
               .show();
88 90
           } else {
@@ -90,7 +92,7 @@ export default {
90 92
               .$createDialog({
91 93
                 type: "alert",
92 94
                 title: res.data.remarks,
93
-                icon: "cubeic-alert",
95
+                icon: "cubeic-alert"
94 96
               })
95 97
               .show();
96 98
           }
@@ -104,9 +106,9 @@ export default {
104 106
         .post("service/sysinfo/data/fetchDataList/systemConfiguration", {
105 107
           idx: 0,
106 108
           sum: 1000,
107
-          systemConfiguration: { keyconfig: "repairMain" },
109
+          systemConfiguration: { keyconfig: "repairMain" }
108 110
         })
109
-        .then((result) => {
111
+        .then(result => {
110 112
           if (result.data.status == 200) {
111 113
             var repairMain = result.data.list[0];
112 114
             window.localStorage.setItem(
@@ -118,16 +120,21 @@ export default {
118 120
               .post("service/sysinfo/data/fetchDataList/systemConfiguration", {
119 121
                 idx: 0,
120 122
                 sum: 1000,
121
-                systemConfiguration: { keyconfig: "ifCreate" },
123
+                systemConfiguration: { keyconfig: "ifCreate" }
122 124
               })
123
-              .then((result) => {
125
+              .then(result => {
124 126
                 if (result.data.status == 200) {
125 127
                   var ifCreate = result.data.list[0];
126 128
                   window.localStorage.setItem(
127 129
                     "ifCreate",
128 130
                     JSON.stringify(ifCreate)
129 131
                   );
130
-                  this.$router.push({ path: "/main" });
132
+                  if (this.isSSo) {
133
+                    location.href =
134
+                      "http://" + location.host + "/req/#/main/indes";
135
+                  } else {
136
+                    this.$router.push({ path: "/main" });
137
+                  }
131 138
                 }
132 139
               });
133 140
           }
@@ -136,7 +143,7 @@ export default {
136 143
     },
137 144
     // 获取报修人登录方式
138 145
     getLoginType() {
139
-      this.$http.post("service/wechat/getLoginType", {}).then((result) => {
146
+      this.$http.post("service/wechat/getLoginType", {}).then(result => {
140 147
         if (result.data.status == 200) {
141 148
           this.requesterLgoinType = result.data.data;
142 149
           window.localStorage.setItem(
@@ -155,38 +162,50 @@ export default {
155 162
     zlogin() {
156 163
       console.log(this);
157 164
       var that = this;
158
-      this.$http
159
-        .post("service/auth/reqlogin", {
160
-          username: this.zhanghao,
161
-          password: this.mima,
162
-        })
163
-        .then((res) => {
164
-          that.loading = false;
165
-          if (res.data && res.data.state == 200) {
166
-            var loginUserStr = JSON.stringify(res.data.data.requester);
167
-            localStorage.setItem("loginUser", loginUserStr);
168
-            localStorage.setItem(
169
-              "loginConfig",
170
-              JSON.stringify({ username: this.zhanghao, password: this.mima })
171
-            );
172
-            this.loginNext();
173
-          } else {
174
-            that
175
-              .$createDialog({
176
-                type: "alert",
177
-                title: "系统错误",
178
-                content: "请稍后再试",
179
-                icon: "cubeic-wrong",
180
-                color: "red",
181
-              })
182
-              .show();
183
-          }
184
-        });
185
-    },
165
+      var ssoStr = "";
166
+      var ssoJson;
167
+      if (this.isSSo) {
168
+        ssoStr = location.search
169
+          .replace("?", "")
170
+          .split("&")[0]
171
+          .split("=")[1];
172
+        ssoStr = decode(decodeURIComponent(ssoStr));
173
+        ssoJson = JSON.parse(ssoStr);
174
+      }
175
+      var postData = this.isSSo
176
+        ? { username: ssoJson.a, password: ssoJson.r, t: false }
177
+        : { username: this.zhanghao, password: this.mima };
178
+      this.$http.post("service/auth/reqlogin", postData).then(res => {
179
+        that.loading = false;
180
+        if (res.data && res.data.state == 200) {
181
+          var loginUserStr = JSON.stringify(res.data.data.requester);
182
+          localStorage.setItem("loginUser", loginUserStr);
183
+          localStorage.setItem(
184
+            "loginConfig",
185
+            JSON.stringify({ username: this.zhanghao, password: this.mima })
186
+          );
187
+          this.loginNext();
188
+        } else {
189
+          that
190
+            .$createDialog({
191
+              type: "alert",
192
+              title: "系统错误",
193
+              content: "请稍后再试",
194
+              icon: "cubeic-wrong",
195
+              color: "red"
196
+            })
197
+            .show();
198
+        }
199
+      });
200
+    }
186 201
   },
187 202
   created() {
203
+    this.isSSo = location.search.length > 0;
204
+    if (this.isSSo) {
205
+      this.zlogin();
206
+    }
188 207
     this.getLoginType();
189
-  },
208
+  }
190 209
 };
191 210
 </script>
192 211