diff --git a/feature/src/assets/request/index.ts b/feature/src/assets/request/index.ts
index e003247..fa61b9e 100644
--- a/feature/src/assets/request/index.ts
+++ b/feature/src/assets/request/index.ts
@@ -1,30 +1,53 @@
import axios from "axios";
+let baseURL = "https://gitee.com/monkeyWang/rubick-database/raw/master";
+let access_token = "";
+
+try {
+ const dbdata = window.rubick.db.get("rubick-localhost-config");
+ baseURL = dbdata.data.database;
+ access_token = dbdata.data.access_token;
+} catch (e) {
+ // ignore
+}
+
+const instance = axios.create({
+ baseURL: baseURL || "https://gitee.com/monkeyWang/rubick-database/raw/master",
+});
+
export default {
async getTotalPlugins() {
- const res = await axios.get(
- "https://gitee.com/monkeyWang/rubick-database/raw/master/plugins/total-plugins.json"
- );
+ let targetPath = "plugins/total-plugins.json";
+ if (access_token) {
+ targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master`
+ }
+ const res = await instance.get(targetPath);
return res.data;
},
async getFinderDetail() {
- const res = await axios.get(
- "https://gitee.com/monkeyWang/rubick-database/raw/master/plugins/finder.json"
- );
+ let targetPath = "plugins/finder.json";
+ if (access_token) {
+ targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master`
+ }
+ const res = await instance.get(targetPath);
return res.data;
},
async getSystemDetail() {
- const res = await axios.get(
- "https://gitee.com/monkeyWang/rubick-database/raw/master/plugins/system.json"
- );
+ let targetPath = "/plugins/system.json";
+ if (access_token) {
+ targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master`
+ }
+ const res = await instance.get(targetPath);
return res.data;
},
async getWorkerDetail() {
- const res = await axios.get(
- "https://gitee.com/monkeyWang/rubick-database/raw/master/plugins/worker.json"
- );
+ let targetPath = "/plugins/worker.json";
+ if (access_token) {
+ targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master`
+ }
+ const res = await instance.get(targetPath);
return res.data;
},
@@ -33,16 +56,20 @@ export default {
return res.data;
},
- async getSearchDetail(url: string) {
- const res = await axios.get(
- "https://gitee.com/monkeyWang/rubick-database/raw/master/plugins/search.json"
- );
+ async getSearchDetail() {
+ let targetPath = "/plugins/search.json";
+ if (access_token) {
+ targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master`
+ }
+ const res = await instance.get(targetPath);
return res.data;
},
- async getDevDetail(url: string) {
- const res = await axios.get(
- "https://gitee.com/monkeyWang/rubick-database/raw/master/plugins/dev.json"
- );
+ async getDevDetail() {
+ let targetPath = "/plugins/dev.json";
+ if (access_token) {
+ targetPath = `${encodeURIComponent(targetPath)}/raw?access_token=${access_token}&ref=master`
+ }
+ const res = await instance.get(targetPath);
return res.data;
},
};
diff --git a/feature/src/views/settings/index.vue b/feature/src/views/settings/index.vue
index 46bfd3b..201a59c 100644
--- a/feature/src/views/settings/index.vue
+++ b/feature/src/views/settings/index.vue
@@ -14,6 +14,12 @@
全局快捷键
+