fcc-core
Version:
Fusion communication center.
32 lines (30 loc) • 953 B
JavaScript
import http from '../../../utils/ajaxRequest/instance'
import { changeEmployeeStatus } from '../../../utils/nats/natsApi'
export default async function (xw, params) {
return new Promise(async (resolve, reject) => {
xw.exe.emit('WriteBrowserLog', { logStr: '调用了退出' })
await http({
apiType: 'UCC',
method: 'post',
url: '/njdf_logout'
}).then(result => {
let param = {
'userName': xw.userInfo.ICP_CODE,
'sdkVer': xw.getSysParam('PLATFORM_VERSION')
}
xw.agentState = '3'
xw.userInfo = {}
clearInterval(xw.heartInterval)
changeEmployeeStatus('3', xw)
// 通过exe程序去登出
xw.exe.emit('Logout', param)
xw.exe.once('OnLogout', data => {
if (data.resultCode === 0) {
resolve()
}
})
}).catch(e => {
reject(new xw.BaseException(563, '退出登录失败'))
})
})
}