fix: 登出时增加天融信 token 传参

develop
时启龙 2024-08-23 16:44:39 +08:00
parent 6eb541dd14
commit 2553434bd3
2 changed files with 14 additions and 11 deletions

View File

@ -16,8 +16,8 @@ export function trxLogin(params) {
return request.post('/sms/v1/trx/login', params)
}
export function offlineToken() {
return request.post('/sms/v1/trx/logout')
export function offlineToken(trxToken) {
return request.post('/sms/v1/trx/logout', { trxToken })
}
// 理想那边给的代码调用 getAuthToken 时需要传 ip,云管目前不传

View File

@ -2,6 +2,7 @@ import { getClientHello, getClientAuth } from 'services/ukeyAuth.js'
import { getLoginRandom, trxLogin, offlineToken } from 'services/trxLogin.js'
import Cookies from 'js-cookie'
import { ElMessage } from 'element-plus'
import { getTrxToken } from 'utils/auth'
const state = {}
const mutations = {}
const actions = {
@ -70,15 +71,17 @@ const actions = {
success: true
})
// 调用天融信单点退出系统
// offlineToken().then(
// res => {
// console.log('调用天融信单点退出系统', res)
// resolve(res)
// },
// err => {
// reject(err)
// }
// )
const trxToken = getTrxToken()
if (!trxToken) reject(new Error('未找到 trxToken'))
offlineToken(trxToken).then(
res => {
console.log('调用天融信单点退出系统', res)
resolve(res)
},
err => {
reject(err)
}
)
})
}
}