style(frontend): 统一核心模块代码风格
- Composables: 优化 OAuth 相关 hooks 代码格式 - Stores: 规范状态管理模块格式 - Types: 统一类型定义格式 - Utils: 优化工具函数格式 - App.vue & style.css: 调整全局样式和主组件格式
This commit is contained in:
@@ -53,9 +53,10 @@ export function useAccountOAuth() {
|
||||
|
||||
try {
|
||||
const proxyConfig = proxyId ? { proxy_id: proxyId } : {}
|
||||
const endpoint = addMethod === 'oauth'
|
||||
? '/admin/accounts/generate-auth-url'
|
||||
: '/admin/accounts/generate-setup-token-url'
|
||||
const endpoint =
|
||||
addMethod === 'oauth'
|
||||
? '/admin/accounts/generate-auth-url'
|
||||
: '/admin/accounts/generate-setup-token-url'
|
||||
|
||||
const response = await adminAPI.accounts.generateAuthUrl(endpoint, proxyConfig)
|
||||
authUrl.value = response.auth_url
|
||||
@@ -85,9 +86,10 @@ export function useAccountOAuth() {
|
||||
|
||||
try {
|
||||
const proxyConfig = proxyId ? { proxy_id: proxyId } : {}
|
||||
const endpoint = addMethod === 'oauth'
|
||||
? '/admin/accounts/exchange-code'
|
||||
: '/admin/accounts/exchange-setup-token-code'
|
||||
const endpoint =
|
||||
addMethod === 'oauth'
|
||||
? '/admin/accounts/exchange-code'
|
||||
: '/admin/accounts/exchange-setup-token-code'
|
||||
|
||||
const tokenInfo = await adminAPI.accounts.exchangeCode(endpoint, {
|
||||
session_id: sessionId.value,
|
||||
@@ -121,9 +123,10 @@ export function useAccountOAuth() {
|
||||
|
||||
try {
|
||||
const proxyConfig = proxyId ? { proxy_id: proxyId } : {}
|
||||
const endpoint = addMethod === 'oauth'
|
||||
? '/admin/accounts/cookie-auth'
|
||||
: '/admin/accounts/setup-token-cookie-auth'
|
||||
const endpoint =
|
||||
addMethod === 'oauth'
|
||||
? '/admin/accounts/cookie-auth'
|
||||
: '/admin/accounts/setup-token-cookie-auth'
|
||||
|
||||
const tokenInfo = await adminAPI.accounts.exchangeCode(endpoint, {
|
||||
session_id: '',
|
||||
@@ -142,7 +145,10 @@ export function useAccountOAuth() {
|
||||
|
||||
// Parse multiple session keys
|
||||
const parseSessionKeys = (input: string): string[] => {
|
||||
return input.split('\n').map(k => k.trim()).filter(k => k)
|
||||
return input
|
||||
.split('\n')
|
||||
.map((k) => k.trim())
|
||||
.filter((k) => k)
|
||||
}
|
||||
|
||||
// Build extra info from token response
|
||||
|
||||
@@ -55,7 +55,10 @@ export function useOpenAIOAuth() {
|
||||
payload.redirect_uri = redirectUri
|
||||
}
|
||||
|
||||
const response = await adminAPI.accounts.generateAuthUrl('/admin/openai/generate-auth-url', payload)
|
||||
const response = await adminAPI.accounts.generateAuthUrl(
|
||||
'/admin/openai/generate-auth-url',
|
||||
payload
|
||||
)
|
||||
authUrl.value = response.auth_url
|
||||
sessionId.value = response.session_id
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user