1
0
xiongzhu 7 лет назад
Родитель
Сommit
3797c53aba

+ 1 - 4
src/main/java/com/izouma/awesomeadmin/shiro/MyModularRealmAuthenticator.java

@@ -17,10 +17,7 @@ public class MyModularRealmAuthenticator extends ModularRealmAuthenticator {
         AuthenticationStrategy strategy = this.getAuthenticationStrategy();
         AuthenticationInfo aggregate = strategy.beforeAllAttempts(realms, token);
 
-        Iterator var5 = realms.iterator();
-
-        while (var5.hasNext()) {
-            Realm realm = (Realm) var5.next();
+        for (Realm realm : realms) {
             aggregate = strategy.beforeAttempt(realm, token, aggregate);
             if (realm.supports(token)) {
                 logger.trace("Attempting to authenticate token [{}] using realm [{}]");

+ 15 - 8
src/main/vue/src/pages/DeploySystem.vue

@@ -49,7 +49,11 @@
                 state: 0,
                 output: '',
                 estimatedDuration: 0,
-                startTime: 0
+                startTime: 0,
+                auth: {
+                    username: 'admin',
+                    password: '3edc#EDC'
+                }
             }
         },
         computed: {
@@ -65,15 +69,14 @@
                     type: 'warning'
                 }).then(() => {
                     return axios.post('http://121.43.171.110:8000/job/信牧基础平台/build', null, {
-                        auth: {
-                            username: 'admin',
-                            password: '3edc#EDC'
-                        }
+                        auth: this.auth
                     })
                 }).then(res => {
                     if (res.status === 201) {
                         this.startTime = new Date().getTime();
-                        return axios.get(`${res.headers['location']}api/json`)
+                        return axios.get(`${res.headers['location']}api/json`, null, {
+                            auth: this.auth
+                        })
                     } else {
                         throw ''
                     }
@@ -87,7 +90,9 @@
                 });
             },
             pollingStatus() {
-                axios.get(`${this.url}api/json`).then(res => {
+                axios.get(`${this.url}api/json`, null, {
+                    auth: this.auth
+                }).then(res => {
                     if (res.status === 200) {
                         if (res.data.building) {
                             if (!this.estimatedDuration) {
@@ -127,7 +132,9 @@
                         }
                     }
                 });
-                axios.get(`${this.url}/logText/progressiveText?start=0`).then(res => {
+                axios.get(`${this.url}/logText/progressiveText?start=0`, null, {
+                    auth: this.auth
+                }).then(res => {
                     if (res.status === 200) {
                         this.output = res.data;
                         setTimeout(() => {