Sfoglia il codice sorgente

恢复账号密码登录

seimin 9 mesi fa
parent
commit
1f741e8afa
5 ha cambiato i file con 25 aggiunte e 21 eliminazioni
  1. 2 1
      config/index.js
  2. 1 8
      src/main.js
  3. 1 1
      src/router/index.js
  4. 18 8
      src/views/Login.vue
  5. 3 3
      upload/development.js

+ 2 - 1
config/index.js

@@ -13,7 +13,8 @@ module.exports = {
13
     assetsPublicPath: '/',
13
     assetsPublicPath: '/',
14
     proxyTable: {
14
     proxyTable: {
15
       '/service': {//自定义名字,代表的是以下target中的内容
15
       '/service': {//自定义名字,代表的是以下target中的内容
16
-        target: host.host+'/service/',//微信
16
+        // target: host.host+'/service/',//微信
17
+        target: 'http://192.168.4.105/service/',//微信
17
         changeOrigin: false,//是否允许跨域
18
         changeOrigin: false,//是否允许跨域
18
         pathRewrite: {
19
         pathRewrite: {
19
           '^/service': ''
20
           '^/service': ''

+ 1 - 8
src/main.js

@@ -19,14 +19,7 @@ let protocolName = document.location.protocol; //http协议
19
 axios.defaults.baseURL = protocolName + "//" + domainName;
19
 axios.defaults.baseURL = protocolName + "//" + domainName;
20
 
20
 
21
 // axios.defaults.timeout = 5000;
21
 // axios.defaults.timeout = 5000;
22
-axios.interceptors.response.use(function (response) {
23
-  return response;
24
-}, function (error) {
25
-  if(error && error.response && error.response.status == 444){
26
-    window.location.href = location.origin + '/user.jsp';
27
-  }
28
-  return Promise.reject(error);
29
-});
22
+
30
 Vue.prototype.$http = axios;
23
 Vue.prototype.$http = axios;
31
 Vue.config.productionTip = false;
24
 Vue.config.productionTip = false;
32
 Vue.prototype.$host = protocolName + "//" + domainName;
25
 Vue.prototype.$host = protocolName + "//" + domainName;

+ 1 - 1
src/router/index.js

@@ -236,7 +236,7 @@ export default new Router({
236
     path: '*',
236
     path: '*',
237
     hidden: true,
237
     hidden: true,
238
     redirect: {
238
     redirect: {
239
-      path: '/'
239
+      path: '/login'
240
     }
240
     }
241
   }
241
   }
242
   ]
242
   ]

+ 18 - 8
src/views/Login.vue

@@ -1,5 +1,5 @@
1
 <template>
1
 <template>
2
-  <div class="fle bgColor" v-if="!isSSo && false">
2
+  <div class="fle bgColor" v-if="!isSSo">
3
     <load-ing v-show="requesterLgoinType == 'wechat'"></load-ing>
3
     <load-ing v-show="requesterLgoinType == 'wechat'"></load-ing>
4
     <h2
4
     <h2
5
       v-if="requesterLgoinType == 'web'"
5
       v-if="requesterLgoinType == 'web'"
@@ -211,10 +211,20 @@ export default {
211
     zlogin() {
211
     zlogin() {
212
       console.log(this);
212
       console.log(this);
213
       var that = this;
213
       var that = this;
214
+      var ssoStr = "";
215
+      var ssoJson;
216
+      if (this.isSSo) {
217
+        ssoStr = location.search
218
+          .replace("?", "")
219
+          .split("&")[0]
220
+          .split("=")[1];
221
+        ssoStr = decode(decodeURIComponent(ssoStr));
222
+        ssoJson = JSON.parse(ssoStr);
223
+      }
214
       var postData = this.isSSo
224
       var postData = this.isSSo
215
-        ? { type: 'pc' }
225
+        ? { username: ssoJson.a, password: ssoJson.u, t: false }
216
         : { username: this.zhanghao, password: this.mima };
226
         : { username: this.zhanghao, password: this.mima };
217
-      this.$http.post("service/auth/sslLogin", postData).then(res => {
227
+      this.$http.post("service/auth/loginEncrypt", postData).then(res => {
218
         that.loading = false;
228
         that.loading = false;
219
         if (res.data && res.data.state == 200) {
229
         if (res.data && res.data.state == 200) {
220
           localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
230
           localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
@@ -224,10 +234,6 @@ export default {
224
             JSON.stringify(res.data.data.requester)
234
             JSON.stringify(res.data.data.requester)
225
           );
235
           );
226
           this.getConfig(res.data.data.user,res.data.data.requester);
236
           this.getConfig(res.data.data.user,res.data.data.requester);
227
-        }else if (res.data && res.data.state == 501) {
228
-          var user = JSON.parse(localStorage.getItem('loginUser'));
229
-          var requester = JSON.parse(localStorage.getItem('login_requester'));
230
-          user && requester && this.getConfig(user,requester);
231
         } else {
237
         } else {
232
           that
238
           that
233
             .$createDialog({
239
             .$createDialog({
@@ -252,7 +258,11 @@ export default {
252
     }
258
     }
253
   },
259
   },
254
   created() {
260
   created() {
255
-    this.isSSo = true;
261
+    if (location.search.length > 0) {
262
+      this.isSSo = Boolean(this.getQueryString("t"));
263
+    } else {
264
+      this.isSSo = false;
265
+    }
256
     if (this.isSSo) {
266
     if (this.isSSo) {
257
       this.zlogin();
267
       this.zlogin();
258
     }
268
     }

+ 3 - 3
upload/development.js

@@ -1,11 +1,11 @@
1
 const shell = require('shelljs')
1
 const shell = require('shelljs')
2
 const path = require('path');
2
 const path = require('path');
3
 const config = {
3
 const config = {
4
-  ip: "192.168.3.110", // ssh地址
4
+  ip: "192.168.3.122", // ssh地址
5
   username: "root", // ssh 用户名
5
   username: "root", // ssh 用户名
6
   port: 22,      //端口
6
   port: 22,      //端口
7
-  password: "123456", // ssh 密码
8
-  path: '/home/itsm/project/web/userApp', // 上传地址,删除地址
7
+  password: "DStech@123", // ssh 密码
8
+  path: '/home/itsm/project/web/mdv2/userApp', // 上传地址,删除地址
9
   buildPath: '../dist' // 本地打包后文件地址
9
   buildPath: '../dist' // 本地打包后文件地址
10
 }
10
 }
11
 let Client = require('ssh2-sftp-client');
11
 let Client = require('ssh2-sftp-client');