feat:增加request功能

This commit is contained in:
muwoo 2021-09-17 16:23:51 +08:00
parent 1eeb0fad9a
commit a535c5d89b
2 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "rubick2", "name": "rubick2",
"version": "0.0.6-beta.1", "version": "0.0.7-beta.1",
"author": "muwoo <2424880409@qq.com>", "author": "muwoo <2424880409@qq.com>",
"description": "An electron-vue project", "description": "An electron-vue project",
"license": null, "license": null,

View File

@ -1,5 +1,5 @@
const {getData, getlocalDataFile, saveData} = require("./utils"); const {getData, getlocalDataFile, saveData} = require("./utils");
const axios = require('axios');
const marked = require("marked"); const marked = require("marked");
const rendererMD = new marked.Renderer(); const rendererMD = new marked.Renderer();
const path = require('path'); const path = require('path');
@ -255,6 +255,14 @@ window.rubick = {
shellOpenPath(path) { shellOpenPath(path) {
shell.openPath(path) shell.openPath(path)
},
request(config = {}) {
return axios.create({
timeout: 10000,
withCredentials: true,
...config,
});
} }
} }
const preloadPath = getQueryVariable('preloadPath') || './preload.js'; const preloadPath = getQueryVariable('preloadPath') || './preload.js';