判断登录权限

main
岩仔88 3 days ago
parent 961147d7f4
commit 01afced8a3

@ -316,8 +316,12 @@ class PlanListController extends Controller
$userid = $request->get('userid');//中间件产生的参数
$do_userid=request('do_user');
$query = DB::table('users')->where(['id' => $userid])->get();
$service = new PlanListService();
if($password=='noPassword'){
return $service->CancelYuYue($MainListId, $reg_num,$do_userid);
}
if (password_verify($password, $query[0]->pwd)) {
$service = new PlanListService();
return $service->CancelYuYue($MainListId, $reg_num,$do_userid);
} else {
return \Yz::echoError1('密码不正确');

@ -130,7 +130,7 @@ class WorkMainController extends Controller
$list=$list->where(['reservation_department'=>$department->department_name]);
}else{
$list = $list->where(function ($q) use($department) {
$q->where(['RISRAcceptDeptCode'=>$department->department_number])
->orWhere('reservation_department_code', $department->department_number);

@ -121,7 +121,7 @@ class YiJiController extends Controller
'reservation_department_code' =>$data_v["orderDeptCode"],//申请科室代码
'doctor_code' => $data_v["orderPersonCode"],//申请医生代码
];
DB::table('s_list')->update($params)->where(['id' => $db_item->id])->first();
DB::table('s_list')->where(['id' => $db_item->id])->update($params);
}
}
}

@ -60,6 +60,7 @@
console.log(token)
if (token!=null && token == access_token.value) {
//window.location.href = "./#/yewu/mainList"
sessionStorage.setItem('LoginType', "CasLogin");
window.location.href = "./#/dashboard"
}else{
ElMessage.error("登录失败")

@ -29,6 +29,7 @@
var token = sessionStorage.getItem('token');
console.log(token)
if (token!=null && token == res.data.access_token) {
sessionStorage.setItem('LoginType', "HisLogin");
window.location.href = "./#/yewu/mainList"
//window.location.href = "./#/info/EntrustList"
}else{

@ -93,6 +93,7 @@
// sessionStorage.setItem('tk', JSON.stringify(res.data.tk));
var token = sessionStorage.getItem('token');
if (token == res.data.token) {
sessionStorage.setItem('LoginType', "SysLogin");
window.location.href = "./#/dashboard"
}
} else {

@ -321,6 +321,7 @@
reg_num: null,
user_name: null
})
let loginType=ref('');
//
let tableData = ref([])
let tableref = ref(null)
@ -536,51 +537,88 @@
})
}
//
const cancel = () => {
if (tableSelected.value.length === 0) {
ElMessage.error('请勾选1条记录')
return false
}
let next=true
tableSelected.value.forEach((v,i)=>{
if(v.list_status!=1){
ElMessage.error(v.entrust+" 无需取消")
next=false
}
})
if(next==false) return false
ElMessageBox.prompt('请输入登录密码后再操作', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'password'
})
.then(({
value
}) => {
loading.value = true
CancelYuYue({
MainListId: tableSelected.value[0].id,
reg_num: tableSelected.value[0].reg_num,
do_user:loginUserinfo.value.id,
password: value,
}).then(res => {
loading.value = false
if (res.status) {
ElMessage({
message: res.msg,
type: 'success',
})
GetList()
} else {
ElMessage.error(res.msg)
}
})
})
.catch(() => {
})
// 1.
if (tableSelected.value.length === 0) {
ElMessage.error('请勾选1条记录')
return false
}
// 2.
let next = true
tableSelected.value.forEach((v) => {
if (v.list_status != 1) {
ElMessage.error(`${v.entrust} 无需取消`)
next = false
}
})
if (!next) return false
// 1=2=
// 使 props
loading.value = true; // then
//
const handleSuccessAction = (password) => {
CancelYuYue({
MainListId: tableSelected.value[0].id,
reg_num: tableSelected.value[0].reg_num,
do_user: loginUserinfo.value.id,
password: password, //
}).then(res => {
loading.value = false
if (res.status) {
ElMessage({
message: res.msg,
type: 'success',
})
GetList()
} else {
ElMessage.error(res.msg)
}
}).catch(err => {
loading.value = false
console.error(err)
})
}
// 3.
if (loginType.value === 'SysLogin') {
// 1:
ElMessageBox.prompt('请输入登录密码后再操作', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'password',
inputPattern: /.+/, //
inputErrorMessage: '密码不能为空'
})
.then(({ value }) => {
handleSuccessAction(value)
})
.catch(() => {
loading.value = false
})
} else if (loginType.value === 'HisLogin' || loginType.value === 'CasLogin') {
// 2:
ElMessageBox.confirm('确定要执行取消操作吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
handleSuccessAction('noPassword')
})
.catch(() => {
loading.value = false
})
} else {
loading.value = false
ElMessage.error('未知的操作类型配置')
}
}
//
let EnableDeviceList = ref([])
@ -763,7 +801,7 @@
getEnableResource()
}
//
if(loginUserinfo.value && loginUserinfo.value.group==7){
if((loginUserinfo.value && loginUserinfo.value.group==7) || loginType.value==='HisLogin'){
searchInfo.value.doctor=loginUserinfo.value.cn_name
//
let default_reg_num=sessionStorage.getItem("default_reg_num")
@ -775,7 +813,7 @@
}
onMounted(() => {
loginType.value=sessionStorage.getItem('LoginType')
GetEnableDeviceListFunc()
if(pinia.baseInfoStatus){
getStorageData()

Loading…
Cancel
Save