diff --git a/src/main/java/top/naccl/dwz/controller/IndexController.java b/src/main/java/top/naccl/dwz/controller/IndexController.java index cf4d6ed..694a1e7 100644 --- a/src/main/java/top/naccl/dwz/controller/IndexController.java +++ b/src/main/java/top/naccl/dwz/controller/IndexController.java @@ -38,6 +38,9 @@ public class IndexController { @ResponseBody public R generateShortURL(@RequestParam String longURL) { if (UrlUtils.checkURL(longURL)) { + if (!longURL.startsWith("http")) { + longURL = "http://" + longURL; + } String shortURL = urlService.saveUrlMap(HashUtils.hashToBase62(longURL), longURL, longURL); return R.ok("请求成功", host + shortURL); } diff --git a/src/main/resources/static/img/favicon.ico b/src/main/resources/static/img/favicon.ico new file mode 100644 index 0000000..312483b Binary files /dev/null and b/src/main/resources/static/img/favicon.ico differ diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 74f8eb8..b373188 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -3,6 +3,7 @@