百度云放盘第三方登录

This commit is contained in:
simple321vip
2022-07-17 10:00:32 +08:00
parent 39b417b6d3
commit 69e05f61a3
11 changed files with 43 additions and 39 deletions
+13 -9
View File
@@ -18,16 +18,20 @@ import Cookies from 'js-cookie'
import { obtainUserInfo } from './api/user'
const whiteList = ['/login']
let url = window.location.href
if (url.search("token") != -1) {
let authorizeToken = url.split("token=")[1]
setToken(authorizeToken)
await obtainUserInfo(authorizeToken).then(response => {
setUser(response.data)
})
router.push({
path: '/home',
})
async function checktoken(url: string) {
if (url.search("token") != -1) {
let authorizeToken = url.split("token=")[1]
setToken(authorizeToken)
await obtainUserInfo(authorizeToken).then(response => {
setUser(response.data)
})
router.push({
path: '/home',
})
}
}
checktoken(url)
/**
* ルーター監視