测试
<!DOCTYPE html> <html> <head> </head> <body> <div></div> <script> //webpack:///./node_modules/axios/lib/utils.js?c532 //这个js文件内容包括绑定 var bind = require('./helpers/bind');//跳转到 app.js下的hotCreateRequire //打下断点 看不懂 app.js 文件 /* //http://192.168.103.101:5001/app.js //function hotCreateRequire(moduleId) { //moduleId = "./node_modules/axios/lib/utils.js" //request = "./node_modules/axios/lib/helpers/bind.js" */ /* 执行该对象下的一个方法 */ //bind.js下的函数 module.exports = function AAAAbind(fn, thisArg) { return {}; }; //utils.js 下的代码 引入外部模块 var bind = require('./helpers/bind');//调用require函数后;返回这个js文件里的方法 //module.exports === (bind对象) //utils.js 下的extend方法 function utils__extend(a, b, thisArg) { forEach(b, function assignValue(val, key) { if (thisArg && typeof val === 'function') { a[key] = bind(val, thisArg); } else { a[key] = val; } }); return a; } //其他问题 //点击登录后 执行login.vue下的handleSubmit函数下的 this.$http; 其中this.$http = wrap[不带括号,wrap是函数]; //执行 this.$http.post()的时候,也就是执行了wrap方法返回的对象下的post方法 //执行的时候 thisArg这个参数已经配置过了 module.exports = function bind(fn, thisArg) { return function wrap() { var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } return fn.apply(thisArg, args); }; }; // //console.log(thisArg); var z0 = typeof (thisArg.defaults.baseURL); if (z0 == "string") { console.log(z0); console.log(thisArg) } //webpack:///./node_modules/axios/lib/axios.js?cee4下的内容 /* { var utils = require('./utils'); var bind = require('./helpers/bind'); var Axios = require('./core/Axios'); var mergeConfig = require('./core/mergeConfig'); var defaults = require('./defaults'); // 注意这句 "./node_modules/axios/lib/defaults.js" } */ /* 在 webpack:///./node_modules/axios/lib/axios.js?cee4文件中 instanceConfig包含baseURL:"http://***.net" // Factory for creating new instances axios.create = function create(instanceConfig) { return createInstance(mergeConfig(axios.defaults, instanceConfig)); }; */ /* 在 webpack:///./src/utils/plugin/axios-plugin.js?2f72文件中 export const Axios = axios.create({ baseURL: rootUrl(), timeout: defaultSettings.apiTimeout }) 在js 文件中 import axios from 'axios' import TokenCache from '@/utils/cache/TokenCache' import defaultSettings from '@/config/defaultSettings' //源代码相对路径src\config\defaultSettings.js import ProcessHelper from '@/utils/helper/ProcessHelper' BaseUrl= defaultSettings.localRootUrl; */ /* 在 src\config\defaultSettings.js文件中 projectName: process.env.VUE_APP_ProjectName,//项目名 desktopPath: process.env.VUE_APP_DesktopPath,//首页路径 publishRootUrl: process.env.VUE_APP_PublishRootUrl,//发布后接口根地址 localRootUrl: process.env.VUE_APP_LocalRootUrl,//本地调试接口根地址 apiTimeout: parseInt(process.env.VUE_APP_ApiTimeout),//接口超时时间ms devPort: parseInt(process.env.VUE_APP_DevPort) //本地开发启动端口 */ /* 在 app.js中 (function(module, __webpack_exports__, __webpack_require__) { 第二个参数是 __webpack_exports__对象下的default下的localRootUrl 最终发现 (function(module, __webpack_exports__, __webpack_require__) { eval( "__webpack_require__.r(__webpack_exports__); __webpack_exports__[\"default\"] = ({\n primaryColor: '#1890FF',\n // primary color of ant design\n navTheme: 'dark',\n // theme for nav menu\n layout: 'sidemenu',\n // nav menu position: sidemenu or topmenu\n contentWidth: 'Fixed',\n // layout of content: Fluid or Fixed, only works when layout is topmenu\n fixedHeader: false,\n // sticky header\n fixSiderbar: true,\n // sticky siderbar\n autoHideHeader: false,\n //auto hide header\n colorWeak: false,\n multiTab: true,\n production: false && false,\n // vue-ls options\n storageOptions: {\n namespace: 'pro__',\n name: 'ls',\n storage: 'local'\n },\n projectName: \"管理后台\",\n //项目名\n desktopPath: \"/Home/Introduce\",\n //首页路径\n publishRootUrl: \"http://***.net\",\n //发布后接口根地址\n localRootUrl: \"http://xxx.net\",\n //本地调试接口根地址\n apiTimeout: parseInt(\"10000\"),\n //接口超时时间ms\n devPort: parseInt(\"5001\") //本地开发启动端口\n\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvY29uZmlnL2RlZmF1bHRTZXR0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lSW50KHByb2Nlc3MuZW52LlZVRV9BUFBfQXBpVGltZW91dCksLy/mjqXlj6PotoXml7bml7bpl7Rtc1xuICBkZXZQb3J0OiBwYXJzZUludChwcm9jZXNzLmVudi5WVUVfQVBQX0RldlBvcnQpIC8v5pys5Zyw5byA5Y+R5ZCv5Yqo56uv5Y+jXG59Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBOzs7Ozs7Ozs7Ozs7OztBQWVBO0FBQ0E7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFIQTtBQUtBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQXZCQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/config/defaultSettings.js\n"); 在"./src/config/defaultSettings.js": /*!***************************************!*\ } */ // 最后 找到 G:\工作项目\src\xx.Web\.env /* NODE_ENV=production VUE_APP_PREVIEW=false #项目名 VUE_APP_ProjectName=管理后台 #首页路径 VUE_APP_DesktopPath=/Home/Introduce #发布后接口根地址 VUE_APP_PublishRootUrl=http://xxx.net #本地调试接口根地址 VUE_APP_LocalRootUrl=http://xxx.net #接口超时时间ms VUE_APP_ApiTimeout=10000 #本地开发启动端口 VUE_APP_DevPort=5001 */ </script> </body> </html>