提示语

校验提示语智能提示项目名称

岁酱吖の 提交于 2019-12-03 10:32:46
var messages = {};$.each($("input[required=true]"), function (i, item) { var v = $(item).parent().prev("p").children("span").text().replace(":*", ""); v = v.split("~"); v = v[0]; if (v == '使用地区') { messages[$(item).attr("id")] = {required: '请选择' + v}; } else { messages[$(item).attr("id")] = {required: '请输入' + v}; }})$.each($("select[required=true]"), function (i, item) { messages[$(item).attr("id")] = {required: '请选择' + $(item).parent().prev("p").children("span").text().replace(":*", "")};})$("#application").validate({messages: messages}); 来源: https://www.cnblogs.com/lch1990/p/11791373.html

vue Excel导出 [post请求+提示语]

匿名 (未验证) 提交于 2019-12-03 00:08:02
一般我们实现excel导出都是直接重定向或form表单提交,但如果后台发生异常,提示信息就会在新窗口以文本形式展示,很不友好,这里推荐另一种实现方式,使用post请求,并可以传递自定义错误信息: 前端使用axios,responseType要设置为blob let that= thislet params = { activitiesId: activitiesId, startTime: startTime, endTime: endTime } axios({ method: 'post', url: '/activityManage/exportExcel', data: params, responseType: 'blob' }).then(resp => { that.downloadFile(resp,that) }).catch(resp => { that.$notify.error(resp.msg || '导出失败') }) 下载方法,实现方式为打开一个新链接,然后放置download按钮,并自动点击: downloadFile (resp,that) { let data = resp.data     // 此处提示自定义提示语,从header中获取     if(resp.headers['errormsg'] || !data){       that

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryAddUsageDescription key with a string value

蹲街弑〆低调 提交于 2019-12-02 22:30:21
iOS10 11之后遇到这种报错的小伙伴们请注意啦: 你会发现网上一大堆博客和论坛都是让你在 Info.plist 里面要涉及隐私数据时要添加一句“提示语”。于是打开 Info.plist,点击 + 号,在 Key 中输入:Privacy - Photo Library Additions Usage Description,Type 选择 String,Value 中输入你的提示语。 这种方法用在iOS10 11中实 行不通 的,请看准报错的 红色 字眼: NSPhotoLibraryAddUsageDescription 说的已经很明确了,就是缺少这个: 所以最终的解决办法是: 打开Info.plist文件,复制NSPhotoLibraryAddUsageDescription新建一条粘贴进去,然后写一句合适的description,我写的是"请求添加照片到相册的权限,用于存储照片" 注意:当你直接将 NSPhotoLibraryAddUsageDescription 复制到info.plist中时,不要慌,系统会自动识别,你只管复制粘贴就好 亲测有效: 有任何看法或者更好的见解的小伙伴们,欢迎指正和探讨~ 来源: https://www.cnblogs.com/liuzhi20101016/p/11764939.html

vue Excel导出 [post请求+提示语]

感情迁移 提交于 2019-11-29 21:07:15
一般我们实现excel导出都是直接重定向或form表单提交,但如果后台发生异常,提示信息就会在新窗口以文本形式展示,很不友好,这里推荐另一种实现方式,使用post请求,并可以传递自定义错误信息: 前端使用axios,responseType要设置为blob let that= thislet params = { activitiesId: activitiesId, startTime: startTime, endTime: endTime } axios({ method: 'post', url: '/activityManage/exportExcel', data: params, responseType: 'blob' }).then(resp => { that.downloadFile(resp,that) }).catch(resp => { that.$notify.error(resp.msg || '导出失败') }) 下载方法,实现方式为打开一个新链接,然后放置download按钮,并自动点击: downloadFile (resp,that) { let data = resp.data     // 此处提示自定义提示语,从header中获取     if(resp.headers['errormsg'] || !data){       that