Add default value to login
This commit is contained in:
parent
1d55095691
commit
92065a7fa7
@ -17,9 +17,9 @@ this is the base site
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.getElementById("btn_register").onclick = function (e) {
|
document.getElementById("btn_register").onclick = function (e) {
|
||||||
let username = document.getElementById("username").value;
|
let username = document.getElementById("username");
|
||||||
|
|
||||||
window.location.replace(`register/${encodeURIComponent(username)}`)
|
window.location.replace(`register/${encodeURIComponent(username.value || username.placeholder)}`)
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
2
main.py
2
main.py
@ -96,7 +96,7 @@ async def handler(request):
|
|||||||
return aiohttp.web.FileResponse('index.html')
|
return aiohttp.web.FileResponse('index.html')
|
||||||
|
|
||||||
|
|
||||||
@routes.get('/register/{username}')
|
@routes.get('/register/{username:.+}')
|
||||||
async def handler(request):
|
async def handler(request):
|
||||||
model = request.app['model']
|
model = request.app['model']
|
||||||
username = request.match_info.get('username', 'Joe')
|
username = request.match_info.get('username', 'Joe')
|
||||||
|
Loading…
Reference in New Issue
Block a user