|
@@ -171,10 +171,6 @@ const actionFullLogin = (login, password) =>
|
|
|
//
|
|
|
|
|
|
let logBtn = document.getElementById('logBtn')
|
|
|
-logBtn.onclick = () => {
|
|
|
- location.href = "#/login"
|
|
|
- store.dispatch(actionLogin())
|
|
|
-}
|
|
|
/********************************MY STUFFF END****************************************************** */
|
|
|
const actionRootCats = () =>
|
|
|
actionPromise('rootCats', gql(`query {
|
|
@@ -243,7 +239,7 @@ window.onhashchange = () => {
|
|
|
store.dispatch(actionGoodById(_id))
|
|
|
},
|
|
|
login() {
|
|
|
-
|
|
|
+ store.dispatch(actionLogin())
|
|
|
}
|
|
|
}
|
|
|
if (route in routes)
|
|
@@ -325,28 +321,50 @@ store.subscribe(()=> {
|
|
|
const { login } = store.getState().promise
|
|
|
const [, route, _id] = location.hash.split('/')
|
|
|
|
|
|
- let passInp, logInp
|
|
|
+ let pass, log
|
|
|
if(!login?.payload && route === 'login') {
|
|
|
console.log('hire');
|
|
|
aside.innerHTML = ''
|
|
|
main.innerHTML = `
|
|
|
- <div style="border: 1px solid black; padding: 10px">
|
|
|
+ <div style="border: 5px solid purple; padding: 10px; background-color: black;">
|
|
|
<button id="returnBtnLogin">⇐ назад</button>
|
|
|
<input id="logInp" style="display:block; margin:10px" type="text" placeholder="login"/>
|
|
|
<input id="passInp" style="display:block; margin:10px" type="text" placeholder="password"/>
|
|
|
- <button style="display:block; margin:0 auto">LOGIN</button>
|
|
|
+ <button id="submitBtn" style="display:block; margin:0 auto">LOGIN</button>
|
|
|
</div>
|
|
|
`
|
|
|
let returnBtn = document.getElementById('returnBtnLogin')
|
|
|
- logInp = document.getElementById('logInp')
|
|
|
- passInp = document.getElementById('passInp')
|
|
|
+ let logInp = document.getElementById('logInp')
|
|
|
+ let passInp = document.getElementById('passInp')
|
|
|
+ let submitBtn = document.getElementById('submitBtn')
|
|
|
+
|
|
|
+ passInp.oninput = (e) => {
|
|
|
+ console.log(e.target.value)
|
|
|
+ pass = e.target.value
|
|
|
+ }
|
|
|
+
|
|
|
+ logInp.oninput = (e) => {
|
|
|
+ console.log(e.target.value)
|
|
|
+ log = e.target.value
|
|
|
+ }
|
|
|
|
|
|
returnBtn.onclick = () => {
|
|
|
logBtn.disabled = false
|
|
|
history.back()
|
|
|
}
|
|
|
+
|
|
|
+ submitBtn.onclick = () => {
|
|
|
+ //store.dispatch(actionLogin(log, pass))
|
|
|
+ console.log('BABAX')
|
|
|
+ }
|
|
|
+
|
|
|
logBtn.disabled = true
|
|
|
}
|
|
|
+
|
|
|
+ if(login?.payload && route === 'login') {
|
|
|
+ history.back()
|
|
|
+
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
window.onload = () => {
|