Selaa lähdekoodia

隔离平台用户和商户用户,修改获取文件返回

Yangzw 1 kuukausi sitten
vanhempi
commit
0ffe0329ef

+ 7 - 2
feifan-framework/feifan-common/src/main/java/cn/newfeifan/mall/framework/common/util/servlet/ServletUtils.java

@@ -44,8 +44,13 @@ public class ServletUtils {
      */
     public static void writeAttachment(HttpServletResponse response, String filename, byte[] content) throws IOException {
         // 设置 header 和 contentType
-        response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8"));
-        response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
+        if (filename.contains("mp4")) {
+            response.setHeader("Content-Disposition", "inline;");
+            response.setContentType("video/mp4");
+        } else {
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8"));
+            response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
+        }
         // 输出附件
         IoUtil.write(response.getOutputStream(), false, content);
     }

+ 1 - 1
feifan-module-system/feifan-module-system-biz/src/main/java/cn/newfeifan/mall/module/system/dal/mysql/user/AdminUserMapper.java

@@ -14,7 +14,7 @@ import java.util.List;
 public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
 
     default AdminUserDO selectByUsername(String username) {
-        return selectOne(AdminUserDO::getUsername, username);
+        return selectOne(AdminUserDO::getUsername, username,AdminUserDO::getCategoryId,1);
     }
 
     default AdminUserDO selectByEmail(String email) {

+ 4 - 1
sql/mysql/建空库SQL/25_20241011.sql

@@ -28,4 +28,7 @@ ALTER TABLE member_user
     ADD COLUMN `agent` bit(1) DEFAULT b'0' COMMENT '是否是代理商 0:否 1:是';
 
 ALTER TABLE member_user
-    ADD COLUMN `visitor` bit(1) DEFAULT b'0' COMMENT '是否是游客 0:否 1:是';
+    ADD COLUMN `visitor` bit(1) DEFAULT b'0' COMMENT '是否是游客 0:否 1:是';
+
+ALTER TABLE trade_order
+    ADD COLUMN `user_deleted` bit(1) DEFAULT b'0' COMMENT '用户是否删除';