| | |
| | | import md5 from 'js-md5' |
| | | import axios from 'axios' |
| | | |
| | | import websocket from "./websocket.js" |
| | | import positions from "./positions.js" |
| | | |
| | | |
| | | const actions = { |
| | | loging(store, data) { |
| | | var user = [{ |
| | |
| | | ], |
| | | pasw = md5(data.pass), |
| | | url = this.state.piAPI + '/blade-auth/oauth/token?tenantId=000000&username=' + data.name + |
| | | ' &password=' + pasw + '&grant_type=password&scope=all&type=account'; |
| | | ' &password=' + pasw + '&grant_type=password&scope=all&type=account' |
| | | // url ='http://192.168.0.109:82/blade-auth/oauth/token'; |
| | | // url ='http://192.168.0.109:82/blade-auth/oauth/token?tenantId=000000&username=admin&password=93369e86dc5fa854a0eaf75558c4039d&grant_type=password'; |
| | | // url ='http://web.byisf.com/api/blade-auth/oauth/token?tenantId=000000&username=admin&password=93369e86dc5fa854a0eaf75558c4039d&grant_type=password&scope=all'; |
| | |
| | | // // dataType: 'JSON', |
| | | success: (res) => { |
| | | if (res.statusCode == 200) { |
| | | if(res.data.error_code == "400"){ |
| | | uni.hideNavigationBarLoading(); |
| | | if (res.data.error_code == "400") { |
| | | uni.hideNavigationBarLoading() |
| | | uni.showToast({ |
| | | title: '密码错误,请重试', |
| | | icon:'none', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }); |
| | | return; |
| | | }) |
| | | return |
| | | } |
| | | store.commit('getUserData',res.data) |
| | | // console.log(res.data,123542); |
| | | data.isit = true; |
| | | console.log(res.data,456); |
| | | store.commit('getUserData', res.data) |
| | | console.log(res.data, 123542); |
| | | data.isit = true |
| | | store.state.roleid = res.data.role_id; //角色id |
| | | store.state.Jurisdiction = res.data.workjurisdiction; //角色辖区 |
| | | data.userName = res.data.nick_name; //警袁姓名 |
| | | data.userID = res.data.user_id; //警袁id |
| | | data.avatar = res.data.avatar; //头像 |
| | | data.accounts = data.name; |
| | | data.pass = data.pass; |
| | | data.firstlogin = res.data.firstlogin; |
| | | // data.userPhon = res.user_id; |
| | | store.commit('login', data); |
| | | |
| | | } |
| | | store.commit('login', data) |
| | | wx.request({ |
| | | url: "http://61.131.136.25:2080/api/userVip/getUserVipInfo?idCardNo=" + |
| | | res |
| | | .data.securityId, |
| | | method: 'get', |
| | | success: (result) => { |
| | | if (JSON.stringify(result.data.data) != '{}') { |
| | | store.state.billFlag = true |
| | | } |
| | | } |
| | | }) |
| | | |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log('失去连接 请稍等'); |
| | | console.log('失去连接 请稍等') |
| | | // console.log(res); |
| | | } |
| | | }); |
| | | }) |
| | | // var time = setTimeout(() => { //模拟请求时间 |
| | | // var ud = user, |
| | | // isit = false; |
| | |
| | | // store.commit('login', data); |
| | | // }, 2000) |
| | | |
| | | } |
| | | }, |
| | | ...websocket.actions, |
| | | ...positions.actions |
| | | } |
| | | |
| | | export default actions |