Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mx-space/mx-admin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ebffb977c353bed7b598cf512ed75906061cbeab
Choose a base ref
..
head repository: mx-space/mx-admin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6672e460ff435d3d591fb0b98f5a68d261aa0ae0
Choose a head ref
Showing with 2 additions and 27 deletions.
  1. +1 −24 src/utils/auth.ts
  2. +0 −1 src/views/dashboard/index.tsx
  3. +1 −2 tsconfig.json
25 changes: 1 addition & 24 deletions src/utils/auth.ts
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ export function setToken(token: string) {
export function removeToken() {
return Cookies.remove(TokenKey)
}

export const attachTokenFromQuery = () => {
const token = new URLSearchParams(window.location.search).get('token')
if (token) {
@@ -48,29 +49,5 @@ export const attachTokenFromQuery = () => {
query,
})
})
} else {
// hash mode

const hash = window.location.hash.slice(1)

const parsedUrl = new URL(hash, window.location.origin)
const token = parsedUrl.searchParams.get('token')
if (token) {
setToken(token)
setTokenIsUpstream(true)
parsedUrl.searchParams.delete('token')

router.isReady().then(() => {
const query = {} as any
for (const [key, value] of parsedUrl.searchParams.entries()) {
query[key] = value
}

router.replace({
path: parsedUrl.pathname,
query,
})
})
}
}
}
1 change: 0 additions & 1 deletion src/views/dashboard/index.tsx
Original file line number Diff line number Diff line change
@@ -71,7 +71,6 @@ import { UpdatePanel } from './update-panel'

export const DashBoardView = defineComponent({
name: 'DashboardView',

setup() {
const stat = ref(
new Proxy(
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -18,8 +18,7 @@
"skipDefaultLibCheck": true,
"lib": [
"esnext",
"dom",
"dom.iterable"
"dom"
],
"types": [],
"paths": {