diff --git a/pages/login/index.js b/pages/login/index.js index 362e2ad..ad958d7 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -158,30 +158,24 @@ Page({ this.setData({ loging: false, metaData: this.data.metaData }) } } else if(app.userInfo.enterpriseInfos && app.userInfo.enterpriseInfos.length){ - var applicationStatus = 0 for (let mIndex = 0; mIndex < app.userInfo.enterpriseInfos.length; mIndex++) { const element = app.userInfo.enterpriseInfos[mIndex] - if(element.isEnterprisePrimary || applicationStatus == 1){ + if(element.isEnterprisePrimary){ // 如果是企业主 this.toIndex() return } for (let nIndex = 0; nIndex < element.factoryInfos.length; nIndex++) { - const item = element.factoryInfos[nIndex] // 是否有职位 - applicationStatus = item.type ? 1 : 0 - if(applicationStatus == 1){ - break + if(element.factoryInfos[nIndex].type){ + this.toIndex() + return } } } - if(applicationStatus == 0){ - this.setData({ loging: false}) - Dialog.alert({ title: '温馨提示', message: '还没有您所属的打包站信息,请联系相关客服人员' }).then(() => { - }) - return - } - this.toIndex() + this.setData({ loging: false}) + Dialog.alert({ title: '温馨提示', message: '还没有您所属的打包站信息,请联系相关客服人员' }).then(() => { + }) } else { this.setData({ loging: false}) Dialog.alert({ title: '温馨提示', message: '还没有您所属的打包站信息,请联系相关客服人员' }).then(() => {