javascript - 使用angular給圖片動(dòng)態(tài)賦值src屬性出現(xiàn)unsafe的情況
問題描述
百度過后,在appmodule中設(shè)置了app.config的值 $compileProvider.imgSrcSanitizationWhitelist(/^s*(https?|local|data):/);但是沒有效果
想問一下大家還有什么其他辦法能去掉這個(gè)unsafe
html代碼: <p class='user_pic'><img src='http://www.leifengta.com.cn/wenda/{{item.UserID | imgSrc}}' height='178px;'></p>controller中:app.filter(’imgSrc’, function () {
return function (input) {var src = ’’;if (input == undefined) { return;}$.ajax({ url: BaseURL + '/MainUser/LoadUserPersonalHomepageByUseriD?userID=' + input, type: ’get’, async: false, success: function (data) {if (data.UploadIMG == null) { src = ’/img/tp.png’} else { src = data.UploadIMG} }})return src; }});
問題解答
回答1:https://stackoverflow.com/que...
相關(guān)文章:
1. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””2. boot2docker無法啟動(dòng)3. docker-compose中volumes的問題4. java - SSH框架中寫分頁時(shí)service層中不能注入分頁類5. docker安裝后出現(xiàn)Cannot connect to the Docker daemon.6. javascript - mock.js可以存儲(chǔ)數(shù)據(jù)嗎7. nignx - docker內(nèi)nginx 80端口被占用8. docker api 開發(fā)的端口怎么獲取?9. dockerfile - 為什么docker容器啟動(dòng)不了?10. node.js - antdesign怎么集合react-redux對(duì)input控件進(jìn)行初始化賦值

網(wǎng)公網(wǎng)安備