From 3ab1aa349c9c9744b2b4d4d739c157a9fc17d0bd Mon Sep 17 00:00:00 2001 From: xiaokaixuan Date: Tue, 17 May 2022 11:37:32 +0800 Subject: [PATCH] Request Merge --- index.html | 2 +- src/config/index.ts | 12 ++++++------ src/router/index.ts | 2 +- src/utils/axios.ts | 2 +- src/views/layout/index.vue | 7 ++++--- src/views/login.vue | 5 +++-- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index 3bd1badf8..025e1b6fa 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + PikPak diff --git a/src/config/index.ts b/src/config/index.ts index c107cb405..701484ffb 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -1,10 +1,10 @@ export const proxy = [ - 'https://cors.z13.workers.dev', - 'https://cors.z14.workers.dev', - 'https://cors.z15.workers.dev', - 'https://cors.z16.workers.dev', - 'https://cors.z17.workers.dev', - 'https://cors.z18.workers.dev', + 'https://api.13pikpak.cf', + 'https://api.14pikpak.cf', + 'https://api.15pikpak.cf', + 'https://api.16pikpak.cf', + 'https://api.17pikpak.cf', + 'https://api.18pikpak.cf', ] export const version = '1.0.0' \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 7bdbdb564..118c723f9 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,6 +1,6 @@ import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' import Layout from '../views/layout/index.vue' -const routes: Array = [ +const routes: RouteRecordRaw[] = [ { path: '/', name: 'home', diff --git a/src/utils/axios.ts b/src/utils/axios.ts index 3f6a494b4..14cccb2fe 100644 --- a/src/utils/axios.ts +++ b/src/utils/axios.ts @@ -60,7 +60,7 @@ instance.interceptors.response.use(response => { }) } else { router.push('/login') - return false + return Promise.reject(error) } break; diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue index 2a928e539..584765a26 100644 --- a/src/views/layout/index.vue +++ b/src/views/layout/index.vue @@ -12,7 +12,7 @@ bordered > - +
PikPak
@@ -177,8 +177,9 @@ import { useRoute, useRouter } from 'vue-router' const code = ref() const showCode = ref(false) const postCode = () => { - http.post('https://api-drive.mypikpak.com/vip/v1/order/free', { - activation_code: code.value + http.post('https://api-drive.mypikpak.com/vip/v1/order/activation-code', { + activation_code: code.value, + data: {} }) .then(res => { window.$message.success('兑换成功') diff --git a/src/views/login.vue b/src/views/login.vue index df0bd8b74..b9a8986b3 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -59,12 +59,13 @@ import { ref } from '@vue/reactivity'; import { NForm, NFormItem, NInput, NButton, useMessage, NCheckbox, useDialog, NTooltip, NIcon, NSpace } from 'naive-ui' import http from '../utils/axios' -import { useRouter } from 'vue-router' +import { useRoute, useRouter } from 'vue-router' import { BrandGoogle, Phone } from '@vicons/tabler' const loginData = ref({ username: '', password: '' }) +const route = useRoute() const loading = ref(false) const router = useRouter() const message = useMessage() @@ -88,7 +89,7 @@ const loginPost = () => { window.localStorage.removeItem('pikpakLoginData') } message.success('登录成功') - router.push('/') + router.push((route.query.redirect || '/') + '') } }) .catch(() => {