Skip to content

Commit

Permalink
토큰
Browse files Browse the repository at this point in the history
  • Loading branch information
jooijin committed Jun 25, 2022
1 parent 3b2fb83 commit b50ca9f
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 12 deletions.
9 changes: 4 additions & 5 deletions fpm-fe-html/pages/groupReport.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,20 +269,19 @@ <h1 class="text-4"><span class="totalAmt"></span>원</h1>
<div class="overlap-group2-1">
<a href="-3.html"><img class="rectangle-3380" src="../public/images/rectangle-3380@2x.png" /> </a>
</div>
<div class="text-59 fontbody0semibold">닉네임1</div>
<div class="text-59 fontbody0semibold"><span id="recommUser3"></span></div>
</div>
<div class="flex-col-5">
<div class="overlap-group-1"><img class="rectangle-3381" src="../public/images/rectangle-3381@2x.png" />
</div>
<div class="text-60 fontbody0semibold">닉네임2</div>
<div class="text-60 fontbody0semibold"><span id="recommUser3"></span></div>
</div>
<div class="flex-col-6">
<div class="text-5 fontbody1regular">더보기</div>
<div class="text-5 fontbody1regular"><span id="recommUser3"></span></div>
<div class="overlap-group1-2">
<img class="rectangle-3382" src="../public/images/rectangle-3382@2x.png" />
<img class="rectangle-3383" src="../public/images/rectangle-3381@2x.png" />
</div>
<div class="text-61 fontbody0semibold">닉네임3</div>
<div class="text-61 fontbody0semibold"><span id="recommUser3"></span></div>
</div>
</div>
</div>
Expand Down
83 changes: 79 additions & 4 deletions fpm-fe-html/public/javascript/groupReport.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$(document).ready(function(){

let token = document.cookie.split('=')[1];
const selectedTag = location.href.split('?')[1];
$('#'+selectedTag).toggleClass('selected');
jQuery('.selected').parent('div').css('background', '#EEE5FF');
Expand All @@ -10,7 +10,7 @@ $(document).ready(function(){
url: "http://api.fpm.local/api/financial",
headers: {
authorization:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNqY2YwaHM1ZmNkazI2MSIsImlhdCI6MTY1NjEzOTIyMSwiZXhwIjoxNjg3Njc1MjIxLCJpc3MiOiJmcG0ifQ.wpt9TFqGXJfAYXTIBSj2BeTBY2vqm-oFEhM91Gi_pKc",
token,
},
success: function (res) {
console.log(res);
Expand All @@ -37,6 +37,27 @@ $(document).ready(function(){
},
});


$.ajax({
type: "GET",
url: "http://api.fpm.local/api/user/hashtag/recommand",
headers: {
authorization:
document.cookie.split('=')[1],
},
success: function (res) {
recomm1 = res['recommandUsers'][0]['nickName'];
recomm2 = res['recommandUsers'][1]['nickName'];
recomm3 = res['recommandUsers'][2]['nickName'];

$("#recommUser1").text(recomm1);
$("#recommUser2").text(recomm2);
$("#recommUser3").text(recomm3);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("통신 실패.");
},
});

$(window).on('load', function () {
let tag = document.querySelector('.selected').outerText;
Expand All @@ -49,7 +70,7 @@ $(document).ready(function(){
url: "http://api.fpm.local/api/financial/user/rank",
headers: {
authorization:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNqY2YwaHM1ZmNkazI2MSIsImlhdCI6MTY1NjEzOTIyMSwiZXhwIjoxNjg3Njc1MjIxLCJpc3MiOiJmcG0ifQ.wpt9TFqGXJfAYXTIBSj2BeTBY2vqm-oFEhM91Gi_pKc",
token,
},
data: data,
success: function (res) {
Expand Down Expand Up @@ -88,7 +109,7 @@ $("[id^=hashtag]").on("click", function(){
url: "http://api.fpm.local/api/financial/user/rank",
headers: {
authorization:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNqY2YwaHM1ZmNkazI2MSIsImlhdCI6MTY1NjEzOTIyMSwiZXhwIjoxNjg3Njc1MjIxLCJpc3MiOiJmcG0ifQ.wpt9TFqGXJfAYXTIBSj2BeTBY2vqm-oFEhM91Gi_pKc",
token,
},
data: data,
success: function (res) {
Expand All @@ -100,4 +121,58 @@ $("[id^=hashtag]").on("click", function(){
},
});

});

$(".rectangle-3380").on("click", function(){
$.ajax({
type: "GET",
url: "http://api.fpm.local/api/user/hashtag/recommand",
headers: {
authorization:
document.cookie.split('=')[1],
},
success: function (res) {
userId = res['recommandUsers'][0]['userId'];
location.href = `profile.html?${userId}`
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("통신 실패.");
},
});
});

$(".rectangle-3381").on("click", function(){
$.ajax({
type: "GET",
url: "http://api.fpm.local/api/user/hashtag/recommand",
headers: {
authorization:
document.cookie.split('=')[1],
},
success: function (res) {
userId = res['recommandUsers'][1]['userId'];
location.href = `profile.html?${userId}`
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("통신 실패.");
},
});
});

$(".rectangle-3382").on("click", function(){
$.ajax({
type: "GET",
url: "http://api.fpm.local/api/user/hashtag/recommand",
headers: {
authorization:
document.cookie.split('=')[1],
},
success: function (res) {
userId = res['recommandUsers'][2]['userId'];
location.href = `profile.html?${userId}`
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("통신 실패.");
},
});
});
5 changes: 2 additions & 3 deletions fpm-fe-html/public/stylesheets/groupReport.css
Original file line number Diff line number Diff line change
Expand Up @@ -1834,9 +1834,8 @@
}

.frame-389 .rectangle-3382 {
height: 70px;
object-fit: cover;
width: 70px;
height: 86px;
width: 86px;
}

.frame-389 .rectangle-3383 {
Expand Down

0 comments on commit b50ca9f

Please sign in to comment.