if (this.LoginInfo == null)
{
// 解决uploadify兼容火狐谷歌浏览器上传问题
// 但是,此代码使系统有安全隐患,Flash程序请求该系统不需要验证
// 要解决此安全隐患,需要Flash程序传用户名和密码过来验证,但是该用户名和密码不能写在前端以便被不法用户看到
if (Request.UserAgent == "Shockwave Flash")
{
return;
}
else
{
filterContext.Result = RedirectToAction("LoginAgain", "Account", new { Area = "Auth" });
return;
}
}
$(function () {
$.ajax({
url: "/Auth/Account/GetUserNamePwd",
type: "POST",
dataType: "json",
data: {},
success: function (data) {
$("#uploadify").uploadify({
height: 25,
width: 100,
swf: '/Content/Plugins/UploadifyJs/uploadify.swf',
uploader: 'UploadFile',
formData: {
userName: data.data.userName, //ajax获取的用户名
pwd: data.data.pwd //ajax获取的密码
},
buttonText: '选择文件上传',
fileSizeLimit: '4MB',
fileTypeDesc: '文件',
fileTypeExts: '*.*',
queueID: 'fileQueue',
multi: true,
onUploadSuccess: function (fileObj, data, response) {
var d = eval("(" + data + ")");
$(".uploadify-queue-item").find(".data").html(" 上传完成");
$("#url").val(d.url);
$("#name").val(d.name);
},
onUploadError: function (event, ID, fileObj, errorObj) {
if (event.size > 4 * 1024 * 1024) {
alert('超过文件上传大小限制(4M)!');
return;
}
alert('上传失败');
}
}); //end uploadify
}
});
}); //end $
if (this.LoginInfo == null)
{
// 解决uploadify兼容火狐谷歌浏览器上传问题
// 但是,此代码使系统有安全隐患,Flash程序请求该系统不需要验证
// 要解决此安全隐患,需要Flash程序传用户名和密码过来验证,但是该用户名和密码不能写在前端以便被不法用户看到
if (Request.UserAgent == "Shockwave Flash")
{
string userName = Request.Params["userName"];
string pwd = Request.Params["pwd"];
if (!string.IsNullOrWhiteSpace(userName) && !string.IsNullOrWhiteSpace(pwd))
{
AuthDAL authDAL = new AuthDAL();
sys_user user = authDAL.GetUserInfoByName(userName);
if (user != null && user.password == pwd)
{
return;
}
}
}
else
{
filterContext.Result = RedirectToAction("LoginAgain", "Account", new { Area = "Auth" });
return;
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有