feat: 首页接单开关接入服务端落库
This commit is contained in:
@@ -39,6 +39,7 @@ function normalizeAttendant(employee) {
|
||||
grade,
|
||||
star,
|
||||
canAcceptOrder: stage === 'certified',
|
||||
isOnline: info.isOnline === true,
|
||||
text: stage === 'intern' ? '实习陪诊师' : `正式陪诊师 · ${gradeText}`
|
||||
}
|
||||
}
|
||||
@@ -189,6 +190,11 @@ function getAttendantSync() {
|
||||
return cachedAttendant
|
||||
}
|
||||
|
||||
// 接单开关切换成功后同步快照,避免 onShow 复用旧值把开关弹回去
|
||||
function setAttendantOnline(isOnline) {
|
||||
if (cachedAttendant) cachedAttendant.isOnline = !!isOnline
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录 / 清除缓存后重置,避免沿用上一个账号的角色
|
||||
*/
|
||||
@@ -242,6 +248,7 @@ module.exports = {
|
||||
ensureRoleSafe,
|
||||
getRoleSync,
|
||||
getAttendantSync,
|
||||
setAttendantOnline,
|
||||
resetRole,
|
||||
queryOrders,
|
||||
guardAdminPage
|
||||
|
||||
Reference in New Issue
Block a user