feat: Support for conversational streaming (#809)
### What problem does this PR solve? feat: Support for conversational streaming #709 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Authorization, Token, UserInfo } from '@/constants/authorization';
|
||||
|
||||
import { getSearchValue } from './commonUtil';
|
||||
const KeySet = [Authorization, Token, UserInfo];
|
||||
|
||||
const storage = {
|
||||
@@ -21,7 +21,7 @@ const storage = {
|
||||
setToken: (value: string) => {
|
||||
localStorage.setItem(Token, value);
|
||||
},
|
||||
setUserInfo: (value: string | Object) => {
|
||||
setUserInfo: (value: string | Record<string, unknown>) => {
|
||||
let valueStr = typeof value !== 'string' ? JSON.stringify(value) : value;
|
||||
localStorage.setItem(UserInfo, valueStr);
|
||||
},
|
||||
@@ -46,4 +46,13 @@ const storage = {
|
||||
},
|
||||
};
|
||||
|
||||
export const getAuthorization = () => {
|
||||
const sharedId = getSearchValue('shared_id');
|
||||
const authorization = sharedId
|
||||
? 'Bearer ' + sharedId
|
||||
: storage.getAuthorization() || '';
|
||||
|
||||
return authorization;
|
||||
};
|
||||
|
||||
export default storage;
|
||||
|
||||
Reference in New Issue
Block a user