From b7c3ac660797401c05429194c01105a93097eb38 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Fri, 28 Mar 2025 10:12:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=AE=E6=8D=A2token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user.js | 9 ++++++++- src/views/login/index.vue | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/api/user.js b/src/api/user.js index 86829aa..28368b6 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -167,5 +167,12 @@ export function loginSelectUserRole(params) { params }) } - +// 置换token +export function TJUserLoginInfo(params) { + return request({ + url: `/user/TJUserLoginInfo`, + method: 'get', + params + }) +} diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 96ce096..e3384c8 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -122,6 +122,7 @@ import Img1 from '@/assets/pic-1.png' import logoImg from '@/assets/zzlogo2.png' import { getHospital } from '@/api/hospital.js' import { getHIRHospitalList, updateDefaultHospital } from '@/api/admin' +import { TJUserLoginInfo } from '@/api/user' // import config from '/public/config.js' export default { @@ -204,9 +205,23 @@ export default { this.$updateDictionary() // } // } + if (this.$route.query.token) { + this.TJUserLoginInfo(this.$route.query.token) + } }, methods: { ...mapMutations({ setLanguage: 'lang/setLanguage' }), + // 置换token + async TJUserLoginInfo(Token) { + try { + let params = { + Token + } + let res = await TJUserLoginInfo(params) + } catch (err) { + console.log(err) + } + }, async saveHospital() { if (this.form.Id === this.hospital.Id) return this.visible = false let res = await updateDefaultHospital({