RightControl.WebApp/Areas/SysSet/Controllers/InfoController.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using RightControl.Common;
using RightControl.IService;
using RightControl.Model;
using RightControl.WebApp.Areas.Admin.Controllers;
using System;
using System.IO;
using System.Web;
using System.Web.Mvc;
namespace RightControl.WebApp.Areas.SysSet.Controllers
{
public class InfoController : BaseController
{
public IUserService userService { get; set; }
// GET: SysSet/Info
public override ActionResult Index(int? id)
{
base.Index(id);
ViewBag.MaxFileUpload = Configs.GetValue("MaxFileUpload");
ViewBag.UploadFileType = Configs.GetValue("UploadFileType");
var _userId = Operator.UserId;
var model = userService.GetDetail(_userId);
return View(model);
}
[HttpPost]
public ActionResult Index(UserModel model)
{
model.UpdateOn = DateTime.Now;
model.UpdateBy = Operator.UserId;
model.Id = Operator.UserId;
var result = userService.UpdateModel(model, "UpdateOn,UpdateBy,RealName,Gender,HeadShot,Phone,Email,Remark") ? SuccessText : ErrorText;
ViewBag.Msg = result;
return View("Index", model);
}
/// <summary>
/// 上传文件
/// </summary>
/// <returns></returns>
public JsonResult ExportFile()
{
uploadFile _uploadFile = new uploadFile();
try
{
var file = Request.Files[0]; //获取选中文件
var filecombin = file.FileName.Split('.');
if (file == null || string.IsNullOrEmpty(file.FileName) || file.ContentLength == 0 || filecombin.Length < 2)
{
_uploadFile.code = -1;
_uploadFile.src = "";
_uploadFile.msg = "上传出错!请检查文件名或文件内容";
return Json(_uploadFile);
}
//定义本地路径位置
string localPath = Server.MapPath("~/Upload/img/");
string filePathName = string.Empty;
string tmpName = Server.MapPath("~/Upload/img/");
var tmp = file.FileName;
var tmpIndex = 0;
//判断是否存在相同文件名的文件 相同累加1继续判断
后面还有 24 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
