Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
f9ab1daa
Commit
f9ab1daa
authored
Jan 23, 2026
by
shaw
Browse files
feat: 保存并显示OAuth账号邮箱地址
parent
d27b8474
Changes
4
Show whitespace changes
Inline
Side-by-side
backend/internal/pkg/oauth/oauth.go
View file @
f9ab1daa
...
@@ -216,4 +216,5 @@ type OrgInfo struct {
...
@@ -216,4 +216,5 @@ type OrgInfo struct {
// AccountInfo represents account info from OAuth response
// AccountInfo represents account info from OAuth response
type
AccountInfo
struct
{
type
AccountInfo
struct
{
UUID
string
`json:"uuid"`
UUID
string
`json:"uuid"`
EmailAddress
string
`json:"email_address"`
}
}
backend/internal/service/oauth_service.go
View file @
f9ab1daa
...
@@ -122,6 +122,7 @@ type TokenInfo struct {
...
@@ -122,6 +122,7 @@ type TokenInfo struct {
Scope
string
`json:"scope,omitempty"`
Scope
string
`json:"scope,omitempty"`
OrgUUID
string
`json:"org_uuid,omitempty"`
OrgUUID
string
`json:"org_uuid,omitempty"`
AccountUUID
string
`json:"account_uuid,omitempty"`
AccountUUID
string
`json:"account_uuid,omitempty"`
EmailAddress
string
`json:"email_address,omitempty"`
}
}
// ExchangeCode exchanges authorization code for tokens
// ExchangeCode exchanges authorization code for tokens
...
@@ -252,10 +253,16 @@ func (s *OAuthService) exchangeCodeForToken(ctx context.Context, code, codeVerif
...
@@ -252,10 +253,16 @@ func (s *OAuthService) exchangeCodeForToken(ctx context.Context, code, codeVerif
tokenInfo
.
OrgUUID
=
tokenResp
.
Organization
.
UUID
tokenInfo
.
OrgUUID
=
tokenResp
.
Organization
.
UUID
log
.
Printf
(
"[OAuth] Got org_uuid: %s"
,
tokenInfo
.
OrgUUID
)
log
.
Printf
(
"[OAuth] Got org_uuid: %s"
,
tokenInfo
.
OrgUUID
)
}
}
if
tokenResp
.
Account
!=
nil
&&
tokenResp
.
Account
.
UUID
!=
""
{
if
tokenResp
.
Account
!=
nil
{
if
tokenResp
.
Account
.
UUID
!=
""
{
tokenInfo
.
AccountUUID
=
tokenResp
.
Account
.
UUID
tokenInfo
.
AccountUUID
=
tokenResp
.
Account
.
UUID
log
.
Printf
(
"[OAuth] Got account_uuid: %s"
,
tokenInfo
.
AccountUUID
)
log
.
Printf
(
"[OAuth] Got account_uuid: %s"
,
tokenInfo
.
AccountUUID
)
}
}
if
tokenResp
.
Account
.
EmailAddress
!=
""
{
tokenInfo
.
EmailAddress
=
tokenResp
.
Account
.
EmailAddress
log
.
Printf
(
"[OAuth] Got email_address: %s"
,
tokenInfo
.
EmailAddress
)
}
}
return
tokenInfo
,
nil
return
tokenInfo
,
nil
}
}
...
...
frontend/src/composables/useAccountOAuth.ts
View file @
f9ab1daa
...
@@ -17,6 +17,7 @@ export interface OAuthState {
...
@@ -17,6 +17,7 @@ export interface OAuthState {
export
interface
TokenInfo
{
export
interface
TokenInfo
{
org_uuid
?:
string
org_uuid
?:
string
account_uuid
?:
string
account_uuid
?:
string
email_address
?:
string
[
key
:
string
]:
unknown
[
key
:
string
]:
unknown
}
}
...
@@ -160,6 +161,9 @@ export function useAccountOAuth() {
...
@@ -160,6 +161,9 @@ export function useAccountOAuth() {
if
(
tokenInfo
.
account_uuid
)
{
if
(
tokenInfo
.
account_uuid
)
{
extra
.
account_uuid
=
tokenInfo
.
account_uuid
extra
.
account_uuid
=
tokenInfo
.
account_uuid
}
}
if
(
tokenInfo
.
email_address
)
{
extra
.
email_address
=
tokenInfo
.
email_address
}
return
Object
.
keys
(
extra
).
length
>
0
?
extra
:
undefined
return
Object
.
keys
(
extra
).
length
>
0
?
extra
:
undefined
}
}
...
...
frontend/src/views/admin/AccountsView.vue
View file @
f9ab1daa
...
@@ -113,8 +113,17 @@
...
@@ -113,8 +113,17 @@
<
template
#
cell
-
select
=
"
{ row
}
"
>
<
template
#
cell
-
select
=
"
{ row
}
"
>
<
input
type
=
"
checkbox
"
:
checked
=
"
selIds.includes(row.id)
"
@
change
=
"
toggleSel(row.id)
"
class
=
"
rounded border-gray-300 text-primary-600 focus:ring-primary-500
"
/>
<
input
type
=
"
checkbox
"
:
checked
=
"
selIds.includes(row.id)
"
@
change
=
"
toggleSel(row.id)
"
class
=
"
rounded border-gray-300 text-primary-600 focus:ring-primary-500
"
/>
<
/template
>
<
/template
>
<
template
#
cell
-
name
=
"
{ value
}
"
>
<
template
#
cell
-
name
=
"
{ row, value
}
"
>
<
div
class
=
"
flex flex-col
"
>
<
span
class
=
"
font-medium text-gray-900 dark:text-white
"
>
{{
value
}}
<
/span
>
<
span
class
=
"
font-medium text-gray-900 dark:text-white
"
>
{{
value
}}
<
/span
>
<
span
v
-
if
=
"
row.extra?.email_address
"
class
=
"
text-xs text-gray-500 dark:text-gray-400 truncate max-w-[200px]
"
:
title
=
"
row.extra.email_address
"
>
{{
row
.
extra
.
email_address
}}
<
/span
>
<
/div
>
<
/template
>
<
/template
>
<
template
#
cell
-
notes
=
"
{ value
}
"
>
<
template
#
cell
-
notes
=
"
{ value
}
"
>
<
span
v
-
if
=
"
value
"
:
title
=
"
value
"
class
=
"
block max-w-xs truncate text-sm text-gray-600 dark:text-gray-300
"
>
{{
value
}}
<
/span
>
<
span
v
-
if
=
"
value
"
:
title
=
"
value
"
class
=
"
block max-w-xs truncate text-sm text-gray-600 dark:text-gray-300
"
>
{{
value
}}
<
/span
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment