提交 b0d3442c 编写于 作者: hujun's avatar hujun

Merge branch 'dev-patients-20190513' into 'release-0612'

Dev patients 20190513



See merge request !43
...@@ -51,7 +51,6 @@ import utils from '@/utils/followup/followupUtils'; ...@@ -51,7 +51,6 @@ import utils from '@/utils/followup/followupUtils';
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if(to.meta.checkAuth){ if(to.meta.checkAuth){
utils.checkAuthFunc().then(res=>{ utils.checkAuthFunc().then(res=>{
localStorage.setItem('checkAuth',res)
if(res==3){ if(res==3){
next() next()
}else{ }else{
......
...@@ -48,21 +48,36 @@ export default { ...@@ -48,21 +48,36 @@ export default {
DC: dataConverter, DC: dataConverter,
checkAuth: (callback) => { checkAuth: (callback) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 1、未加入 2、审核中 3、加入成功 resolve(fetch({
const checkAuth = localStorage.getItem('checkAuth') headers: {
if(checkAuth==1){ token: localStorage.getItem('storageToken')
alertMessage('您当前暂无机构,无法使用居民管理、随访管理和群发消息等功能,请在加入机构后重试。','去加入','暂不加入', ()=>{ },
location.href = getSaasHost() + '/pica-base/pica_join.html' url: getBaseUrl(`/healths/doctor/hospitalAuth`),
}) method: 'get',
}else if(checkAuth==2){ description: '检查用户的机构权限',
alertMessage('您创建的机构正在审核中,暂无法使用居民管理、随访管理和群发消息等功能,请在审核通过后重试。','查看审核','取消', ()=>{ }).then(res => {
location.href = getWsHost() + '/outside/status?tk=' + localStorage.getItem('storageToken') // 1、未加入 2、审核中 3、加入成功
}) // res.data = 2
}else if(checkAuth==3){ if (res.code == '000000') {
if(callback){ if (res.data == 1) {
resolve(callback()) // 点击 去加入,进入加入机构流程
alertMessage('您当前暂无机构,无法使用居民管理、随访管理和群发消息等功能,请在加入机构后重试。','去加入','暂不加入', ()=>{
location.href = getSaasHost() + '/pica-base/pica_join.html'
})
return new Promise((resolve, reject) => {
})
} else if (res.data == 2) {
alertMessage('您创建的机构正在审核中,暂无法使用居民管理、随访管理和群发消息等功能,请在审核通过后重试。','查看审核','取消', ()=>{
location.href = getWsHost() + '/outside/status?tk=' + localStorage.getItem('storageToken')
})
return new Promise((resolve, reject) => {
})
} else if (res.data == 3) {
return callback()
} }
} }
}))
}) })
}, },
checkAuthFunc: (callback)=>{ checkAuthFunc: (callback)=>{
...@@ -86,9 +101,6 @@ export default { ...@@ -86,9 +101,6 @@ export default {
location.href = getWsHost() + '/outside/status?tk=' + localStorage.getItem('storageToken') location.href = getWsHost() + '/outside/status?tk=' + localStorage.getItem('storageToken')
}) })
} else if (res.data == 3) { } else if (res.data == 3) {
if(callback){
resolve(callback())
}
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve(res.data) resolve(res.data)
......
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
}, },
mounted(){ mounted(){
if(vm.storageIdType==2){ if(vm.storageIdType==2){
vm.setFollowSide() // vm.setFollowSide()
} }
}, },
watch: { watch: {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册