diff --git a/src/api/acl/login.ts b/src/api/acl/login.ts index 1e8ec68..ed4dd63 100644 --- a/src/api/acl/login.ts +++ b/src/api/acl/login.ts @@ -4,6 +4,7 @@ import {HOST} from "@/utils/request"; import {ElMessage} from "element-plus"; const FORM_CONTENT_TYPE = 'application/x-www-form-urlencoded'; +const registerUrl = "/admin/register/user" export const login = (data: any) => { return new Promise(resolve => { @@ -36,4 +37,11 @@ export const login = (data: any) => { } }) }) -}; \ No newline at end of file +}; + +export const register = (data: any) => { + return new Promise(resolve => { + console.log(data) + resolve(true) + }) +} \ No newline at end of file diff --git a/src/api/hospital.ts b/src/api/hospital.ts new file mode 100644 index 0000000..8a104dc --- /dev/null +++ b/src/api/hospital.ts @@ -0,0 +1,18 @@ +import axios from "axios"; + +const getHospitalListUrl = "/api/admin/hospital/getHospitalList" +const FORM_CONTENT_TYPE = 'application/x-www-form-urlencoded' + +export const getHospitalList = () => { + return new Promise(resolve => { + axios.request({ + url: getHospitalListUrl, + method: 'post', + headers: { + 'Content-Type': FORM_CONTENT_TYPE, + }, + }).then(res => { + resolve(res.data); + }) + }) +} \ No newline at end of file diff --git a/src/views/login/login.vue b/src/views/login/login.vue index ff60821..6105bf2 100644 --- a/src/views/login/login.vue +++ b/src/views/login/login.vue @@ -79,8 +79,8 @@ - - + + { + hospitalApi.getHospitalList().then(data => { + console.log(data) + }); +}) const selectHospital = (e: string) => { // console.log(e) @@ -272,20 +280,22 @@ const selectHospital = (e: string) => { const register = async () => { await registerFormRef.value.validate((valid: any, fields: any) => { if (valid) { - ElMessageBox.confirm( - '注册成功,是否登录?', - { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'success', - draggable: true - } - ).then(() => { - loginParams.value.account = registerFormRef.value.account - loginParams.value.name = registerFormRef.value.name - currentHospital.value = registerFormRef.value.hospital - isShowRegister.value = false; - }).catch(() => { + loginApi.register({...registerParams.value, randomStr}).then(data => { + ElMessageBox.confirm( + '注册成功,是否登录?', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'success', + draggable: true + } + ).then(() => { + loginParams.value.account = registerFormRef.value.account + loginParams.value.name = registerFormRef.value.name + currentHospital.value = registerFormRef.value.hospital + isShowRegister.value = false; + }).catch(() => { + }) }) } else { // console.log('error submit!', fields) @@ -364,7 +374,7 @@ function getCaptchaCode() { } function refreshImg() { - const randomStr = v4() + randomStr = v4() captchaImgUrl.value = '/api/admin/code/textImage?randomStr=' + randomStr } diff --git a/src/views/remote-manage/remote-manage.vue b/src/views/remote-manage/remote-manage.vue index ca601af..4efd922 100644 --- a/src/views/remote-manage/remote-manage.vue +++ b/src/views/remote-manage/remote-manage.vue @@ -150,7 +150,10 @@ const surgeryClient = new Client({ brokerURL: 'ws://localhost:5173/socket.io/admin/rax/SurgeryData', connectHeaders: { token: Session.get('token') - } + }, + reconnectDelay: 5000, + heartbeatIncoming: 60000, + heartbeatOutgoing: 60000 }) surgeryClient.activate()