Revert "test: log调试请求头获取功能"
This reverts commit 62e75d0061d82cb69f24b750c7553b6fe1b6d6cd.
This commit is contained in:
parent
e4f9f6636d
commit
4cbd9f562c
@ -681,12 +681,10 @@ const headerInfo = ref({})
|
||||
const connectToApp = async () => {
|
||||
console.group('🔗 APP Connection Process')
|
||||
console.debug('🚀 Starting APP connection...')
|
||||
console.log('connectToApp()')
|
||||
|
||||
try {
|
||||
// 检查是否在APP环境中
|
||||
if (!isInApp()) {
|
||||
console.log('!isInApp()')
|
||||
console.debug('🌐 Browser environment detected')
|
||||
appConnected.value = true
|
||||
console.groupEnd()
|
||||
@ -699,15 +697,12 @@ const connectToApp = async () => {
|
||||
|
||||
// 检查是否已经连接且未过期
|
||||
if (isAppConnected()) {
|
||||
console.log('isAppConnected()')
|
||||
console.debug('✅ APP already connected and valid')
|
||||
appConnected.value = true
|
||||
|
||||
// 使用缓存的头部信息
|
||||
const cachedHeaderInfo = getAppHeaderInfo()
|
||||
if (cachedHeaderInfo) {
|
||||
console.log('cachedHeaderInfo')
|
||||
|
||||
headerInfo.value = cachedHeaderInfo
|
||||
console.debug('🔧 Using cached HTTP headers')
|
||||
}
|
||||
@ -722,8 +717,6 @@ const connectToApp = async () => {
|
||||
|
||||
// 检查是否有正在进行的连接
|
||||
if (appConnectionManager.isConnecting()) {
|
||||
console.log('appConnectionManager.isConnecting()')
|
||||
|
||||
console.debug('⏳ Connection already in progress, waiting...')
|
||||
await appConnectionManager.getConnectionPromise()
|
||||
appConnected.value = true
|
||||
@ -738,18 +731,14 @@ const connectToApp = async () => {
|
||||
|
||||
// 建立新的APP连接
|
||||
console.debug('📱 Establishing new APP connection...')
|
||||
console.log('📱 Establishing new APP connection...')
|
||||
|
||||
const connectionResult = await new Promise((resolve, reject) => {
|
||||
const connectionPromise = new Promise((connectResolve, connectReject) => {
|
||||
connectApplication(async (access) => {
|
||||
try {
|
||||
const result = parseAccessOrigin(access)
|
||||
console.log('获取请求头信息:', result)
|
||||
|
||||
if (result.success) {
|
||||
console.log('result.success')
|
||||
|
||||
// 解析头部信息
|
||||
headerInfo.value = parseHeader(result.data)
|
||||
|
||||
@ -765,15 +754,11 @@ const connectToApp = async () => {
|
||||
connectResolve({ success: true, environment: 'app', fromCache: false })
|
||||
} else {
|
||||
console.error('❌ Failed to parse access origin:', result.error)
|
||||
console.log('获取请求头信息失败:', result.error)
|
||||
|
||||
appConnectionManager.reset()
|
||||
connectReject(new Error(result.error))
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('❌ Connection process failed:', error)
|
||||
console.log('连接失败:', error)
|
||||
|
||||
appConnectionManager.reset()
|
||||
connectReject(error)
|
||||
}
|
||||
@ -785,7 +770,6 @@ const connectToApp = async () => {
|
||||
|
||||
connectionPromise.then(resolve).catch(reject)
|
||||
})
|
||||
console.log('连接成功')
|
||||
|
||||
console.debug('✅ Connection completed successfully')
|
||||
console.groupEnd()
|
||||
@ -795,8 +779,6 @@ const connectToApp = async () => {
|
||||
|
||||
return connectionResult
|
||||
} catch (error) {
|
||||
console.log('连接失败:', error)
|
||||
|
||||
console.error('❌ Connection failed:', error)
|
||||
appConnected.value = false
|
||||
console.groupEnd()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user