mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-12 04:03:42 +08:00
opt:Optimize the algorithm to check whether Midjourney images can continue to variation
This commit is contained in:
@@ -1,19 +1,26 @@
|
||||
/* eslint-disable no-constant-condition */
|
||||
|
||||
import {randString} from "@/utils/libs";
|
||||
|
||||
/**
|
||||
* storage handler
|
||||
*/
|
||||
|
||||
const SessionUserKey = 'SESSION_ID';
|
||||
const SessionIDKey = 'SESSION_ID';
|
||||
|
||||
export function getSessionId() {
|
||||
return sessionStorage.getItem(SessionUserKey)
|
||||
let sessionId = sessionStorage.getItem(SessionIDKey)
|
||||
if (!sessionId) {
|
||||
sessionId = randString(42)
|
||||
setSessionId(sessionId)
|
||||
}
|
||||
return sessionId
|
||||
}
|
||||
|
||||
export function removeLoginUser() {
|
||||
sessionStorage.removeItem(SessionUserKey)
|
||||
sessionStorage.removeItem(SessionIDKey)
|
||||
}
|
||||
|
||||
export function setSessionId(sessionId) {
|
||||
sessionStorage.setItem(SessionUserKey, sessionId)
|
||||
sessionStorage.setItem(SessionIDKey, sessionId)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user