摘要: // http request 拦截器 axios.interceptors.request.use( config => { var token = localStorage.getItem("antToken"); //检查是否有token,有的话说明是已登录,没有就说明未登录 if (token) { //如果登录了就在每个接口的headers里面增加tok... 阅读全文
posted @ 2019-01-16 15:33 DangerousBaymax 阅读(4818) 评论(0) 推荐(0) 编辑
摘要: var strUrl= "^((https|http|ftp|rtsp|mms)?://)" + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" //ftp的user@ + "(([0-9]{1,3}\.){3}[0-9]{1,3}" // IP形式的URL- 199... 阅读全文
posted @ 2018-10-19 17:08 DangerousBaymax 阅读(6771) 评论(0) 推荐(0) 编辑
摘要: :before { content: ''; display: inline-block; vertical-align: middle; height: 100%; } ↑ 自适应垂直居中 .clearfix::after { content: "."; clear: both; display: 阅读全文
posted @ 2018-09-04 15:18 DangerousBaymax 阅读(498) 评论(0) 推荐(0) 编辑
摘要: 复制过去,全局可用,简单粗暴,效果展示: 阅读全文
posted @ 2018-08-07 11:32 DangerousBaymax 阅读(3130) 评论(0) 推荐(0) 编辑
摘要: 以上就是主要代码,接下来引用: 注意压缩后的图片赋值只能在回调里面进行赋值,如果写到外面会失效。 最后,图片上传给后台要加入到formData里面。 示例: 这是使用js压缩图片,在哪都能用的,我是写vue项目时使用过。但其实vue是有相关的压缩图片的依赖的,具体可查看:https://blog.c 阅读全文
posted @ 2018-07-24 11:48 DangerousBaymax 阅读(1145) 评论(0) 推荐(0) 编辑
摘要: getContentData() { var _this = this; var topicId = { topicId: 1584 }// 899_this.topicId this.$http.post(temporaryUrl + "/appTopic/queryAppT... 阅读全文
posted @ 2018-07-11 14:45 DangerousBaymax 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 参考: http://www.browsersync.cn/#install 首先全局安装BrowserSync : npm install -g browser-sync 其次在项目文件夹下运行: browser-sync start --server --files "css/*.css, *. 阅读全文
posted @ 2018-07-11 12:00 DangerousBaymax 阅读(8308) 评论(0) 推荐(0) 编辑
摘要: 正常的页面可以调用这个方法,window.location.search获取到当前页面从问号 (?) 开始的 URL(查询部分) 随后配合正则就可以筛选出想要的参数,比如链接:https://i.cnblogs.com/EditPosts.aspx?hello=123 这么使用: getQueryS 阅读全文
posted @ 2018-07-04 20:15 DangerousBaymax 阅读(1656) 评论(0) 推荐(0) 编辑
摘要: demo = 'zhang#@$san'; reg=/[`~!@#$%^&*()_+?:"{},.\/;'[\]]/im; if(reg.test(demo)){ this.$toast('demo包含特殊字符'); return; } 阅读全文
posted @ 2018-07-02 15:26 DangerousBaymax 阅读(1433) 评论(0) 推荐(0) 编辑
摘要: wx.ready(function () { // 8.3 批量隐藏菜单项 wx.hideMenuItems({ menuList: [ 'menuItem:share:qq', //分享到QQ 'menuItem:share:weiboApp', // 分享到Weibo 'menuItem:favo... 阅读全文
posted @ 2018-06-25 14:11 DangerousBaymax 阅读(1327) 评论(0) 推荐(0) 编辑