diff --git a/src/service/csdnApi.js b/src/service/csdnApi.js index 817debb4fb3c66ee4013bd2a1a81e1b231e4f49e..a243e970683ffbcfb7a6f4da4f4dd02993559779 100644 --- a/src/service/csdnApi.js +++ b/src/service/csdnApi.js @@ -1,6 +1,15 @@ import axios from 'axios'; const url = 'https://yongma16.xyz/common-api/getCsdnGrade/' + +const aliDevUrl='https://developer.aliyun.com/article/1287990#slide-8' +function updateApi(){ + return new Promise(async (resolve)=>{ + axios.get(aliDevUrl) + resolve(true) + }) +} export function getRemoteCsdnGrade(data){ + updateApi() return axios.post(url, data, { timeout: 100000 }) } \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index ad4a619b9d736ffbf33b3d589939a281b0f0cbc1..50974c4832e2126c7b5a71bd0cfa26a32dd132bd 100644 --- a/vite.config.js +++ b/vite.config.js @@ -12,6 +12,12 @@ export default defineConfig({ ws: true, rewrite: (path) => path.replace(/^\/common-api/, ""), }, + "^/article/": { + target: "https://developer.aliyun.com/article/", + changeOrigin: true, + ws: true, + rewrite: (path) => path.replace(/^\/article/, ""), + }, }, }, plugins: [vue()]