Fix JWT token bugs.

This commit is contained in:
Yang Luo
2021-03-14 23:08:08 +08:00
parent f014554415
commit df948e9e34
6 changed files with 39 additions and 8 deletions

View File

@ -17,6 +17,7 @@ import React from "react";
import {isMobile as isMobileDevice} from "react-device-detect";
import "./i18n";
import i18next from "i18next";
import copy from "copy-to-clipboard";
export let ServerUrl = "";
@ -151,3 +152,14 @@ export function changeLanguage(language) {
i18next.changeLanguage(language)
window.location.reload(true);
}
export function getClickable(text) {
return (
<a onClick={() => {
copy(text);
showMessage("success", `Copied to clipboard`);
}}>
{text}
</a>
)
}

View File

@ -130,6 +130,9 @@ class TokenListPage extends React.Component {
key: 'code',
// width: '150px',
sorter: (a, b) => a.code.localeCompare(b.code),
render: (text, record, index) => {
return Setting.getClickable(text);
}
},
{
title: i18next.t("token:Access Token"),
@ -137,6 +140,10 @@ class TokenListPage extends React.Component {
key: 'accessToken',
// width: '150px',
sorter: (a, b) => a.accessToken.localeCompare(b.accessToken),
ellipsis: true,
render: (text, record, index) => {
return Setting.getClickable(text);
}
},
{
title: i18next.t("token:Expires In"),