[go: nahoru, domu]

Skip to content

Commit

Permalink
feat: 更新说明
Browse files Browse the repository at this point in the history
  • Loading branch information
imsyy committed Aug 8, 2023
1 parent b5ec3aa commit 540b0c5
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .env
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 全局 API 地址
## 需部署 API,详见 https://github.com/Binaryify/NeteaseCloudMusicApi
# VITE_MUSIC_API = "https://api-music.imsyy.top/"
VITE_MUSIC_API = "http://localhost:3000/"
VITE_MUSIC_API = "https://api-music.imsyy.top/"
# VITE_MUSIC_API = "http://localhost:3000/"

# 网易云解灰 API 地址(可选功能)
## 需部署 API,详见 https://github.com/imsyy/UNM-Server#%E8%BF%90%E8%A1%8C
# VITE_UNM_API = "https://api-unm.imsyy.top/"
VITE_UNM_API = "http://localhost:5678/"
VITE_UNM_API = "https://api-unm.imsyy.top/"
# VITE_UNM_API = "http://localhost:5678/"

# 站点标题
VITE_SITE_TITLE = "SPlayer"
Expand All @@ -27,8 +27,8 @@ VITE_ICP = "豫ICP备2022018134号-1"
# 公告配置
## 若无需公告,请将任意一项设为空即可
## 公告标题
VITE_ANN_TITLE = "访问超量"
VITE_ANN_TITLE = "温馨提醒"
## 公告内容
VITE_ANN_CONTENT = "由于演示站访问量超出,暂时无法正常使用,请自行部署后查看效果"
VITE_ANN_CONTENT = "由于演示站访问量随时可能超出,请自行部署后查看效果"
## 公告时长(毫秒)不可超过 999999
VITE_ANN_DURATION = 8000
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"unplugin-auto-import": "^0.12.0",
"unplugin-vue-components": "^0.22.11",
"vite": "^4.3.8",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-pwa": "^0.15.0"
}
}
21 changes: 20 additions & 1 deletion pnpm-lock.yaml

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

8 changes: 4 additions & 4 deletions src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ axios.interceptors.response.use(
const data = error.response.data;
switch (error.response.status) {
case 401:
console.error("无权限访问");
console.error(data.message ? data.message : "无权限访问");
break;
case 301:
console.error("请求发生重定向");
console.error(data.message ? data.message : "请求发生重定向");
break;
case 404:
console.error("请求资源不存在");
console.error(data.message ? data.message : "请求资源不存在");
break;
case 500:
console.error("内部服务器错误");
console.error(data.message ? data.message : "内部服务器错误");
break;
default:
console.error(data.message ? data.message : "请求失败,请稍后重试");
Expand Down
9 changes: 6 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { fileURLToPath, URL } from "node:url";
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { NaiveUiResolver } from "unplugin-vue-components/resolvers";
import { VitePWA } from "vite-plugin-pwa";
import { createHtmlPlugin } from "vite-plugin-html";
import vue from "@vitejs/plugin-vue";
import viteCompression from "vite-plugin-compression";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";

// https://vitejs.dev/config/
export default ({ mode }) =>
Expand Down Expand Up @@ -85,6 +86,8 @@ export default ({ mode }) =>
],
},
}),
// viteCompression
viteCompression(),
],
server: {
port: 25536,
Expand Down

0 comments on commit 540b0c5

Please sign in to comment.