1
0
panhui 7 жил өмнө
parent
commit
bd722b1dd2

+ 52 - 42
src/main/vue/src/entries/admin.js

@@ -33,7 +33,8 @@ Vue.component('rich-text', RichText);
 const baseUrl = process.env.NODE_ENV === 'production' ? '../' : `http://${location.hostname}:8080`;
 Vue.prototype.$baseUrl = baseUrl;
 Vue.prototype.$widgetBaseUrl = 'http://116.62.160.108:8180/';
-Vue.prototype.$handleUrl = 'http://120.27.240.144:8082/webService/call'
+Vue.prototype.$handleDomain = 'http://121.43.171.110:8082/'
+Vue.prototype.$handleUrl = 'http://121.43.171.110:8082/webService/call'
     //  Vue.prototype.$widgetBaseUrl = 'http://172.16.86.43:8180/';
     //  Vue.prototype.$handleUrl = 'http://180.169.224.24:8082/webService/call'
 axios.defaults.withCredentials = true;
@@ -176,57 +177,66 @@ Vue.prototype.getHaleInfo = function(serviceName, methodName, params, type, newk
         }
         console.log(data)
         axios.post(this.$handleUrl, data).then(res => {
-            var jsonp = {}
-            var list = []
-            if (res.data.data.key) {
-                if (type == 'list') {
-                    resolve([])
-                } else {
-                    resolve({})
-                }
-            } else if (type == 'list') {
-                //list处理
+            if (res.data.success) {
+                var jsonp = {}
+                var list = []
+                if (res.data.data.key) {
+                    if (type == 'list') {
+                        resolve([])
+                    } else {
+                        resolve({})
+                    }
+                } else if (type == 'list') {
+                    //list处理
 
-                var useKey = '牛号'
-                if (newkey) {
-                    useKey = newkey
-                }
+                    var useKey = '牛号'
+                    if (newkey) {
+                        useKey = newkey
+                    }
 
-                var useDateType = 'YYYY-MM-DD'
-                if (dateTypeType) {
-                    useDateType = dateTypeType
-                }
+                    var useDateType = 'YYYY-MM-DD'
+                    if (dateTypeType) {
+                        useDateType = dateTypeType
+                    }
 
-                if (res.data.data[useKey]) {
-                    list.push(res.data.data)
-                } else {
-                    list = res.data.data
-                }
-                list.forEach(item => {
-                    for (var key in item) {
+                    if (res.data.data[useKey]) {
+                        list.push(res.data.data)
+                    } else {
+                        list = res.data.data
+                    }
+                    list.forEach(item => {
+                        for (var key in item) {
 
+                            if (key.indexOf('日期') != -1) {
+                                item[key] = format(new Date(item[key]), useDateType, { locale: zh })
+                            }
+                            if (key.indexOf('时间') != -1) {
+                                item[key] = format(new Date(item[key]), useDateType, { locale: zh })
+                            }
+                        }
+                    })
+
+                    resolve(list)
+
+                } else if (type == 'json') {
+                    jsonp = res.data.data
+                    for (var key in jsonp) {
                         if (key.indexOf('日期') != -1) {
-                            item[key] = format(new Date(item[key]), useDateType, { locale: zh })
+                            jsonp[key] = format(new Date(jsonp[key]), dateTypeType ? dateTypeType : 'YYYY-MM-DD', { locale: zh })
                         }
                         if (key.indexOf('时间') != -1) {
-                            item[key] = format(new Date(item[key]), useDateType, { locale: zh })
+                            jsonp[key] = format(new Date(jsonp[key]), dateTypeType ? dateTypeType : 'YYYY-MM-DD HH:mm:ss', { locale: zh })
                         }
                     }
-                })
-
-                resolve(list)
-
-            } else if (type == 'json') {
-                jsonp = res.data.data
-                for (var key in jsonp) {
-                    if (key.indexOf('日期') != -1) {
-                        jsonp[key] = format(new Date(jsonp[key]), dateTypeType ? dateTypeType : 'YYYY-MM-DD', { locale: zh })
-                    }
-                    if (key.indexOf('时间') != -1) {
-                        jsonp[key] = format(new Date(jsonp[key]), dateTypeType ? dateTypeType : 'YYYY-MM-DD HH:mm:ss', { locale: zh })
-                    }
+                    resolve(jsonp)
                 }
-                resolve(jsonp)
+
+            } else {
+                this.$message({
+                    message: res.data.error,
+                    type: 'warning'
+                });
+                reject()
             }
 
         })

+ 11 - 0
src/main/vue/src/pages/Login.vue

@@ -57,6 +57,17 @@ export default {
           }).catch(() => {
             this.loading = false;
           })
+
+          this.$http.post({
+            url: this.$handleDomain+'/auth/login',
+            data: {
+              username: this.userInfo.username,
+              password: this.userInfo.password,
+              remember: this.rememberMe
+            }
+          }).then(res => {
+           
+          })
         }
       })
     }