|
|
|
@ -67,6 +67,10 @@ const TokenModal = defineComponent({
|
|
|
|
|
: '' |
|
|
|
|
variables.model.expireTime = Date.now() |
|
|
|
|
variables.model.token = '' |
|
|
|
|
} else { |
|
|
|
|
variables.model.userId = props.row.userId |
|
|
|
|
variables.model.expireTime = new Date(props.row.expireTime).getTime() |
|
|
|
|
variables.model.token = props.row.token |
|
|
|
|
} |
|
|
|
|
ctx.emit('cancelModal', props.showModalRef) |
|
|
|
|
} |
|
|
|
@ -75,6 +79,12 @@ const TokenModal = defineComponent({
|
|
|
|
|
handleValidate(props.statusRef) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const changeUser = () => { |
|
|
|
|
if (props.statusRef !== 0) { |
|
|
|
|
variables.model.token = '' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
|
() => props.showModalRef, |
|
|
|
|
() => { |
|
|
|
@ -119,11 +129,12 @@ const TokenModal = defineComponent({
|
|
|
|
|
cancelModal, |
|
|
|
|
confirmModal, |
|
|
|
|
getToken, |
|
|
|
|
changeUser, |
|
|
|
|
userStore |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
render() { |
|
|
|
|
const { t, getToken, userStore } = this |
|
|
|
|
const { t, getToken, changeUser, userStore } = this |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div> |
|
|
|
@ -171,6 +182,7 @@ const TokenModal = defineComponent({
|
|
|
|
|
placeholder={t('security.token.user_tips')} |
|
|
|
|
options={this.model.generalOptions} |
|
|
|
|
v-model={[this.model.userId, 'value']} |
|
|
|
|
onUpdateValue={changeUser} |
|
|
|
|
/> |
|
|
|
|
</NFormItem> |
|
|
|
|
)} |
|
|
|
|