Skip to content

Commit

Permalink
复制 移动 重命名 资源库
Browse files Browse the repository at this point in the history
  • Loading branch information
muchen committed Oct 28, 2021
1 parent 7336d1f commit 7b16531
Show file tree
Hide file tree
Showing 8 changed files with 462 additions and 22 deletions.
38 changes: 31 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
"dplayer": "^1.26.0",
"element-resize-detector": "^1.2.3",
"plyr": "^3.6.9",
"qs": "^6.10.1",
"streamsaver": "^2.0.5",
"vue": "^3.2.16",
"vue-router": "^4.0.12"
},
"devDependencies": {
"@types/dplayer": "^1.25.2",
"@types/element-resize-detector": "^1.1.3",
"@types/qs": "^6.9.7",
"@types/streamsaver": "^2.0.1",
"@types/video.js": "^7.3.27",
"@vicons/tabler": "^0.11.0",
Expand Down
5 changes: 5 additions & 0 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ const routes: Array<RouteRecordRaw> = [
name: 'setting',
component: () => import('../views/setting.vue')
},
{
path: 'share',
name: 'share',
component: () => import('../views/share.vue')
}
]
},
{
Expand Down
16 changes: 15 additions & 1 deletion src/utils/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ instance.interceptors.response.use(response => {
}

break;
case 400:
case 400: case 403:
window.$message.error(response.data.error_description || '出错了')
default:
break;
Expand All @@ -72,4 +72,18 @@ instance.interceptors.response.use(response => {
return Promise.reject(error)
})

const instance2 = axios.create({})
instance2.interceptors.request.use(request => {
request.headers = {
Authorization: 'Bearer secret_FErDcv3kgsFNLiWUDOWYdJhNqOIKj55eteBg3vIoiLt',
'Notion-Version': '2021-08-16',
'Content-Type': 'application/json'
}
if(request.url?.indexOf('https://cors.z7.workers.dev') === -1) {
request.url = 'https://cors.z7.workers.dev/' + request.url
}
return request
})

export const notionHttp = instance2
export default instance
18 changes: 16 additions & 2 deletions src/views/layout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
import { ref } from '@vue/reactivity';
import { h, onMounted, watch } from '@vue/runtime-core';
import { NLayout, NLayoutSider, NLayoutContent, NMenu, MenuOption, NIcon, NProgress, NText, NModal, NCard, NInput, NButton, NScrollbar, NTime, NTooltip, useDialog } from 'naive-ui'
import { File, Trash, CircleX, Logout, Settings } from '@vicons/tabler'
import { File, Trash, CircleX, Logout, Settings, Share } from '@vicons/tabler'
import http from '../../utils/axios'
import { byteConvert } from '../../utils'
import { useRoute, useRouter } from 'vue-router';
Expand All @@ -100,17 +100,22 @@ import { useRoute, useRouter } from 'vue-router';
key: 'trash',
icon: renderIcon(Trash)
},
{
label: '设置',
key: 'setting',
icon: renderIcon(Settings)
},
{
label: '资源库',
key: 'share',
icon: renderIcon(Share)
}
])
const userInfo = ref()
const getUserInfo = () => {
http.get('https://user.mypikpak.com/v1/user/me')
.then(res => {
window.localStorage.setItem('pikpakUser', JSON.stringify(res.data))
userInfo.value = res.data
})
.catch(error => {
Expand Down Expand Up @@ -284,4 +289,13 @@ import { useRoute, useRouter } from 'vue-router';
font-size: 18px;
cursor: pointer;
}
.list-page {
padding: 40px;
}
@media(max-width: 968px) {
.list-page {
padding: 10px;
}
}
</style>
Loading

0 comments on commit 7b16531

Please sign in to comment.