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 {
const value = decodeToken(token)
if (!value) {
throw new Error()
}
return { return {
token: value, token,
source: 'hash_raw', 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 {
const value = decodeToken(token)
if (!value) {
throw new Error()
}
return { return {
token: value, token,
source: 'url_raw', 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