提交 b8467dea 编写于 作者: tao.wu's avatar tao.wu

no message

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