seimin месяцев назад: 9
Родитель
Сommit
16df4ceaea
5 измененных файлов с 25 добавлено и 22 удалено
  1. 2 2
      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 - 2
config/index.js

@@ -14,11 +14,11 @@ module.exports = {
14 14
     proxyTable: {
15 15
       "/service": {
16 16
         //自定义名字,代表的是以下target中的内容
17
-        target: host.host + "/service/", //微信
17
+        // target: host.host + "/service/", //微信
18 18
         // target: 'http://weixintest.ngser.dashitech.com/service/',//微信
19 19
 
20 20
         // target: 'http://192.168.3.100:8080/service/',//微信
21
-        // target: 'http://localhost/service/',//微信
21
+        target: 'http://192.168.4.105/service/',//微信
22 22
         changeOrigin: true, //是否允许跨域
23 23
         pathRewrite: {
24 24
           "^/service": ""

+ 1 - 8
src/main.js

@@ -18,14 +18,7 @@ axios.defaults.baseURL = protocolName + "//" + domainName;
18 18
 // axios.defaults.baseURL = http.host;
19 19
 // axios.defaults.timeout = 5000;
20 20
 axios.defaults.headers["Content-Type"] = "application/json;charset=UTF-8";
21
-axios.interceptors.response.use(function (response) {
22
-  return response;
23
-}, function (error) {
24
-  if(error && error.response && error.response.status == 444){
25
-    window.location.href = location.origin + '/service.jsp';
26
-  }
27
-  return Promise.reject(error);
28
-});
21
+
29 22
 Vue.prototype.$http = axios;
30 23
 Vue.config.productionTip = false;
31 24
 // http request拦截器 添加一个请求拦截器

+ 1 - 1
src/router/index.js

@@ -159,7 +159,7 @@ const router = new Router({
159 159
       path: "*",
160 160
       hidden: true,
161 161
       redirect: {
162
-        path: "/"
162
+        path: "/login"
163 163
       }
164 164
     }
165 165
   ]

+ 18 - 8
src/views/Login.vue

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="fle bgColor" v-if="!isSSo && false">
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'"
@@ -123,10 +123,20 @@ export default {
123 123
     zlogin() {
124 124
       console.log(this);
125 125
       var that = this;
126
+      var ssoStr = "";
127
+      var ssoJson;
128
+      if (this.isSSo) {
129
+        ssoStr = location.search
130
+          .replace("?", "")
131
+          .split("&")[0]
132
+          .split("=")[1];
133
+        ssoStr = decode(decodeURIComponent(ssoStr));
134
+        ssoJson = JSON.parse(ssoStr);
135
+      }
126 136
       var postData = this.isSSo
127
-        ? { type: 'pc' }
137
+        ? { username: ssoJson.a, password: ssoJson.u, t: false }
128 138
         : { username: this.zhanghao, password: this.mima };
129
-      this.$http.post("/service/auth/sslLogin", postData).then(res => {
139
+      this.$http.post("/service/auth/loginEncrypt", postData).then(res => {
130 140
         that.loading = false;
131 141
         if (res.data && res.data.state == 200) {
132 142
           localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
@@ -135,10 +145,6 @@ export default {
135 145
             JSON.stringify(res.data.data.requester)
136 146
           );
137 147
           this.getConfig(res.data.data.user,res.data.data.requester);
138
-        }else if (res.data && res.data.state == 501) {
139
-          var user = JSON.parse(localStorage.getItem('loginUser'));
140
-          var requester = JSON.parse(localStorage.getItem('login_requester'));
141
-          user && requester && this.getConfig(user,requester);
142 148
         } else {
143 149
           that
144 150
             .$createDialog({
@@ -227,7 +233,11 @@ export default {
227 233
     }
228 234
   },
229 235
   created() {
230
-    this.isSSo = true;
236
+    if (location.search.length > 0) {
237
+      this.isSSo = Boolean(this.getQueryString("t"));
238
+    } else {
239
+      this.isSSo = false;
240
+    }
231 241
     if (this.isSSo) {
232 242
       this.zlogin();
233 243
     }

+ 3 - 3
upload/development.js

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