• 大小: 96KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-08
  • 语言: 其他
  • 标签: 文件上传  

资源简介

SpringBoot 单文件上传、批量文件上传。SpringMVC 也可以用。

资源截图

代码片段和文件信息

package com.frbao.web.modules.hy.service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;

import com.frbao.common.util.MD5;
import com.frbao.core.log.ExceptionLogger;
import com.frbao.core.log.OutInterfaceLogger;
import com.frbao.core.rest.support.RestTemplateService;
import com.frbao.core.utils.DateUtils;
import com.frbao.core.utils.Validater;
import com.frbao.members.api.LoginService;
import com.frbao.members.api.MemberInfoChangeService;
import com.frbao.members.model.LoginBehaviorLogEntity;
import com.frbao.members.model.MemberLoginInfoEntity;
import com.frbao.members.model.MembersEntity;
import com.frbao.web.common.constants.Constants;
import com.frbao.web.common.servlet.ValidateCodeServlet;
import com.frbao.web.common.utils.BBSLoginUtils;
import com.frbao.web.common.utils.ExtStringUtils;
import com.frbao.web.common.utils.HttpServletUtil;
import com.frbao.web.common.utils.JedisUtils;
import com.frbao.web.common.utils.ShiroUtils;
import com.frbao.web.modules.hy.utils.LoginUtils;
import com.frbao.web.system.security.ExtFormAuthenticationFilter;
import com.frbao.web.system.service.SMSService;
import com.google.common.collect.Maps;
import com.ygline.fpayfront.commom.shiro.vo.Authorization;

/** 
 * 用户登录服务
 * @author  作者 : zhangpr
 * @parameter 
 * @return 
 */
@Service(“hyLoginService“)
@Transactional
public class HyLoginService {
  
    private final Logger logger = LoggerFactory.getLogger(HyLoginService.class);
  
    // vip接口url
    @Value(“${fpay.jfcenter.url}“)
    private String jfCenterUrl;
  
    public String getJfCenterUrl() {
        return jfCenterUrl;
    }
    
    @Autowired
    private SMSService sMSService;
    
    @Autowired
    private LoginService loginService;
    
    @Autowired
    private MemberInfoChangeService memberInfoChangeService;
    
    @Autowired
    private RestTemplateService restTemplateService;
  
    /**
     * 登录弹框 服务
     * @author zhangpr
     * @param
     * @return
     * @param username
     * @param password
     * @param request
     * @param response
     * @return
     */
    public Mapject> login(String username String password HttpServletRequest requestHttpServletResponse response) {
      
          Mapject> result = Maps.newHashMap();
          result.put(“loginFlag“ false);
          //记录登录日志
          

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-03-11 17:49  demo-uploadfile\
     文件        1226  2017-03-11 09:37  demo-uploadfile\.classpath
     文件         249  2017-03-11 09:26  demo-uploadfile\.gitignore
     目录           0  2017-03-11 17:49  demo-uploadfile\.mvn\
     目录           0  2017-03-11 17:49  demo-uploadfile\.mvn\wrapper\
     文件       49502  2017-03-11 09:26  demo-uploadfile\.mvn\wrapper\maven-wrapper.jar
     文件         110  2017-03-11 09:26  demo-uploadfile\.mvn\wrapper\maven-wrapper.properties
     文件         981  2017-03-11 09:37  demo-uploadfile\.project
     目录           0  2017-03-11 17:49  demo-uploadfile\.settings\
     文件         283  2017-03-11 12:21  demo-uploadfile\.settings\org.eclipse.core.resources.prefs
     文件         243  2017-03-11 09:37  demo-uploadfile\.settings\org.eclipse.jdt.core.prefs
     文件          97  2017-03-11 09:26  demo-uploadfile\.settings\org.eclipse.m2e.core.prefs
     文件         145  2017-03-11 09:37  demo-uploadfile\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件       22948  2017-03-11 12:22  demo-uploadfile\1.png
     文件        7058  2017-03-11 09:26  demo-uploadfile\mvnw
     文件        5006  2017-03-11 09:26  demo-uploadfile\mvnw.cmd
     文件        1629  2017-03-11 17:49  demo-uploadfile\pom.xml
     文件         118  2017-03-11 17:49  demo-uploadfile\README.md
     目录           0  2017-03-11 17:49  demo-uploadfile\src\
     目录           0  2017-03-11 17:49  demo-uploadfile\src\main\
     目录           0  2017-03-11 17:49  demo-uploadfile\src\main\java\
     目录           0  2017-03-11 17:49  demo-uploadfile\src\main\java\com\
     目录           0  2017-03-11 17:49  demo-uploadfile\src\main\java\com\example\
     目录           0  2017-03-11 17:49  demo-uploadfile\src\main\java\com\example\configuration\
     文件         916  2017-03-11 12:08  demo-uploadfile\src\main\java\com\example\configuration\FileUploadConfiguration.java
     目录           0  2017-03-11 17:49  demo-uploadfile\src\main\java\com\example\controller\
     文件        3414  2017-03-11 12:19  demo-uploadfile\src\main\java\com\example\controller\FileUploadController.java
     文件         319  2017-03-11 09:26  demo-uploadfile\src\main\java\com\example\DemoUploadfileApplication.java
     目录           0  2017-03-11 17:49  demo-uploadfile\src\main\resources\
     文件           0  2017-03-11 09:26  demo-uploadfile\src\main\resources\application.properties
     目录           0  2017-03-11 17:49  demo-uploadfile\src\main\resources\templates\
............此处省略34个文件信息

评论

共有 条评论