百度云放盘第三方登录

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
+8 -8
View File
@@ -6,14 +6,14 @@ const headers = {
const listAll = () => {
return request({
url: '/api/v1/author/blog/list',
url: '/auth/api/v1/author/blog/list',
method: 'GET'
})
}
const updateBtName = (data: Object) => {
return request({
url: '/api/v1/author/blog_type',
url: '/auth/api/v1/author/blog_type',
method: 'POST',
headers: headers,
data: data
@@ -22,7 +22,7 @@ const updateBtName = (data: Object) => {
const putBlogType = (data: Object) => {
return request({
url: '/api/v1/author/blog_type',
url: '/auth/api/v1/author/blog_type',
method: 'PUT',
headers: headers,
data: data
@@ -31,7 +31,7 @@ const putBlogType = (data: Object) => {
const removeBlogType = (data: Object) => {
return request({
url: '/api/v1/author/blog_type',
url: '/auth/api/v1/author/blog_type',
method: 'DELETE',
headers: headers,
data: data
@@ -40,7 +40,7 @@ const removeBlogType = (data: Object) => {
const getContent = (id: string) => {
return request({
url: '/api/v1/author/blog/content/' + id,
url: '/auth/api/v1/author/blog/content/' + id,
method: 'GET',
headers: headers,
})
@@ -48,7 +48,7 @@ const getContent = (id: string) => {
const putBlog = (postData: Object) => {
return request({
url: '/api/v1/author/blog/content',
url: '/auth/api/v1/author/blog/content',
method: 'PUT',
headers: headers,
data: postData
@@ -57,7 +57,7 @@ const putBlog = (postData: Object) => {
const updateContent = (postData: Object) => {
return request({
url: '/api/v1/author/blog/content',
url: '/auth/api/v1/author/blog/content',
method: 'POST',
headers: headers,
data: postData
@@ -66,7 +66,7 @@ const updateContent = (postData: Object) => {
const deleteContent = (bid: string) => {
return request({
url: '/api/v1/author/blog/' + bid,
url: '/auth/api/v1/author/blog/' + bid,
method: 'DELETE',
headers: headers,
})
+3 -3
View File
@@ -7,7 +7,7 @@ const headers = {
const getBlogs = (params: Object) => {
return request({
url: '/api/v1/reader/blogs',
url: '/auth/api/v1/reader/blogs',
method: 'GET',
params: params,
paramsSerializer: (params) => {
@@ -18,7 +18,7 @@ const getBlogs = (params: Object) => {
const getBtName = () => {
return request({
url: '/api/v1/reader/blog_type',
url: '/auth/api/v1/reader/blog_type',
method: 'GET',
headers: headers
})
@@ -26,7 +26,7 @@ const getBtName = () => {
const getBlog = (bid: string) => {
return request({
url: '/api/v1/reader/blog/' + bid,
url: '/auth/api/v1/reader/blog/' + bid,
method: 'GET',
headers: headers
})
+5 -5
View File
@@ -2,7 +2,7 @@ import request from '../utils/request'
import Qs from 'qs'
const search_bookmark = (params: Object) => {
return request({
url: '/api/v1/bookmark',
url: '/auth/api/v1/bookmark',
method: 'get',
params: params,
paramsSerializer: (params) => {
@@ -13,7 +13,7 @@ const search_bookmark = (params: Object) => {
const put_bookmark = (params: Object) => {
return request({
url: '/api/v1/bookmark/insert',
url: '/auth/api/v1/bookmark/insert',
method: 'put',
data: params
})
@@ -21,7 +21,7 @@ const put_bookmark = (params: Object) => {
const update_bookmark = (params: Object) => {
return request({
url: '/api/v1/bookmark/update',
url: '/auth/api/v1/bookmark/update',
method: 'post',
data: params
})
@@ -29,14 +29,14 @@ const update_bookmark = (params: Object) => {
const delete_bookmark = (query: number) => {
return request({
url: '/api/v1/bookmark/delete/' + query,
url: '/auth/api/v1/bookmark/delete/' + query,
method: 'delete',
})
}
const delete_bookmarks = (params: Object) => {
return request({
url: '/api/v1/bookmark',
url: '/auth/api/v1/bookmark',
method: 'delete',
headers: {},
data: params
+1 -1
View File
@@ -6,7 +6,7 @@ const headers = {
const getAudioInfo = (url: string) => {
return request({
url: '/api/v1/common/audio-info',
url: '/auth/api/v1/common/audio-info',
method: 'GET',
params: { url: url },
})
+1 -1
View File
@@ -6,7 +6,7 @@ const headers = {
const getQrCode = () => {
return request({
url: '/authorize/baidu',
url: '/auth/authorize/baidu',
method: 'GET',
headers: headers,
})
+1 -1
View File
@@ -1,7 +1,7 @@
import request from '../utils/request'
const bookmark_type = () => {
return request({
url: '/api/v1/master/bookmark/type',
url: '/auth/api/v1/master/bookmark/type',
method: 'get',
data: {}
})
+5 -5
View File
@@ -2,7 +2,7 @@ import request from '../utils/request'
const get_notes = (params: Object) => {
return request({
url: '/api/v1/one_note',
url: '/auth/api/v1/one_note',
method: 'get',
params: params
})
@@ -10,7 +10,7 @@ const get_notes = (params: Object) => {
const update_page = (params: Object) => {
return request({
url: '/api/v1/one_note/update_page',
url: '/auth/api/v1/one_note/update_page',
method: 'post',
data: params
})
@@ -18,7 +18,7 @@ const update_page = (params: Object) => {
const update_section = (params: Object) => {
return request({
url: '/api/v1/one_note/update_section',
url: '/auth/api/v1/one_note/update_section',
method: 'post',
data: params
})
@@ -26,14 +26,14 @@ const update_section = (params: Object) => {
const insert_section = () => {
return request({
url: '/api/v1/one_note/insert_section',
url: '/auth/api/v1/one_note/insert_section',
method: 'put'
})
}
const insert_page = (params: Object) => {
return request({
url: '/one_note/insert_page',
url: '/auth/one_note/insert_page',
method: 'put',
data: params
})
+2 -2
View File
@@ -1,7 +1,7 @@
import request from '../utils/request'
const authorize = (params: any) => {
return request({
url: '/auth/v1/authorize',
url: '/auth/api/v1/authorize',
method: 'post',
data: params
})
@@ -9,7 +9,7 @@ const authorize = (params: any) => {
const obtainUserInfo = (token: string) => {
return request({
url: '/auth/v1/user_info',
url: '/auth/api/v1/user_info',
method: 'GET',
params: { token: token }
})
+1 -1
View File
@@ -14,7 +14,7 @@
<el-input v-model="loginForm.password" type="password" autocomplete="off" />
</el-form-item> -->
<p class="tang-pass-qrcode-title">请使用<a class="pass-link" href="http://openapi.baidu.com/oauth/2.0/authorize?response_type=code&client_id=WksD0FOVAp8zSRV62qNKxtnCexArVPOf&
redirect_uri=https://www.violin-home.cn/auth/v1/authorize/baidu&scope=basic,netdisk&device_id=26202308&qrcode=1"
redirect_uri=https://www.violin-home.cn/auth/api/v1/authorize/baidu&scope=basic,netdisk&device_id=26202308&qrcode=1"
target="new">百度App</a>扫码登录</p>
<el-button @click="loginWithBaiDu">
百度App
+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)
/**
* ルーター監視