-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/softeerbootcamp/Team7-Amatta …
…into FE-feature/mypage
- Loading branch information
Showing
17 changed files
with
217 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,11 +85,12 @@ public ResponseEntity<?> findPasswordByEmail(@RequestBody UserFindPasswordByEmai | |
} | ||
|
||
@GetMapping("/mypage") | ||
public ResponseEntity<?> mypage(@SessionAttribute(value = "User", required = false) Users user) { | ||
if (Objects.isNull(user)) { | ||
return new ResponseEntity<>(new UserMypageRes(false), HttpStatus.UNAUTHORIZED); | ||
} | ||
return new ResponseEntity<>(new UserMypageRes(true, user.getEmail(), user.getPassword(), user.getName(), user.getPhoneNumber()), HttpStatus.OK); | ||
public ResponseEntity<?> mypage(/*@SessionAttribute(value = "User", required = false) Users user*/) { | ||
// if (Objects.isNull(user)) { | ||
// return new ResponseEntity<>(new UserMypageRes(false), HttpStatus.UNAUTHORIZED); | ||
// } | ||
return new ResponseEntity<>(new UserMypageRes(true, "[email protected]", "testPassword", "test", "010-0000-0000"), HttpStatus.OK); | ||
// return new ResponseEntity<>(new UserMypageRes(true, user.getEmail(), user.getPassword(), user.getName(), user.getPhoneNumber()), HttpStatus.OK); | ||
} | ||
|
||
@PutMapping("/password") | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "아 맞다!", | ||
"short_name": "Amatta", | ||
"icons": [ | ||
{ | ||
"src": "https://amatta-icons.s3.ap-northeast-2.amazonaws.com/app/icon-x128.png", | ||
"sizes": "128x128", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "https://amatta-icons.s3.ap-northeast-2.amazonaws.com/app/icon-x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png", | ||
"purpose": "any maskable" | ||
}, | ||
{ | ||
"src": "https://amatta-icons.s3.ap-northeast-2.amazonaws.com/app/icon-x384.png", | ||
"sizes": "384x384", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "https://amatta-icons.s3.ap-northeast-2.amazonaws.com/app/icon-x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
], | ||
"start_url": "https://amatta.site/", | ||
"display": "fullscreen", | ||
"background_color": "#92b8b1", | ||
"theme_color": "#ffffff" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<h1>네트워크 연결 오류</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js'); | ||
|
||
const CACHE = 'cache-offline-page'; | ||
const offlineFallbackPage = 'offline.html'; | ||
|
||
self.addEventListener('message', (event) => { | ||
if (event.data && event.data.type === 'SKIP_WAITING') { | ||
self.skipWaiting(); | ||
} | ||
}); | ||
|
||
self.addEventListener('install', (event) => { | ||
event.waitUntil( | ||
caches | ||
.open(CACHE) | ||
.then((cache) => | ||
cache.addAll([ | ||
'https://amatta.site/', | ||
'./offline.html', | ||
'https://amatta-icons.s3.ap-northeast-2.amazonaws.com/app/icon-x128.png', | ||
'https://amatta-icons.s3.ap-northeast-2.amazonaws.com/app/icon-x192.png', | ||
'https://amatta-icons.s3.ap-northeast-2.amazonaws.com/app/icon-x384.png', | ||
'https://amatta-icons.s3.ap-northeast-2.amazonaws.com/app/icon-x512.png', | ||
]), | ||
), | ||
); | ||
}); | ||
|
||
if (workbox.navigationPreload.isSupported()) { | ||
workbox.navigationPreload.enable(); | ||
} | ||
|
||
workbox.routing.registerRoute( | ||
new RegExp('/*'), | ||
new workbox.strategies.StaleWhileRevalidate({ | ||
cacheName: CACHE, | ||
}), | ||
); | ||
|
||
self.addEventListener('fetch', (event) => { | ||
if (event.request.mode === 'navigate') { | ||
event.respondWith( | ||
(async () => { | ||
try { | ||
const preloadResp = await event.preloadResponse; | ||
|
||
if (preloadResp) { | ||
return preloadResp; | ||
} | ||
|
||
const networkResp = await fetch(event.request); | ||
return networkResp; | ||
} catch (error) { | ||
const cache = await caches.open(CACHE); | ||
const cachedResp = await cache.match(offlineFallbackPage); | ||
return cachedResp; | ||
} | ||
})(), | ||
); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,11 +43,9 @@ const login = () => { | |
const submitData = async (e) => { | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
|
||
//await loginU({ email: '[email protected]', password: 'testPassword' }); | ||
await loginU(userData); | ||
await navigate('/card'); | ||
notification('로그인에 성공하였습니다.', 'login')(); | ||
console.log('뭔데'); | ||
await loginU({ email: '[email protected]', password: 'testPassword' }); | ||
// await loginU(userData); | ||
|
||
const firebaseConfig = { | ||
apiKey: 'AIzaSyCsLBsvozvTnYlDH-5cS0A8X_AjV5o4jjM', | ||
|
@@ -73,6 +71,8 @@ const login = () => { | |
} | ||
// if (res === 'denied') window.alert('알림을 받으시려면 알림을 허용해주세요'); | ||
}); | ||
await navigate('/card'); | ||
notification('로그인에 성공하였습니다.', 'login')(); | ||
}; | ||
|
||
// prettier-ignore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,12 @@ const register = () => { | |
const codeReg = /^[0-9]{6}$/i; | ||
|
||
let userData = { | ||
name: '', | ||
email: '', | ||
verificationCode: '', | ||
phoneNumber: '', | ||
password: '', | ||
passwordCheck: '', | ||
name: 'softeer', | ||
email: '[email protected]', | ||
verificationCode: '123456', | ||
phoneNumber: '010-1234-5678', | ||
password: 'softeer', | ||
passwordCheck: 'softeer', | ||
}; | ||
|
||
const registerTemp = ` | ||
|
@@ -25,6 +25,29 @@ const register = () => { | |
<h5>기프티콘을 효율적으로 관리해보세요.</h5> | ||
`; | ||
|
||
// 데모용 | ||
const setInput = (fragment) => { | ||
$.qs('#user-name-input', fragment).value = userData.name; | ||
$.qs('#email-input', fragment).value = userData.email; | ||
$.qs('#verification-code-input', fragment).value = userData.verificationCode; | ||
$.qs('#phone-input', fragment).value = userData.phoneNumber; | ||
$.qs('#password-input', fragment).value = userData.password; | ||
$.qs('#password-check-input', fragment).value = userData.passwordCheck; | ||
$.qs('.auth-button', fragment).classList.add('active'); | ||
|
||
const formTarget = $.qs('#verification-code-input-section', fragment); | ||
formTarget.classList.add('visible'); | ||
|
||
const buttonTargets = $.qsa('button', fragment); | ||
buttonTargets.forEach((button) => (button.disabled = false)); | ||
|
||
const buttonTarget = $.qs('.confirm-button', fragment); | ||
$.on('click', () => { | ||
closeCodeForm(formTarget)(); | ||
formTarget.style.display = 'none'; | ||
})(buttonTarget); | ||
}; | ||
|
||
const setUserData = (userData, target) => { | ||
const newUserData = { ...userData }; | ||
const dataType = _.getDataset(target, 'data-input'); | ||
|
@@ -39,30 +62,6 @@ const register = () => { | |
userData = updatedUserData; | ||
}); | ||
|
||
// const setUserData = (userData, { target }, targets) => { | ||
// if (!target.validity.valid) return; | ||
|
||
// const dataType = _.getDataset(target, 'data-input'); | ||
// const newUserData = { ...userData }; | ||
|
||
// newUserData[dataType] = target.value; | ||
// userData = newUserData; | ||
|
||
// checkValidateAll(targets); | ||
|
||
// return userData; | ||
// }; | ||
|
||
// const checkValidateAll = (targets) => { | ||
// const $targetClass = $.qs('.auth-button').classList; | ||
|
||
// if (![...targets].every((target) => target.validity.valid)) | ||
// return $targetClass.remove('active'); | ||
// if (userData.password !== userData.passwordCheck) return $targetClass.remove('active'); | ||
|
||
// $targetClass.add('active'); | ||
// }; | ||
|
||
const closeCodeForm = (target) => () => target.classList.remove('visible'); | ||
|
||
const addCodeForm = (e) => { | ||
|
@@ -178,14 +177,6 @@ const register = () => { | |
$.find('.verify-button'), | ||
$.on('click', (e) => checkEmail(e, userData.email))); | ||
|
||
// // prettier-ignore | ||
// const sendVerificationCode = (fragment) => | ||
// new Promise((resolve) => | ||
// _.go( | ||
// fragment, | ||
// $.find('.verify-button'), | ||
// $.on('click', (e) => addCodeForm(e, resolve)))); | ||
|
||
// prettier-ignore | ||
const validateCode = (target) => | ||
_.pipe( | ||
|
@@ -246,6 +237,7 @@ const register = () => { | |
() => sendVerificationCode(fragment), | ||
() => validateCode(fragment), | ||
() => submitData(fragment), | ||
() => setInput(fragment), | ||
() => fragment); | ||
|
||
return appendRegister; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.