fix: web app auto login

pull/20109/head
NFish 12 months ago
parent 75d5f2df3c
commit 3b52ba3ba2

@ -12,7 +12,7 @@ export default function SignInLayout({ children }: any) {
<div className={cn('flex w-full shrink-0 flex-col rounded-2xl border border-effects-highlight bg-background-default-subtle')}> <div className={cn('flex w-full shrink-0 flex-col rounded-2xl border border-effects-highlight bg-background-default-subtle')}>
{/* <Header /> */} {/* <Header /> */}
<div className={cn('flex w-full grow flex-col items-center justify-center px-6 md:px-[108px]')}> <div className={cn('flex w-full grow flex-col items-center justify-center px-6 md:px-[108px]')}>
<div className='flex flex-col md:w-[400px] lg:w-[600px]'> <div className='flex flex-col md:w-[440px] lg:w-[600px]'>
{children} {children}
</div> </div>
</div> </div>

@ -25,7 +25,8 @@ export const checkOrSetAccessToken = async (appCode?: string) => {
} }
if (!accessTokenJson[sharedToken]?.[userId || 'DEFAULT']) { if (!accessTokenJson[sharedToken]?.[userId || 'DEFAULT']) {
const res = await fetchAccessToken({ appCode: sharedToken, userId }) const webAppAccessToken = localStorage.getItem('webapp_access_token')
const res = await fetchAccessToken({ appCode: sharedToken, userId, webAppAccessToken })
accessTokenJson[sharedToken] = { accessTokenJson[sharedToken] = {
...accessTokenJson[sharedToken], ...accessTokenJson[sharedToken],
[userId || 'DEFAULT']: res.access_token, [userId || 'DEFAULT']: res.access_token,

Loading…
Cancel
Save