| | |
| | | }, |
| | | ], |
| | | pasw = md5(data.pass), |
| | | // url = 'http://223.82.109.183:2080/api/blade-auth/oauth/token?tenantId=000000&username=' + data.name + |
| | | // url = this.$store.state.piAPI + '/blade-auth/oauth/token?tenantId=000000&username=' + data.name + |
| | | url = store.state.piAPI + '/blade-auth/oauth/token?tenantId=000000&username=' + data.name + |
| | | ' &password=' + pasw + '&grant_type=password&scope=all&type=account'; |
| | | // url ='http://192.168.0.109:82/blade-auth/oauth/token'; |
| | |
| | | method: "post", |
| | | // // dataType: 'JSON', |
| | | success: (res) => { |
| | | |
| | | if (res.statusCode == 200) { |
| | | console.log(res) |
| | | if (res.data.error_code == "400") { |
| | | uni.showToast({ |
| | | title: '密码错误,请重试', |
| | |
| | | data.accounts = data.name; |
| | | data.pass = data.pass; |
| | | // data.userPhon = res.user_id; |
| | | store.commit('login', data); |
| | | uni.$u.func.login(res.data) |
| | | |
| | | |
| | | |
| | | |
| | | // 实时定位获取得方法 |
| | | |
| | | uni.getLocation({ |
| | | type: 'gcj02', |
| | | geocode: true, |
| | | success: function(wzres) { |
| | | uni.request({ |
| | | url: "http://61.131.136.25:2080/api/liveLocation/saveLiveLocationAndLocus", |
| | | method: "post", |
| | | data: { |
| | | type: 1, |
| | | workerId: res.data.user_id, |
| | | longitude: wzres.longitude, |
| | | latitude: wzres.latitude, |
| | | location: wzres.address.country + |
| | | wzres.address.province + wzres |
| | | .address.city + wzres.address |
| | | .district + wzres.address |
| | | .street + wzres.address |
| | | .streetNum |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | |
| | | setInterval(function() { |
| | | |
| | | uni.getLocation({ |
| | | type: 'gcj02', |
| | | geocode: true, |
| | | success: function(wzres) { |
| | | uni.request({ |
| | | url: "http://61.131.136.25:2080/api/liveLocation/saveLiveLocationAndLocus", |
| | | method: "post", |
| | | data: { |
| | | type: 1, |
| | | workerId: res.data.user_id, |
| | | longitude: wzres.longitude, |
| | | latitude: wzres.latitude, |
| | | location: wzres.address.country + |
| | | wzres.address.province + wzres |
| | | .address.city + wzres.address |
| | | .district + wzres.address |
| | | .street + wzres.address |
| | | .streetNum |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | |
| | | }, 30000) |
| | | |
| | | uni.request({ |
| | | url: store.state.piAPI + "/blade-system/dept/detail?id=" + res |
| | | .data.dept_id, |
| | | method: "get", |
| | | data: { |
| | | |
| | | }, |
| | | success: (result) => { |
| | | data.deptName = result.data.data.deptName |
| | | res.data.deptName = result.data.data.deptName |
| | | store.commit('login', data); |
| | | uni.$u.func.login(res.data) |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | }, |
| | | fail: (res) => { |