lyhzzz 2 年之前
父節點
當前提交
1fbe500155
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/main/java/com/fdkankan/ucenter/controller/api/LaserController.java

+ 5 - 1
src/main/java/com/fdkankan/ucenter/controller/api/LaserController.java

@@ -8,6 +8,7 @@ import com.fdkankan.ucenter.entity.User;
 import com.fdkankan.ucenter.service.*;
 import com.fdkankan.ucenter.vo.LaserSceneVo;
 import com.fdkankan.ucenter.vo.response.CameraAppVo;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -43,7 +45,9 @@ public class LaserController extends BaseController {
     @RequestMapping(value = "/getSnCodeByPhone",method = RequestMethod.GET)
     public Result getSnCodeByUserName(@RequestParam(required = false)String phone,
                                       @RequestParam(required = false)Integer sceneSource) throws Exception {
-        phone = URLEncoder.encode(phone, "utf-8");
+        if(StringUtils.isNotBlank(phone)){
+            phone = phone.replace("%40","@");
+        }
         List<Long> userIds = userService.getLikeUserName(phone);
         HashMap<String,Object> map = new HashMap<>();
         Set<String> snCodeSet = new HashSet<>();