<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>img</title>
</head>
<body>
<img src="http://112.74.180.59:8033/profile/avatar/2019/08/07/3745215ef795f0935f72422bb0f5dec8.jpg">
<img src="http://112.74.180.59:8033/profile/avatar/2019/08/07/3745215ef795f0935f72422bb0f5dec8.jpg">
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript">
var imgs = $("img");
var prevStr = './viewer/'//斜杠前的路径
for (var i = 0; i < imgs.length; i++) {
var src = imgs[i].src;
var lastStr = src.substring(src.lastIndexOf("/")+1);
imgs.eq(i).prop("src",prevStr+lastStr);
}
</script>
</body>
</html>