123456789101112131415161718 |
- "use strict";
- const common_vendor = require("../common/vendor.js");
- var define_import_meta_env_default = {};
- const baseURL = define_import_meta_env_default.VITE_API_URL;
- const httpInterceptor = {
- // 拦截前触发
- invoke(options) {
- if (!options.url.startsWith("http")) {
- options.url = baseURL + options.url;
- }
- options.timeout = 3e4;
- options.header = {
- ...options.header,
- "source-client": "miniapp"
- };
- }
- };
- common_vendor.index.addInterceptor("request", httpInterceptor);
|