From 9f1aeb2b58d7ed9a562bcc2df18f7ffb8ee7da22 Mon Sep 17 00:00:00 2001 From: cutls Date: Wed, 27 Nov 2019 23:03:18 +0900 Subject: [PATCH] IDE key --- app/js/post/post.js | 13 +++++++------ app/view/make/index.sample.html | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/js/post/post.js b/app/js/post/post.js index 2fcda3d5..e5500f31 100644 --- a/app/js/post/post.js +++ b/app/js/post/post.js @@ -17,6 +17,13 @@ function post(mode, postvis) { var acct_id = $('#post-acct-sel').val() localStorage.setItem('last-use', acct_id) var domain = localStorage.getItem('domain_' + acct_id) + if ($('#ideKey').val() != '') { + var ideKey = $('#ideKey').val() + } else { + var user = localStorage.getItem('user_' + acct_id) + var ideKey = Math.floor(Date.now() / 1000) + '/TheDesk/' + user + '@' + domain + $('#ideKey').val(ideKey) + } if (!localStorage.getItem('cw_sentence')) { var cw_sent = 500 } else { @@ -148,12 +155,6 @@ function post(mode, postvis) { } } console.table(toot) - if($('#ideKey').val() != ''){ - var ideKey = $('#ideKey').val() - } else { - var ideKey = Date.now() + '/' + Math.random().toString(32).substring(2) - $('#ideKey').val(ideKey) - } var httpreq = new XMLHttpRequest() httpreq.open('POST', start, true) httpreq.setRequestHeader('Content-Type', 'application/json') diff --git a/app/view/make/index.sample.html b/app/view/make/index.sample.html index 95a95971..2323b2cd 100644 --- a/app/view/make/index.sample.html +++ b/app/view/make/index.sample.html @@ -775,7 +775,7 @@ Cutls
- ・冪等性の確保 + ・冪等性の確保(これにより2秒以内の同一アカウントからの連投は禁止されます。) Cutls