整理代码!
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
import { StaffInfo } from "@/data/cpicxim/StaffInfo.js";
|
||||
|
||||
const STUFF_ITEM = "stuff_info";
|
||||
const CALLER_ITEM = "call_info";
|
||||
const USER_TYPE_ITEM = "user_type";
|
||||
|
||||
function loadStaffInfo(): StaffInfo
|
||||
@@ -61,10 +62,28 @@ function getUserType(): string
|
||||
return userType;
|
||||
}
|
||||
|
||||
function saveCallerInfo( callerCode: string ): void
|
||||
{
|
||||
window.localStorage.setItem( CALLER_ITEM, callerCode );
|
||||
}
|
||||
|
||||
function getCallerInfo(): string
|
||||
{
|
||||
return window.localStorage.getItem( CALLER_ITEM ) ?? "";
|
||||
}
|
||||
|
||||
function clearCallerInfo(): void
|
||||
{
|
||||
window.localStorage.removeItem( CALLER_ITEM );
|
||||
}
|
||||
|
||||
export {
|
||||
loadStaffInfo,
|
||||
saveStaffInfo,
|
||||
cleanStaffInfo,
|
||||
saveUserType,
|
||||
getUserType
|
||||
getUserType,
|
||||
saveCallerInfo,
|
||||
getCallerInfo,
|
||||
clearCallerInfo
|
||||
};
|
||||
|
@@ -66,7 +66,7 @@ function getParamsFromURL( url: string ): stringkey
|
||||
// 拆分属性
|
||||
const paramArray: string[] = paramString.split( "&" );
|
||||
|
||||
paramArray.forEach( ( item ) =>
|
||||
paramArray.forEach(( item ) =>
|
||||
{
|
||||
if ( item.length === 0 )
|
||||
{
|
||||
@@ -76,7 +76,7 @@ function getParamsFromURL( url: string ): stringkey
|
||||
const param = item.split( "=" );
|
||||
|
||||
paramObj[param[0]] = param[1] ?? "";
|
||||
} );
|
||||
});
|
||||
|
||||
return paramObj;
|
||||
}
|
||||
|
Reference in New Issue
Block a user