Commit 2b1808c2 authored by 郑磊's avatar 郑磊

更新token解析方式

parent e9057621
...@@ -57,16 +57,10 @@ export function parseToken(): TokenData | undefined { ...@@ -57,16 +57,10 @@ export function parseToken(): TokenData | undefined {
source: 'hash_encoded', source: 'hash_encoded',
} }
} catch (e: unknown) { } catch (e: unknown) {
try { return {
const value = decodeToken(token) token,
if (!value) { source: 'hash_raw',
throw new Error() }
}
return {
token: value,
source: 'hash_raw',
}
} catch (e: unknown) {}
} }
} }
} }
...@@ -87,16 +81,10 @@ export function parseToken(): TokenData | undefined { ...@@ -87,16 +81,10 @@ export function parseToken(): TokenData | undefined {
source: 'url_encoded', source: 'url_encoded',
} }
} catch (e: unknown) { } catch (e: unknown) {
try { return {
const value = decodeToken(token) token,
if (!value) { source: 'url_raw',
throw new Error() }
}
return {
token: value,
source: 'url_raw',
}
} catch (e: unknown) {}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment