新增ERP扫码登录确认页
This commit is contained in:
@@ -1001,6 +1001,48 @@ const loginWithPhoneCode = async (phoneCode, selectedRole = '') => {
|
||||
return autoSelectDefaultRole(normalizeLoginResult(data))
|
||||
}
|
||||
|
||||
const toCamelErpLoginPreview = data => ({
|
||||
sessionId: data.session_id,
|
||||
systemName: data.system_name || '嘉恒智能五金 ERP',
|
||||
startedAt: data.started_at || '',
|
||||
startedAtText: data.started_at ? util.formatTime(data.started_at) : '',
|
||||
expiresAt: data.expires_at || '',
|
||||
expiresAtText: data.expires_at ? util.formatTime(data.expires_at) : '',
|
||||
requestIpHint: data.request_ip_hint || '',
|
||||
userAgentHint: data.user_agent_hint || '',
|
||||
})
|
||||
|
||||
const toCamelErpLoginAction = data => ({
|
||||
status: data.status || '',
|
||||
failureReason: data.failure_reason || '',
|
||||
})
|
||||
|
||||
const getErpLoginPreview = async (ticket, sessionId) => toCamelErpLoginPreview(await requestClient.request({
|
||||
url: `/api/erp-login/sessions/${encodeURIComponent(ticket)}`,
|
||||
params: {
|
||||
session_id: sessionId,
|
||||
},
|
||||
}))
|
||||
|
||||
const confirmErpLogin = async (ticket, sessionId, phoneCode) => toCamelErpLoginAction(await requestClient.request({
|
||||
url: `/api/erp-login/sessions/${encodeURIComponent(ticket)}/confirm`,
|
||||
method: 'POST',
|
||||
params: {
|
||||
session_id: sessionId,
|
||||
},
|
||||
data: {
|
||||
phone_code: phoneCode,
|
||||
},
|
||||
}))
|
||||
|
||||
const cancelErpLogin = async (ticket, sessionId) => toCamelErpLoginAction(await requestClient.request({
|
||||
url: `/api/erp-login/sessions/${encodeURIComponent(ticket)}/cancel`,
|
||||
method: 'POST',
|
||||
params: {
|
||||
session_id: sessionId,
|
||||
},
|
||||
}))
|
||||
|
||||
const createTemporaryWorker = async (temporaryToken, temporaryName = '', attendancePoint = null) => {
|
||||
const data = await requestClient.request({
|
||||
url: '/api/auth/wechat-login',
|
||||
@@ -1812,8 +1854,10 @@ module.exports = {
|
||||
approveReport,
|
||||
buildReportDraft,
|
||||
calculateStandardWorkload,
|
||||
cancelErpLogin,
|
||||
classifyBeat,
|
||||
classifyWorkload,
|
||||
confirmErpLogin,
|
||||
continueWork,
|
||||
createTemporaryWorker,
|
||||
createMoldLockFeedback,
|
||||
@@ -1837,6 +1881,7 @@ module.exports = {
|
||||
generateMoldQrBatch,
|
||||
getClockState,
|
||||
getCurrentUser,
|
||||
getErpLoginPreview,
|
||||
getHomeSummary,
|
||||
getReport,
|
||||
getUsageStatsDetail,
|
||||
|
||||
Reference in New Issue
Block a user