This commit is contained in:
9
utils/session-context.js
Normal file
9
utils/session-context.js
Normal file
@@ -0,0 +1,9 @@
|
||||
export const getSessionContext = () => ({
|
||||
token: uni.getStorageSync('token') || '',
|
||||
identifier: uni.getStorageSync('identifier') || ''
|
||||
});
|
||||
|
||||
export const isCurrentSession = (context) => {
|
||||
const current = getSessionContext();
|
||||
return !!context.token && context.token === current.token && context.identifier === current.identifier;
|
||||
};
|
||||
Reference in New Issue
Block a user