mirror of
https://github.com/exzork/gc-tools.git
synced 2024-11-25 09:27:44 +00:00
fix
This commit is contained in:
parent
03472e382b
commit
816f32df19
@ -99,6 +99,10 @@ export default function GCAuth() {
|
||||
try {
|
||||
let resJson = JSON.parse(resText);
|
||||
if (resJson.success) {
|
||||
setJwt(resJson.jwt);
|
||||
const splitToken = resJson.jwt.split(".");
|
||||
const payload = JSON.parse(atob(splitToken[1]));
|
||||
setToken(payload.token);
|
||||
await Swal.fire({
|
||||
toast: true,
|
||||
position: "top-end",
|
||||
@ -108,10 +112,6 @@ export default function GCAuth() {
|
||||
title: "Login success",
|
||||
icon: "success"
|
||||
});
|
||||
setJwt(resJson.jwt);
|
||||
const splitToken = resJson.jwt.split(".");
|
||||
const payload = JSON.parse(atob(splitToken[1]));
|
||||
setToken(payload.token);
|
||||
} else {
|
||||
await Swal.fire({
|
||||
title: "Login failed",
|
||||
|
Loading…
Reference in New Issue
Block a user