Merge branch 'master' into willianrod_feat/add-favicon-badges

# Conflicts:
#	package-lock.json
#	src/mixins/socket.js
This commit is contained in:
Louis Lam
2022-03-12 11:17:32 +08:00
118 changed files with 20645 additions and 4162 deletions

View File

@@ -1,5 +1,6 @@
import { io } from "socket.io-client";
import { useToast } from "vue-toastification";
import jwt_decode from "jwt-decode";
import Favico from "favico.js";
const toast = useToast();
@@ -233,6 +234,15 @@ export default {
return (this.remember) ? localStorage : sessionStorage;
},
getJWTPayload() {
const jwtToken = this.$root.storage().token;
if (jwtToken && jwtToken !== "autoLogin") {
return jwt_decode(jwtToken);
}
return undefined;
},
getSocket() {
return socket;
},
@@ -281,10 +291,10 @@ export default {
},
logout() {
socket.emit("logout", () => { });
this.storage().removeItem("token");
this.socket.token = null;
this.loggedIn = false;
this.clearData();
},