feat: 新增机构参数
This commit is contained in:
+11
-7
@@ -140,17 +140,18 @@ import ProfilePage from '../profile/profile.vue'
|
||||
|
||||
type Institution = {
|
||||
id: string
|
||||
code: string
|
||||
name: string
|
||||
city: string
|
||||
typeName: string
|
||||
}
|
||||
|
||||
const institutions: Institution[] = [
|
||||
{ id: '1', name: '协和医学院', city: '北京', typeName: '医学院校' },
|
||||
{ id: '2', name: '四川大学华西医院', city: '成都', typeName: '三甲医院' },
|
||||
{ id: '3', name: '复旦大学附属中山医院', city: '上海', typeName: '三甲医院' },
|
||||
{ id: '4', name: '中山大学孙逸仙纪念医院', city: '广州', typeName: '三甲医院' },
|
||||
{ id: 'others', name: '其他机构', city: '其他', typeName: '手动登记' }
|
||||
{ id: 'H001', code: 'H001', name: '协和医学院', city: '北京', typeName: '医学院校' },
|
||||
{ id: 'H002', code: 'H002', name: '四川大学华西医院', city: '成都', typeName: '三甲医院' },
|
||||
{ id: 'H003', code: 'H003', name: '复旦大学附属中山医院', city: '上海', typeName: '三甲医院' },
|
||||
{ id: 'H004', code: 'H004', name: '中山大学孙逸仙纪念医院', city: '广州', typeName: '三甲医院' },
|
||||
{ id: 'OTHER', code: 'OTHER', name: '其他机构', city: '其他', typeName: '手动登记' }
|
||||
]
|
||||
|
||||
const form = reactive({
|
||||
@@ -239,14 +240,17 @@ function handleLogin() {
|
||||
submitting.value = true
|
||||
loginWithCode({
|
||||
phone: form.phone,
|
||||
code: form.code
|
||||
code: form.code,
|
||||
institution_code: selectedInstitution.value.code,
|
||||
institution_name: selectedInstitution.value.name
|
||||
}).then(result => {
|
||||
const backendUser = result.user || {}
|
||||
const normalizedUser = {
|
||||
...backendUser,
|
||||
id: backendUser.id ? String(backendUser.id) : '',
|
||||
phone: backendUser.phone || form.phone,
|
||||
institutionId: selectedInstitution.value?.id || '',
|
||||
institutionId: selectedInstitution.value?.code || '',
|
||||
institutionCode: selectedInstitution.value?.code || '',
|
||||
institutionName: selectedInstitution.value?.name || ''
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user