diff --git a/src/services/trxLogin.js b/src/services/trxLogin.js index 4105d2c..4fe4f87 100644 --- a/src/services/trxLogin.js +++ b/src/services/trxLogin.js @@ -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,云管目前不传 diff --git a/src/store/modules/ukey.js b/src/store/modules/ukey.js index 3029b5d..276462a 100644 --- a/src/store/modules/ukey.js +++ b/src/store/modules/ukey.js @@ -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) + } + ) }) } }