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) return request.post('/sms/v1/trx/login', params)
} }
export function offlineToken() { export function offlineToken(trxToken) {
return request.post('/sms/v1/trx/logout') return request.post('/sms/v1/trx/logout', { trxToken })
} }
// 理想那边给的代码调用 getAuthToken 时需要传 ip,云管目前不传 // 理想那边给的代码调用 getAuthToken 时需要传 ip,云管目前不传

View File

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