feat: 病例列表联调
This commit is contained in:
+18
-2
@@ -293,8 +293,16 @@ function handleLogin() {
|
||||
uni.setStorageSync('clinical-thinking-access-token', result.tokens.access)
|
||||
uni.setStorageSync('clinical-thinking-refresh-token', result.tokens.refresh)
|
||||
showToast(result.message || '正在进入系统...')
|
||||
uni.redirectTo({
|
||||
url: '/pages/config/config'
|
||||
|
||||
if (isFirstProfileSetup(backendUser.department)) {
|
||||
uni.redirectTo({
|
||||
url: '/pages/config/config'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
uni.reLaunch({
|
||||
url: '/pages/home/home'
|
||||
})
|
||||
}).catch(error => {
|
||||
showToast(error instanceof Error ? error.message : '登录失败,请稍后重试')
|
||||
@@ -322,6 +330,14 @@ function validatePhone() {
|
||||
return true
|
||||
}
|
||||
|
||||
function isFirstProfileSetup(department: unknown) {
|
||||
if (department === null || department === undefined) return true
|
||||
if (typeof department === 'string') return department.trim() === ''
|
||||
if (Array.isArray(department)) return department.length === 0
|
||||
if (typeof department === 'object') return Object.keys(department).length === 0
|
||||
return false
|
||||
}
|
||||
|
||||
function openAgreement(type: 'service' | 'privacy') {
|
||||
uni.showModal({
|
||||
title: type === 'service' ? '用户服务协议' : '隐私保护政策',
|
||||
|
||||
Reference in New Issue
Block a user