|
@@ -10,8 +10,10 @@ import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
@@ -32,7 +34,7 @@ public class ShortUrlController extends BaseController {
|
|
|
if(Objects.isNull(shortUrl)|| StringUtils.isBlank(shortUrl.getUrl())){
|
|
|
return;
|
|
|
}
|
|
|
- response.sendRedirect(shortUrl.getUrl());
|
|
|
+ response.sendRedirect(URLEncoder.encode(shortUrl.getUrl(), "GBK"));
|
|
|
}
|
|
|
|
|
|
}
|