Commit 0582046d by niuxinyu

关门优化7

parent 6e5b2e09
......@@ -65,23 +65,21 @@ export default class HomePageContainer extends React.Component{
}else{
//正常调用
try {
console.log('有网络',this.props.headerInfo.taskInfo.area,this.props.headerInfo.storeInfo.id,this.props.headerInfo.taskInfo.taskId,this.props.headerInfo.taskInfo.currentTaskType,
this.props.headerInfo.userInfo.employeeId
)
this.axios.post(domain+'machine_pad/finish_task.action',{
area:this.props.headerInfo.taskInfo.area,
storeId:this.props.headerInfo.storeInfo.id,
taskId:this.props.headerInfo.taskInfo.taskId,
taskType:this.props.headerInfo.taskInfo.currentTaskType,
userId:this.props.headerInfo.userInfo.employeeId
// this.axios.post(domain+'machine_pad/finish_task.action',{
// area:this.props.headerInfo.taskInfo.area,
// storeId:this.props.headerInfo.storeInfo.id,
// taskId:this.props.headerInfo.taskInfo.taskId,
// taskType:this.props.headerInfo.taskInfo.currentTaskType,
// userId:this.props.headerInfo.userInfo.employeeId
}).then((res)=>{
if(res.status!=200){
var error = new Error(response.statusText)
error.response = response
throw error
}else{
// }).then((res)=>{
// if(res.status!=200){
// var error = new Error(response.statusText)
// error.response = response
// throw error
// }else{
this.props.willCloseDoor().then(()=>{
this.props.endCountBack();
let msg={type:'WILL_CLOSEDOOR'};
......@@ -90,13 +88,13 @@ export default class HomePageContainer extends React.Component{
// this.props.tempLogout()
console.log('有网络',this.props)
})
}
})
.catch((err)=>{
this.setState({ closeDoorStatus : 0},()=>{
alert('当前网络不佳,请稍后重试')
})
})
// }
// })
// .catch((err)=>{
// this.setState({ closeDoorStatus : 0},()=>{
// alert('当前网络不佳,请稍后重试')
// })
// })
// this.props.willCloseDoor().then(()=>{
......
......@@ -8,9 +8,9 @@ import thunkMiddleware from 'redux-thunk';
require('./index.css');
import PageContainer from './containers/PageContainer/PageContainer';
const env = process.env.NODE_ENV;
import axios from 'axios'
React.Component.prototype.axios=axios
axios.defaults.withCredentials=true
// import axios from 'axios'
// React.Component.prototype.axios=axios
// axios.defaults.withCredentials=true
function activateVendor() {
const logMiddleware = createLogger();
return (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment