Commit 0582046d by niuxinyu

关门优化7

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