12 2018 档案

摘要://设置默认全局baseURL axios.defaults.baseURL=process.env.BASE_API; //设置默认全局携带浏览器cookie axios.defaults.withCredentials=true; Vue.prototype.$http = axios; 阅读全文
posted @ 2018-12-24 10:37 random_lee 阅读(287) 评论(0) 推荐(0)
摘要:proxyTable: { '/zabbix_api': { target: 'http://10.88.22.8',//设置你调用的接口域名和端口号 别忘了加http changeOrigin: true, pathRewrite: { '^/zabbix_api/': '/zabbix_api/', ... 阅读全文
posted @ 2018-12-24 10:35 random_lee 阅读(268) 评论(0) 推荐(0)
摘要:// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. //main.js在渲染的时候会被webpack引入变成app.js文件 app.js文件在index.html中会被... 阅读全文
posted @ 2018-12-21 01:10 random_lee 阅读(5916) 评论(1) 推荐(1)
摘要:关于每次点击链接都要刷新页面的问题众所周知,开发单页应用就是因为那丝般顺滑的体验效果,如果每次点击都会刷新页面… 出现这个的原因是因为使用了window.location来跳转,只需要使用使用router提供的方法,就能够解决这个问题: 在main.js中配置中将router绑定到全局 Vue.pr 阅读全文
posted @ 2018-12-20 22:36 random_lee 阅读(280) 评论(0) 推荐(0)
摘要:var token = localStorage.getItem("token"); $.ajaxSetup({ dataType: "json", cache: false, headers: { "token": token }, xhrFields: { withCredentials: true }, complet... 阅读全文
posted @ 2018-12-07 05:27 random_lee 阅读(9061) 评论(0) 推荐(1)
摘要:Django中使用ajax post向後臺傳送資料時403 Forbidden (CSRF token missing or incorrect.):的解決辦法 在Django中使用ajax post向後臺傳送資料時會出現403 Forbidden (CSRF token missing or incorrect.): 的報錯。 第一種解決方法: 先看一下ajax的使用方法: $.a... 阅读全文
posted @ 2018-12-05 09:19 random_lee 阅读(2242) 评论(0) 推荐(0)
摘要:var t = $('#passwdHOST').DataTable({ 'searching': true, 'ordering': false, 'autoWidth': false, dom: 'Bfrtip', buttons: [{ text: "导出到Execl", extend: 'excelHtml5', ... 阅读全文
posted @ 2018-12-04 10:51 random_lee 阅读(4389) 评论(0) 推荐(0)