♻️ Splitting up services (skip ci)

This commit is contained in:
2025-01-10 00:18:26 +08:00
parent df6679bbe3
commit c1140b4e2f
36 changed files with 393 additions and 148 deletions

View File

@@ -1,6 +1,6 @@
import { useUserStore } from '@/services/user'
import { useUserStore } from 'solar-js-sdk'
import { AppBar, AppBarProps, Avatar, IconButton, Toolbar, Typography, useScrollTrigger, useTheme } from '@mui/material'
import { getAttachmentUrl } from '@/services/network'
import { getAttachmentUrl } from 'solar-js-sdk'
import MenuIcon from '@mui/icons-material/Menu'
import AccountCircle from '@mui/icons-material/AccountCircle'
import Link from 'next/link'

View File

@@ -1,5 +1,5 @@
import { SnAttachment } from '@/services/attachment'
import { getAttachmentUrl } from '@/services/network'
import { SnAttachment } from 'solar-js-sdk'
import { getAttachmentUrl } from 'solar-js-sdk'
import { QuestionMark } from '@mui/icons-material'
import { Link, Paper, Typography } from '@mui/material'
import { ComponentProps } from 'react'

View File

@@ -1,14 +1,13 @@
'use client'
import { SnAuthFactor, SnAuthResult, SnAuthTicket } from '@/services/auth'
import { sni } from '@/services/network'
import { setTokenCookies, SnAuthFactor, SnAuthResult, SnAuthTicket } from 'solar-js-sdk'
import { sni } from 'solar-js-sdk'
import { ArrowForward } from '@mui/icons-material'
import { Collapse, Alert, Box, TextField, Button } from '@mui/material'
import { useState } from 'react'
import { useForm } from 'react-hook-form'
import ErrorIcon from '@mui/icons-material/Error'
import { setCookie } from 'cookies-next/client'
export interface SnLoginCheckpointForm {
password: string
@@ -44,8 +43,7 @@ export function SnLoginCheckpoint({
})
const atk: string = tokenResp.data['accessToken']
const rtk: string = tokenResp.data['refreshToken']
setCookie('nex_user_atk', atk, { path: '/', maxAge: 2592000 })
setCookie('nex_user_rtk', rtk, { path: '/', maxAge: 2592000 })
setTokenCookies(atk, rtk)
console.log('[Authenticator] User has been logged in. Result atk: ', atk)
}

View File

@@ -1,7 +1,7 @@
'use client'
import { SnAuthFactor, SnAuthTicket } from '@/services/auth'
import { sni } from '@/services/network'
import { SnAuthFactor, SnAuthTicket } from 'solar-js-sdk'
import { sni } from 'solar-js-sdk'
import { Collapse, Alert, Box, Button, Typography, ButtonGroup } from '@mui/material'
import { useState } from 'react'

View File

@@ -1,10 +1,10 @@
'use client'
import { useState } from 'react'
import { sni } from '@/services/network'
import { sni } from 'solar-js-sdk'
import { ArrowForward } from '@mui/icons-material'
import { Alert, Box, Button, Collapse, Link, TextField, Typography } from '@mui/material'
import { SnAuthFactor, SnAuthResult, SnAuthTicket } from '@/services/auth'
import { SnAuthFactor, SnAuthResult, SnAuthTicket } from 'solar-js-sdk'
import { useForm } from 'react-hook-form'
import NextLink from 'next/link'

View File

@@ -1,4 +1,4 @@
import { checkAuthenticatedClient, redirectToLogin } from '@/services/auth'
import { checkAuthenticatedClient, redirectToLogin } from 'solar-js-sdk'
import { JSX, useEffect } from 'react'
import { DashboardLayout, Navigation } from '@toolpad/core'
import { Box, Stack, Typography } from '@mui/material'