|
@@ -1,6 +1,7 @@
|
|
|
import Vue from "vue";
|
|
|
import axios from "axios";
|
|
|
import { loadProgressBar } from "./axiosProgress";
|
|
|
+import cachingGet from "./axiosCache";
|
|
|
import { Message } from "iview";
|
|
|
import router from "../router";
|
|
|
import { UPYUN_UPLOAD_URL, UPYUN_HEADER_AUTH } from "@/constants/constants.js";
|
|
@@ -87,6 +88,10 @@ qmInstance.defaults.withCredentials = true; //允许跨域携带cookie
|
|
|
qmInstance.defaults.timeout = 10000; //超时时间
|
|
|
qmInstance.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest"; //标识这是一个 ajax 请求
|
|
|
|
|
|
+qmInstance.get = cachingGet(qmInstance.get, [
|
|
|
+ /\/api\/exam_question\/question\/\?question_id/,
|
|
|
+ /\/api\/ecs_exam_work\/exam\/\d+$/
|
|
|
+]);
|
|
|
loadProgressBar(qmInstance);
|
|
|
|
|
|
const upyunInstance = axios.create({
|