From a535c5d89b0506083894dc63a8c67cf8effcce9d Mon Sep 17 00:00:00 2001 From: muwoo <2424880409@qq.com> Date: Fri, 17 Sep 2021 16:23:51 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=A2=9E=E5=8A=A0request=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- static/preload.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 39d965d..62e243b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rubick2", - "version": "0.0.6-beta.1", + "version": "0.0.7-beta.1", "author": "muwoo <2424880409@qq.com>", "description": "An electron-vue project", "license": null, diff --git a/static/preload.js b/static/preload.js index b7d329b..2e904b7 100644 --- a/static/preload.js +++ b/static/preload.js @@ -1,5 +1,5 @@ const {getData, getlocalDataFile, saveData} = require("./utils"); - +const axios = require('axios'); const marked = require("marked"); const rendererMD = new marked.Renderer(); const path = require('path'); @@ -255,6 +255,14 @@ window.rubick = { shellOpenPath(path) { shell.openPath(path) + }, + + request(config = {}) { + return axios.create({ + timeout: 10000, + withCredentials: true, + ...config, + }); } } const preloadPath = getQueryVariable('preloadPath') || './preload.js';