dev
truthhun 7 months ago
parent a4bd1f12a0
commit 5ae2ba5d9a

@ -84,6 +84,7 @@
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="profile"> </el-dropdown-item>
<el-dropdown-item command="copyjwt"> JWT </el-dropdown-item>
<el-dropdown-item command="password"> </el-dropdown-item>
<el-dropdown-item command="logout">退</el-dropdown-item>
</el-dropdown-menu>
@ -264,6 +265,18 @@ export default {
case 'password':
this.formPasswordVisible = true
break
case 'copyjwt':
// 将用户的token复制到剪贴板
const input = document.createElement('input')
input.setAttribute('readonly', 'readonly')
input.setAttribute('value', this.token)
document.body.appendChild(input)
input.select()
input.setSelectionRange(0, 9999)
document.execCommand('copy')
document.body.removeChild(input)
this.$message.success(' JSON Web Token ')
break
case 'logout':
this.logout()
this.$router.replace({ path: '/' })

Loading…
Cancel
Save