Browse Source

登录页面数据获取修改

lizaixun 4 years ago
parent
commit
ef01b9e23f
1 changed files with 13 additions and 1 deletions
  1. 13 1
      components/login/Login.vue

+ 13 - 1
components/login/Login.vue

@@ -93,6 +93,17 @@ export default {
 		//this.removeUsernamePassword();
 		//this.removeUsernamePassword();
 		this.getUsernamePassword();
 		this.getUsernamePassword();
 	},
 	},
+	computed: {
+		backStageIp: function() {
+			return this.$store.state.wholeSituationBackStageIp;
+		},
+		backStagePort: function() {
+			return this.$store.state.wholeSituationBackStagePort;
+		},
+		windpowerstationNameToId: function() {
+			return this.$store.state.windpowerstationNameToId;
+		}
+	},
 	methods: {
 	methods: {
 		showPass(e) {
 		showPass(e) {
 			this.passwordShow = e;
 			this.passwordShow = e;
@@ -221,11 +232,12 @@ export default {
 		login: function() {
 		login: function() {
 			let _this = this;
 			let _this = this;
 			uni.request({
 			uni.request({
-				url: 'http://localhost:8082/GyeeuserController/login?username=' + this.username + '&password=' + this.password,
+				url: 'http://' + this.backStageIp + ':' + this.backStagePort + '/GyeeuserController/login?username=' + this.username + '&password=' + this.password,
 				data: {},
 				data: {},
 				method: 'GET',
 				method: 'GET',
 				success: function(res) {
 				success: function(res) {
 					console.log(res.data);
 					console.log(res.data);
+					console.log(this.backStageIp)
 					if (res.data.code == 200) {
 					if (res.data.code == 200) {
 						_this.setUsernamePassword();
 						_this.setUsernamePassword();
 						_this.loginFalg = true;
 						_this.loginFalg = true;