lzy 2 days ago
parent
commit
4c4f056ad4

+ 1 - 1
src/main/java/com/zhentao/osspicture/OssUtil.java

@@ -29,7 +29,7 @@ public class OssUtil {
     private static final String bucketName = "fjj1";
     private static final String bucketName = "fjj1";
     private static final boolean useCDN =  true;
     private static final boolean useCDN =  true;
 
 
-    private static final String cdnDomain = "https://cdn.yourdomain.com";
+    private static final String cdnDomain = "https://fjj1.oss-cn-beijing.aliyuncs.com";
 
 
     // MIME类型到扩展名的映射
     // MIME类型到扩展名的映射
     private static final Map<String, String> MIME_TO_EXTENSION = new HashMap<>();
     private static final Map<String, String> MIME_TO_EXTENSION = new HashMap<>();

+ 9 - 2
src/main/java/com/zhentao/user/service/impl/UserLoginServiceImpl.java

@@ -30,7 +30,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.util.DigestUtils;
 import org.springframework.util.DigestUtils;
 import org.springframework.util.StringUtils;
 import org.springframework.util.StringUtils;
-import org.springframework.web.multipart.MultipartFile;
+
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
@@ -115,6 +115,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginMapper, UserLogin
 
 
                 UserRelationships userRelationships=new UserRelationships();
                 UserRelationships userRelationships=new UserRelationships();
                 userRelationships.setId(IdUtil.getSnowflake().nextId());
                 userRelationships.setId(IdUtil.getSnowflake().nextId());
+                userRelationships.setUserId(user.getId());
                 userRelationships.setFriendId(1933707308387405824L);
                 userRelationships.setFriendId(1933707308387405824L);
                 userRelationships.setStatus(1);
                 userRelationships.setStatus(1);
                 userRelationships.setCreatedAt(new Date());
                 userRelationships.setCreatedAt(new Date());
@@ -146,6 +147,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginMapper, UserLogin
 
 
                 UserRelationships userRelationships=new UserRelationships();
                 UserRelationships userRelationships=new UserRelationships();
                 userRelationships.setId(IdUtil.getSnowflake().nextId());
                 userRelationships.setId(IdUtil.getSnowflake().nextId());
+                userRelationships.setUserId(user.getId());
                 userRelationships.setFriendId(1933707308387405824L);
                 userRelationships.setFriendId(1933707308387405824L);
                 userRelationships.setStatus(1);
                 userRelationships.setStatus(1);
                 userRelationships.setCreatedAt(new Date());
                 userRelationships.setCreatedAt(new Date());
@@ -239,7 +241,12 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginMapper, UserLogin
             if (b){
             if (b){
                 // 查询用户信息,根据用户名
                 // 查询用户信息,根据用户名
                 QueryWrapper<UserLogin> queryWrapper = new QueryWrapper<>();
                 QueryWrapper<UserLogin> queryWrapper = new QueryWrapper<>();
-                queryWrapper.eq("user_username",userPassDto.getUsername());
+                queryWrapper.eq("user_username",userPassDto.getUsername())
+                        .or()
+                        .eq("user_mobile",userPassDto.getUsername())
+                        .or()
+                        .eq("email",userPassDto.getUsername());
+
                 UserLogin one = this.getOne(queryWrapper);
                 UserLogin one = this.getOne(queryWrapper);
                 // 如果用户不存在,抛出异常
                 // 如果用户不存在,抛出异常
                 if (one==null){
                 if (one==null){