feat: add Nox-API upstream support

This commit is contained in:
liumangmang
2026-06-30 11:22:38 +08:00
parent 9600e4ceba
commit a914d3d222
8 changed files with 189 additions and 33 deletions
@@ -112,7 +112,7 @@ const props = defineProps<{
const emit = defineEmits<{
(e: 'update:modelValue', v: boolean): void
(e: 'select', candidate: { type: string; value: string; source: string; cookie_name?: string; cookie_value?: string; cookie_count?: number; cookie_names?: string[]; new_api_user?: string }): void
(e: 'select', candidate: { type: string; value: string; source: string; cookie_name?: string; cookie_value?: string; cookie_count?: number; cookie_names?: string[]; new_api_user?: string; user_id?: string }): void
}>()
const visible = ref(props.modelValue)
@@ -170,6 +170,7 @@ function resolveCandidateValue(candidate: AuthCaptureCandidate): string {
}
function resolveNewApiUser(rawResult: AuthCaptureResult, candidate: AuthCaptureCandidate): string | undefined {
if (candidate.user_id) return candidate.user_id
if (candidate.new_api_user) return candidate.new_api_user
const stores = [rawResult.storage, rawResult.session_storage]
for (const store of stores) {
@@ -327,6 +328,7 @@ async function confirmImportSelection() {
cookie_value: fullCandidate.cookie_value,
cookie_count: fullCandidate.cookie_count,
cookie_names: fullCandidate.cookie_names,
user_id: resolveNewApiUser(rawResult.data.result, fullCandidate),
new_api_user: resolveNewApiUser(rawResult.data.result, fullCandidate),
})
closeDialog()