diff --git a/ismism.ts/deno.lock b/ismism.ts/deno.lock new file mode 100644 index 0000000..46349bb --- /dev/null +++ b/ismism.ts/deno.lock @@ -0,0 +1,105 @@ +{ + "version": "2", + "remote": { + "https://deno.land/std@0.154.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", + "https://deno.land/std@0.154.0/_wasm_crypto/lib/deno_std_wasm_crypto.generated.mjs": "dfcd6777d05345362c70f9f2c49abba3ed3f925fccfcf725abe2d16d51819433", + "https://deno.land/std@0.154.0/_wasm_crypto/mod.ts": "6c60d332716147ded0eece0861780678d51b560f533b27db2e15c64a4ef83665", + "https://deno.land/std@0.154.0/async/deferred.ts": "c01de44b9192359cebd3fe93273fcebf9e95110bf3360023917da9a2d1489fae", + "https://deno.land/std@0.154.0/bytes/bytes_list.ts": "aba5e2369e77d426b10af1de0dcc4531acecec27f9b9056f4f7bfbf8ac147ab4", + "https://deno.land/std@0.154.0/bytes/equals.ts": "3c3558c3ae85526f84510aa2b48ab2ad7bdd899e2e0f5b7a8ffc85acb3a6043a", + "https://deno.land/std@0.154.0/bytes/mod.ts": "763f97d33051cc3f28af1a688dfe2830841192a9fea0cbaa55f927b49d49d0bf", + "https://deno.land/std@0.154.0/crypto/_fnv/fnv32.ts": "aa9bddead8c6345087d3abd4ef35fb9655622afc333fc41fff382b36e64280b5", + "https://deno.land/std@0.154.0/crypto/_fnv/fnv64.ts": "625d7e7505b6cb2e9801b5fd6ed0a89256bac12b2bbb3e4664b85a88b0ec5bef", + "https://deno.land/std@0.154.0/crypto/_fnv/index.ts": "a8f6a361b4c6d54e5e89c16098f99b6962a1dd6ad1307dbc97fa1ecac5d7060a", + "https://deno.land/std@0.154.0/crypto/_fnv/util.ts": "4848313bed7f00f55be3cb080aa0583fc007812ba965b03e4009665bde614ce3", + "https://deno.land/std@0.154.0/crypto/keystack.ts": "e481eed28007395e554a435e880fee83a5c73b9259ed8a135a75e4b1e4f381f7", + "https://deno.land/std@0.154.0/crypto/mod.ts": "0ef11f063cd0f9759485a3c9051e15125e1bde3b47c23b47e79b6e13cfcf9481", + "https://deno.land/std@0.154.0/crypto/timing_safe_equal.ts": "82a29b737bc8932d75d7a20c404136089d5d23629e94ba14efa98a8cc066c73e", + "https://deno.land/std@0.154.0/encoding/base64.ts": "c57868ca7fa2fbe919f57f88a623ad34e3d970d675bdc1ff3a9d02bba7409db2", + "https://deno.land/std@0.154.0/encoding/base64url.ts": "a5f82a9fa703bd85a5eb8e7c1296bc6529e601ebd9642cc2b5eaa6b38fa9e05a", + "https://deno.land/std@0.154.0/encoding/hex.ts": "4cc5324417cbb4ac9b828453d35aed45b9cc29506fad658f1f138d981ae33795", + "https://deno.land/std@0.154.0/fmt/colors.ts": "ff7dc9c9f33a72bd48bc24b21bbc1b4545d8494a431f17894dbc5fe92a938fc4", + "https://deno.land/std@0.154.0/io/buffer.ts": "fae02290f52301c4e0188670e730cd902f9307fb732d79c4aa14ebdc82497289", + "https://deno.land/std@0.154.0/io/files.ts": "d199ef64e918a256320ba8d8d44ae91de87c9077df8f8d6cca013f1b9fbbe285", + "https://deno.land/std@0.154.0/io/mod.ts": "33507cf2460ab67d0d90fb5749fa6fecb33897642b49d54a6bb1ac81e4768f69", + "https://deno.land/std@0.154.0/io/readers.ts": "45847ad404afd2f605eae1cff193f223462bc55eeb9ae313c2f3db28aada0fd6", + "https://deno.land/std@0.154.0/io/streams.ts": "988a19155b52161f0035ce539e2f1d12edbc4c389fa7633da832a64e6edbe1a0", + "https://deno.land/std@0.154.0/io/types.d.ts": "0cae3a62da7a37043661746c65c021058bae020b54e50c0e774916e5d4baee43", + "https://deno.land/std@0.154.0/io/util.ts": "078da53bba767bec0d45f7da44411f6dbf269e51ef7fcfea5e3714e04681c674", + "https://deno.land/std@0.154.0/io/writers.ts": "2e1c63ffd0cfba411b1fd8374609abff9ea86187c9d4d885d42e6fc20325ef0e", + "https://deno.land/std@0.154.0/streams/conversion.ts": "fc4eb76a14148c43f0b85e903a5a1526391aa40ed9434dc21e34f88304eb823e", + "https://deno.land/std@0.154.0/testing/_diff.ts": "141f978a283defc367eeee3ff7b58aa8763cf7c8e0c585132eae614468e9d7b8", + "https://deno.land/std@0.154.0/testing/_format.ts": "cd11136e1797791045e639e9f0f4640d5b4166148796cad37e6ef75f7d7f3832", + "https://deno.land/std@0.154.0/testing/asserts.ts": "ac295f7fd22a7af107580e2475402a8c386cb1bf18bf837ae266ac0665786026", + "https://deno.land/std@0.173.0/encoding/base64.ts": "7de04c2f8aeeb41453b09b186480be90f2ff357613b988e99fabb91d2eeceba1", + "https://deno.land/std@0.173.0/encoding/base64url.ts": "3f1178f6446834457b16bfde8b559c1cd3481727fe384d3385e4a9995dc2d851", + "https://deno.land/std@0.173.0/encoding/hex.ts": "50f8c95b52eae24395d3dfcb5ec1ced37c5fe7610ef6fffdcc8b0fdc38e3b32f", + "https://deno.land/x/mongo@v0.31.1/deps.ts": "ba57aa94021d88959c6aac77edbbe85226e4a6836230dcdd891da63afcbf88c1", + "https://deno.land/x/mongo@v0.31.1/mod.ts": "0989f34d08c40440b8786140abdaf863e964e23df5d1a80e661d3d4170d9d21e", + "https://deno.land/x/mongo@v0.31.1/src/auth/base.ts": "7fe14cf0a63d6bbc4ba69a000a04b3b184d26842504d94652a6af2d0c9494944", + "https://deno.land/x/mongo@v0.31.1/src/auth/mod.ts": "b161611bd5be9e9d1b4497227c8ea93ad4daadcd98038c9e5a707bc5da7a25ca", + "https://deno.land/x/mongo@v0.31.1/src/auth/pbkdf2.ts": "1f1db192fd37869d118ab34780b64567ebcf0ad83a03ef28b3d740cae9adb47a", + "https://deno.land/x/mongo@v0.31.1/src/auth/scram.ts": "187db02e94e7e5423ec902e87d6839028770dca57830dca7f154dcd22a959c0f", + "https://deno.land/x/mongo@v0.31.1/src/auth/x509.ts": "a75b27c549707dd441434ae400a3e6a24da7fe7d4e0e80c9bb79dfc6426b651e", + "https://deno.land/x/mongo@v0.31.1/src/client.ts": "368cac10b3df3bfbc2dfba468d1bbd1332c359a643e0bb81a13d7220a58b43ff", + "https://deno.land/x/mongo@v0.31.1/src/cluster.ts": "cff69bf284a5c7fcaff231494f1ab56ca652e725e58622723e402fbb61448d0e", + "https://deno.land/x/mongo@v0.31.1/src/collection/collection.ts": "b8227c276633d2e6425736d5f5c5d5411deed3bc7bf2fccf36e39d609d5b1cb5", + "https://deno.land/x/mongo@v0.31.1/src/collection/commands/aggregate.ts": "440906a670adb46edb36fd95573ffa83f192775108b621520be992165910e895", + "https://deno.land/x/mongo@v0.31.1/src/collection/commands/find.ts": "5c3b750d8c82ce08d865a381bc71f600406cbc4912c4aa689238755579fb71f8", + "https://deno.land/x/mongo@v0.31.1/src/collection/commands/list_indexes.ts": "d32a5120305d0547497026b4f5ab2ecc2f40ff7f44c405b99c2a0287765333f5", + "https://deno.land/x/mongo@v0.31.1/src/collection/commands/update.ts": "cf352108a5dd34f0928c2196a432383d366b8ed292676c71358b9ecf1289418d", + "https://deno.land/x/mongo@v0.31.1/src/collection/mod.ts": "bd791a0b9b46be4365f88c54893584eadec2f8cd799db9eb05e0b5b4c8d72b8e", + "https://deno.land/x/mongo@v0.31.1/src/database.ts": "6effe102726693d2ed6817973facfbc82ae2b1ac68efddbf54493df7e29e105c", + "https://deno.land/x/mongo@v0.31.1/src/error.ts": "8180a822b0831a94a6a28815865b5b40e3996220684bea60fcb81b272ddd06eb", + "https://deno.land/x/mongo@v0.31.1/src/gridfs/bucket.ts": "a4452d63f6928f57486a214a499b54b80b98cc0d13e3d85a6841b34d5ff12a61", + "https://deno.land/x/mongo@v0.31.1/src/gridfs/indexes.ts": "c9747d8272c65399a6364e08071bd1b5ac9c10816329aa670d7b6b9e895ffb5a", + "https://deno.land/x/mongo@v0.31.1/src/gridfs/upload.ts": "6a54a21b00c6f22ad0da6ceef7a2932dc600560f594c2551abd8e4a64976abae", + "https://deno.land/x/mongo@v0.31.1/src/protocol/cursor.ts": "c370a28856fa236129cc2d7abf7ebc4ac6cdd60acb93e0e7371433f7332394cb", + "https://deno.land/x/mongo@v0.31.1/src/protocol/handshake.ts": "3c3ba547d5322751b9756ce9a4750f3cf18febee0a64edca5b007634bd80e0fe", + "https://deno.land/x/mongo@v0.31.1/src/protocol/header.ts": "0f28db842f886e57b7013606c1391affab2e2960a1a4568d2502e7b788117716", + "https://deno.land/x/mongo@v0.31.1/src/protocol/message.ts": "b1121b98420c9a44783619c7a0b2f7bb2cb305dfc64adc3e6a9b7781f4d35a3a", + "https://deno.land/x/mongo@v0.31.1/src/protocol/mod.ts": "4e24d563049c0a236234598ca786ca13778dc17fdb80ac543ac6c75d0c5094d7", + "https://deno.land/x/mongo@v0.31.1/src/protocol/protocol.ts": "92568dd86e6ef3f54054113d9f5620f158fc1dfee2a7c9d13623975835d5996a", + "https://deno.land/x/mongo@v0.31.1/src/types.ts": "aae7d0053341d26a802de9ac26a5209a67f53052bc2c13fae018396867590d4c", + "https://deno.land/x/mongo@v0.31.1/src/types/geojson.ts": "14690e2fa1591939253ddc9de181b0664051e9462db131b72be5fb9d064dff44", + "https://deno.land/x/mongo@v0.31.1/src/types/geospatial.ts": "c73ee13536365fa5d868b65ab47b3488a5f223a67e1e059761886f750db70ef9", + "https://deno.land/x/mongo@v0.31.1/src/types/gridfs.ts": "e1fd12c3ca58d437267e7a8557d745d23b9d8916d1da34c1847e5e373728dfa0", + "https://deno.land/x/mongo@v0.31.1/src/types/read_write_concern.ts": "d00f35eb85520e776741888685d08d479766a19e9a0a970b53f4594c9db00496", + "https://deno.land/x/mongo@v0.31.1/src/utils/ns.ts": "fb0c57b8dc4d31f8993112d267dec3c163d3e8862198d1cd03b2b51bcc3caad9", + "https://deno.land/x/mongo@v0.31.1/src/utils/saslprep/deps.ts": "95ceb81b353110526dacf2a98854bc79d6e17d7f173af8806e91c05555d7b8c7", + "https://deno.land/x/mongo@v0.31.1/src/utils/saslprep/load_code_points.ts": "f6a4ef2eb2345eac40ffbf1a30661cca803f399865f2a0fadafb71f57d4c97bf", + "https://deno.land/x/mongo@v0.31.1/src/utils/saslprep/memory_pager.ts": "f55a79a13ec569c21630c3915a9af0c6fc0aa2b899121fa2a85a813c6dd4afba", + "https://deno.land/x/mongo@v0.31.1/src/utils/saslprep/mod.ts": "0a8a39a0784d065a79c54ce63d7d7b103d0b94addc5b7bcf985517ba2442c8a1", + "https://deno.land/x/mongo@v0.31.1/src/utils/saslprep/sparse_bitfield.ts": "07d6fe2ecd4ba5f711c44c1ae409bb9c1fe3a3cfc09e27434d231d4aae46dd2d", + "https://deno.land/x/mongo@v0.31.1/src/utils/srv.ts": "ed5f78ffe6480faac68291a87e51e3674eff5f28aec937ee97248e99e1317b16", + "https://deno.land/x/mongo@v0.31.1/src/utils/uri.ts": "dcfab8e1dcfcc875c75ada1d9f366664480c03b65594990d6342ed88925452e5", + "https://deno.land/x/web_bson@v0.2.5/deps.ts": "b113dd66321c328ae90b7cf8f0f6b37ea472f6f5a5a0553f0c7dfd89538d2748", + "https://deno.land/x/web_bson@v0.2.5/mod.ts": "a2b58ed2e1748e6faa56fbe6caf0e1937f4e77de15376cad920aea655b17bcf3", + "https://deno.land/x/web_bson@v0.2.5/src/binary.ts": "2bd89fca666d06b12e4da7ae2aae2b87e495666e002011ceef4fd3e228ea3018", + "https://deno.land/x/web_bson@v0.2.5/src/bson.ts": "608b1b8e1b9a2abcb2d3b601b63e2731608a2ee0941e801a08c1328a37ff0751", + "https://deno.land/x/web_bson@v0.2.5/src/code.ts": "ad713ab49d2c9028fa798630ccdf345a9a2fbaa468c9bd0c3df3f411c3679bd1", + "https://deno.land/x/web_bson@v0.2.5/src/constants.ts": "906fb45165e2df04332ffeb6a407b39d257b76ad64667ecfe4848bfc64934a5e", + "https://deno.land/x/web_bson@v0.2.5/src/db_ref.ts": "2b29a4b74fde79d25322f31f8b98a908270468fa84af7ebd72c1e45b436b9fe2", + "https://deno.land/x/web_bson@v0.2.5/src/decimal128.ts": "f0377c29b255ec423d4b491675dfb83410d5e92a9fcca9bcd63bfd757489b05d", + "https://deno.land/x/web_bson@v0.2.5/src/double.ts": "9df7baf7cdb2d8ef50a141a373c755cabebeb5a5da6c2f551e5377064ccf2aa9", + "https://deno.land/x/web_bson@v0.2.5/src/error.ts": "d7aa0d57de5c6dc137402fc97219b6e136fc2dcddef90f031bdeb52181cc5275", + "https://deno.land/x/web_bson@v0.2.5/src/extended_json.ts": "98f57fba581712e49060ed5d495c3d1b8be557dc61b11588ba79882faad4b289", + "https://deno.land/x/web_bson@v0.2.5/src/float_parser.ts": "bffe91eae89d9d177a88d795981681ecf05850facfb92da93901576a268235cd", + "https://deno.land/x/web_bson@v0.2.5/src/int_32.ts": "8ac60fd82c34b62645f60b2eb45238391a3e0994980dced75b31f97058cbb3b4", + "https://deno.land/x/web_bson@v0.2.5/src/long.ts": "efffd2eb49afd7161452f8f3533d46aad78c9af6b07f6474c8c937a1b53c5d19", + "https://deno.land/x/web_bson@v0.2.5/src/max_key.ts": "8016a701657be73fd4d3b80c746084ba18322bb39bdc4e78e35f0e2f21be2a70", + "https://deno.land/x/web_bson@v0.2.5/src/min_key.ts": "19691f520868996bd2fc96bf26037badf6d32f8702c035e0d8531b549ef9854c", + "https://deno.land/x/web_bson@v0.2.5/src/objectid.ts": "afc51f3bf9d566fa474c96a8ec0362951ff962a4b8c7ecde51e4537fe95be089", + "https://deno.land/x/web_bson@v0.2.5/src/parser/calculate_size.ts": "ca1e81c793860c9200a3c6cfec220539524f81acca0d76738426bbf8ef857950", + "https://deno.land/x/web_bson@v0.2.5/src/parser/deserializer.ts": "40d154d44f80250dfef0121c1c1a997220a38d08c0fc369247f573ef83649802", + "https://deno.land/x/web_bson@v0.2.5/src/parser/serializer.ts": "fdea917596143694eda0059b0f72fdbe72ade0591c6ba4b4e8f82958ab35c37d", + "https://deno.land/x/web_bson@v0.2.5/src/parser/utils.ts": "7bfe19aaf71164d8326f82c1e01dabe6140c18939f4bd8961380495a7c76f57f", + "https://deno.land/x/web_bson@v0.2.5/src/regexp.ts": "1e287a7ada20a0a4b625bf3c191295db149bfefac6beb707fe52d0232c612265", + "https://deno.land/x/web_bson@v0.2.5/src/symbol.ts": "b727698ed367d426b32f068c067ccd43a458347589715dd329b82caf10b9cf32", + "https://deno.land/x/web_bson@v0.2.5/src/timestamp.ts": "49bba69e2a26cfea5870b69c739cbfce64814b21682ed3161105737f3d97ef66", + "https://deno.land/x/web_bson@v0.2.5/src/uuid.ts": "c8c51a946dc8c1d6a15370d50de2247f4fbf69ce1c413ae29c8e211738ec0efc", + "https://deno.land/x/web_bson@v0.2.5/src/uuid_utils.ts": "322cbea409a32cfdbffcae854b91bb30b80730741e032b98f5d6868ad63bc07d", + "https://deno.land/x/web_bson@v0.2.5/src/validate_utf8.ts": "b7f4d723c379fb66aa84e148bb59f78f4e1c96847e28c38ee7f9f3bf35703ae4", + "https://deno.land/x/web_bson@v0.2.5/utils.ts": "4c51c0be4bbb77c1e547eeef9b5aa53ffa611f628684875375103f627649ceb1" + } +} diff --git a/ismism.ts/src/eid/usr.ts b/ismism.ts/src/eid/usr.ts index 517e8af..bcc902e 100644 --- a/ismism.ts/src/eid/usr.ts +++ b/ismism.ts/src/eid/usr.ts @@ -47,8 +47,9 @@ export async function usr_u( if (u.$set.intro && not_intro(u.$set.intro)) return null } try { - const { modifiedCount } = await coll.usr.updateOne({ _id }, u) - return modifiedCount > 0 ? 1 : 0 + const { matchedCount, modifiedCount } = await coll.usr.updateOne({ _id }, u) + if (matchedCount > 0) return modifiedCount > 0 ? 1 : 0 + else return null } catch { return null } } diff --git a/ismism.ts/ui/bind/bind.ts b/ismism.ts/ui/bind/bind.ts index ba32431..50b64e1 100644 --- a/ismism.ts/ui/bind/bind.ts +++ b/ismism.ts/ui/bind/bind.ts @@ -84,11 +84,10 @@ function idanchor( pf: "" | "s" | "a", ) { if (id.length === 0) { el.innerText = "无"; return } - id.forEach((id, n) => { + id.forEach(id => { const a = el.appendChild(document.createElement("a")) a.href = `#${pf}${id}` a.innerText = idnam.get(id) ?? `${id}` - if (n > 0) a.classList.add("sep") }) } @@ -158,7 +157,7 @@ function pasact( nbr_e.readOnly = send_e.disabled = true const sent = await pos("pas", { nbr: nbr_e.value, sms: location.hostname === "ismist.cn" }) if (sent) { - const utc = sent.utc ? `上次发送:${utc_medium(sent.utc)}` : "" + const utc = sent.utc ? `\n上次发送:${utc_medium(sent.utc)}` : "" hint_e.innerText = `验证码已发送,可多次使用\n一小时内不再重复发送${utc}` pas_e.classList.remove("none") } else { @@ -549,8 +548,8 @@ function putusr( adm2: adm2_e.value, intro: intro_e.value.trim(), }) - if (c === null) { - alert(`无效输入`) + if (c === null || c === 0) { + alert(`无效输入\n或用户名已被占用`) put_e.disabled = false } else { pas_a.innerText = nam_e.value diff --git a/ismism.ts/ui/index/style.css b/ismism.ts/ui/index/style.css index 2909c37..e79c580 100644 --- a/ismism.ts/ui/index/style.css +++ b/ismism.ts/ui/index/style.css @@ -143,60 +143,16 @@ section { padding: 0; } -section>p { - display: block; - margin: 0; - padding: 1ch; -} - section>label { display: block; width: 100%; color: var(--gray); } -section>button { - color: var(--lightgray); - background: var(--darkgray); - border: none; - border-radius: 8px; -} - -section>button:disabled { - color: var(--darkgray); - background: var(--lightgray); -} - -section>button:focus { - outline: none; -} - -@media (hover: hover) { - section>button:enabled:hover { - opacity: 0.65; - } -} - -section>input { +section>p { display: block; - font-size: 1em; - border: none; - border-bottom: 1px dotted var(--black); - text-align: center; -} - -section>input:focus { - outline: none; - border-bottom: 1px solid var(--black); -} - -section>input:focus::placeholder { - color: transparent; -} - -section>input:read-only { - background: var(--lightgray); - border: none; + margin: 0; + padding: 1ch; } section>textarea { @@ -204,6 +160,7 @@ section>textarea { display: block; margin: 0; padding: 1ch; + margin: 6px 0; width: 100%; font-size: 1em; overflow: hidden; @@ -246,25 +203,59 @@ section.flex>select { display: block; justify-content: center; align-items: center; + font-size: 1em; } section.flex>label { - transform: translateY(1ch); -} - -section.flex>input, -section.flex>button { - padding: 1ch; -} - -section.flex>input { - flex: 10 1 10ch; - max-width: 36ch; + transform: translateY(0.75ch); } section.flex>button { flex: 1 1 10ch; max-width: 24ch; + padding: 1ch; + background: var(--darkgray); + color: var(--lightgray); + border: none; + border-radius: 8px; +} + +section.flex>button:disabled { + background: var(--lightgray); + color: var(--darkgray); +} + +section.flex>button:focus { + outline: none; +} + +@media (hover: hover) { + section.flex>button:enabled:hover { + opacity: 0.65; + } +} + +section.flex>input { + flex: 10 1 10ch; + padding: 1ch; + max-width: 36ch; + border: none; + border-bottom: 1px dotted var(--black); + text-align: center; +} + +section.flex>input:focus { + outline: none; + border-bottom: 1px solid var(--black); +} + +section.flex>input:focus::placeholder { + color: transparent; +} + +section.flex>input:read-only { + background: var(--lightgray); + border: none; } section.flex>select { @@ -300,12 +291,13 @@ section.meta>span.gray { color: var(--gray); } -section.meta a.sep::before { - content: "、"; +section.meta>span>a:hover { + color: var(--amber); } -section.meta a:hover { - color: var(--amber); +section.meta>span>a:not(:first-child):before { + content: "、"; + color: initial; } a.idnam { diff --git a/ismism.ts/ui/index/template.html b/ismism.ts/ui/index/template.html index 4f17f03..5c79c53 100644 --- a/ismism.ts/ui/index/template.html +++ b/ismism.ts/ui/index/template.html @@ -178,7 +178,7 @@
- +