XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

feat(webui): register (#1779)

Closes #740 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1779 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

3aa853f9
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

8 个文件 +19 -2
Modified static/webui/index.html +1 -0
@@ -85,6 +85,7 @@
85 85 <input class="form-control" type="password" id="password" required />
86 86 <br />
87 87 <button class="btn btn-primary" type="submit" data-loc="login_loginButton"></button>
88 <button class="btn btn-secondary" type="submit" onclick="registerSubmit = true;" data-loc="login_registerButton"></button>
88 89 </form>
89 90 </div>
90 91 <div data-route="/webui/inventory" data-title="Inventory | OpenWF WebUI">
Modified static/webui/script.js +12 -2
@@ -1,8 +1,15 @@
1 let loginOrRegisterPending = false;
2 window.registerSubmit = false;
3
1 4 function doLogin() {
5 if (loginOrRegisterPending) {
6 return;
7 }
8 loginOrRegisterPending = true;
2 9 localStorage.setItem("email", $("#email").val());
3 10 localStorage.setItem("password", $("#password").val());
4 $("#email, #password").val("");
5 11 loginFromLocalStorage();
12 registerSubmit = false;
6 13 }
7 14
8 15 function loginFromLocalStorage() {
@@ -37,12 +44,15 @@ function doLoginRequest(succ_cb, fail_cb) {
37 44 s: "W0RFXVN0ZXZlIGxpa2VzIGJpZyBidXR0cw==", // signature of some kind
38 45 lang: "en",
39 46 date: 1501230947855458660, // ???
40 ClientType: "webui",
47 ClientType: registerSubmit ? "" : "webui",
41 48 PS: "W0RFXVN0ZXZlIGxpa2VzIGJpZyBidXR0cw==" // anti-cheat data
42 49 })
43 50 });
44 51 req.done(succ_cb);
45 52 req.fail(fail_cb);
53 req.always(() => {
54 loginOrRegisterPending = false;
55 });
46 56 }
47 57
48 58 function revalidateAuthz(succ_cb) {
Modified static/webui/translations/de.js +1 -0
@@ -60,6 +60,7 @@ dict = {
60 60 login_emailLabel: `E-Mail-Adresse`,
61 61 login_passwordLabel: `Passwort`,
62 62 login_loginButton: `Anmelden`,
63 login_registerButton: `[UNTRANSLATED] Register`,
63 64 navbar_logout: `Abmelden`,
64 65 navbar_renameAccount: `Account umbenennen`,
65 66 navbar_deleteAccount: `Account löschen`,
Modified static/webui/translations/en.js +1 -0
@@ -59,6 +59,7 @@ dict = {
59 59 login_emailLabel: `Email address`,
60 60 login_passwordLabel: `Password`,
61 61 login_loginButton: `Login`,
62 login_registerButton: `Register`,
62 63 navbar_logout: `Logout`,
63 64 navbar_renameAccount: `Rename Account`,
64 65 navbar_deleteAccount: `Delete Account`,
Modified static/webui/translations/es.js +1 -0
@@ -60,6 +60,7 @@ dict = {
60 60 login_emailLabel: `Dirección de correo electrónico`,
61 61 login_passwordLabel: `Contraseña`,
62 62 login_loginButton: `Iniciar sesión`,
63 login_registerButton: `[UNTRANSLATED] Register`,
63 64 navbar_logout: `Cerrar sesión`,
64 65 navbar_renameAccount: `Renombrar cuenta`,
65 66 navbar_deleteAccount: `Eliminar cuenta`,
Modified static/webui/translations/fr.js +1 -0
@@ -60,6 +60,7 @@ dict = {
60 60 login_emailLabel: `Email`,
61 61 login_passwordLabel: `Mot de passe`,
62 62 login_loginButton: `Connexion`,
63 login_registerButton: `[UNTRANSLATED] Register`,
63 64 navbar_logout: `Déconnexion`,
64 65 navbar_renameAccount: `Renommer le compte`,
65 66 navbar_deleteAccount: `Supprimer le compte`,
Modified static/webui/translations/ru.js +1 -0
@@ -60,6 +60,7 @@ dict = {
60 60 login_emailLabel: `Адрес электронной почты`,
61 61 login_passwordLabel: `Пароль`,
62 62 login_loginButton: `Войти`,
63 login_registerButton: `[UNTRANSLATED] Register`,
63 64 navbar_logout: `Выйти`,
64 65 navbar_renameAccount: `Переименовать аккаунт`,
65 66 navbar_deleteAccount: `Удалить аккаунт`,
Modified static/webui/translations/zh.js +1 -0
@@ -60,6 +60,7 @@ dict = {
60 60 login_emailLabel: `电子邮箱`,
61 61 login_passwordLabel: `密码`,
62 62 login_loginButton: `登录`,
63 login_registerButton: `[UNTRANSLATED] Register`,
63 64 navbar_logout: `退出登录`,
64 65 navbar_renameAccount: `重命名账户`,
65 66 navbar_deleteAccount: `删除账户`,