{"id":699,"date":"2024-03-15T11:31:50","date_gmt":"2024-03-15T03:31:50","guid":{"rendered":"https:\/\/blog.yiming1234.cn\/?p=699"},"modified":"2024-03-15T11:31:51","modified_gmt":"2024-03-15T03:31:51","slug":"%e4%b8%aa%e4%ba%ba%e5%95%86%e5%9f%8e%e7%b3%bb%e7%bb%9f%e5%bc%80%e6%ba%90%ef%bc%88%e6%b3%a8%e5%86%8c%ef%bc%89","status":"publish","type":"post","link":"https:\/\/blog.yiming1234.cn\/index.php\/2024\/%e4%b8%aa%e4%ba%ba%e5%95%86%e5%9f%8e%e7%b3%bb%e7%bb%9f%e5%bc%80%e6%ba%90%ef%bc%88%e6%b3%a8%e5%86%8c%ef%bc%89\/","title":{"rendered":"\u4e2a\u4eba\u5546\u57ce\u7cfb\u7edf\u5f00\u6e90\uff08\u6ce8\u518c\uff09"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u524d\u8a00<\/h2>\n\n\n\n<p>\u7531\u4e8e\u8fd1\u671f\u5b9e\u5728\u6ca1\u6709\u4ec0\u4e48\u8bdd\u9898\u53ef\u5199\u548c\u4e00\u4e9b\u6709\u8da3\u7684\u9879\u76ee\u6559\u7a0b\u53ef\u4ee5\u5206\u4eab\u3002\u6240\u4ee5\u6211\u53ea\u80fd\u51b3\u5b9a\u5c06\u6211\u81ea\u5df1\u4eb2\u624b\u7f16\u5199\u7684\u4e00\u4e2a\u8ff7\u4f60\u8ff7\u4f60\u5546\u57ce\u7cfb\u7edf\u8fdb\u884c\u5f00\u6e90\u3002<\/p>\n\n\n\n<p>\u4e5f\u5c31\u662f\u653e\u5728\u6211\u535a\u5ba2\u53f3\u8fb9\u7684\u201c\u6211\u7684\u53e6\u4e00\u4e2a\u7f51\u7ad9\u201d\uff08\u7531\u4e8e\u5b9e\u5728\u6ca1\u4ec0\u4e48\u751f\u610f\u53ea\u80fd\u5f00\u6e90\u4e86\uff0c\u5145\u5f53\u6559\u6750\uff09<\/p>\n\n\n\n<p>\u5f00\u59cb\u5206\u4eab\u4e00\u4e9b\u524d\u540e\u7aef\u5168\u6808\u7684\u5185\u5bb9\uff0c\u5e0c\u671b\u5bf9\u4f60\u4eec\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n\n\n\n<p>\u867d\u7136\u662f\u8ff7\u4f60\u7684\u5546\u57ce\u7cfb\u7edf\uff0c\u4f46\u662f\u7531\u4e8e\u8981\u5b9e\u73b0\u6bcf\u4e00\u90e8\u5206\u5404\u81ea\u7684\u529f\u80fd\u8fd8\u662f\u975e\u5e38\u590d\u6742\u7684\uff0c\u6bd4\u5982\u7528\u6237\u7684\u6ce8\u518c\u767b\u5f55\uff0c\u624b\u673a\u53f7\u90ae\u7bb1\u7684\u7ed1\u5b9a\uff0c\u5145\u503c\u652f\u4ed8\u529f\u80fd\u7684\u5b9e\u73b0\u7b49\u7b49\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\u5728\u8fd9\u91cc\u6211\u4f1a\u82b1\u4e00\u5468\u7684\u65f6\u95f4\u6309\u7167\u529f\u80fd\u8fdb\u884c\u5212\u5206\u6765\u9010\u5757\u89e3\u91ca\uff0c\u4e5f\u597d\u6c34\u4e00\u5468\u7684\u6587\u7ae0\u3002\u987a\u4fbf\u53ef\u4ee5\u8fc1\u4e2a\u7ad9\uff0c\u6574\u7406\u4e00\u4e0b\u4ee3\u7801\u3002<\/p>\n\n\n\n<p>\u770b\u4e4b\u524d\u8fd8\u662f\u9ebb\u70e6\u5927\u5bb6\u70b9\u70b9\u5173\u6ce8\uff0c\u8c22\u8c22\uff01\uff08\u5c31\u4e0d\u9009\u4ec5\u7c89\u4e1d\u53ef\u89c1\u4e86\uff09<\/p>\n\n\n\n<p>\u5982\u679c\u5728\u5b9e\u73b0\u4e0a\u5b58\u5728\u4ec0\u4e48\u95ee\u9898\uff0c\u53ef\u4ee5\u8054\u7cfb\u6211\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6b63\u6587<\/h2>\n\n\n\n<p>\u4e0a\u56de\u4e66\u8bf4\u5230\u5546\u57ce\u7cfb\u7edf\u7684\u767b\u5f55\u529f\u80fd\uff0c\u4f46\u7531\u4e8e\u53ef\u80fd\u8fc7\u4e8e\u7b80\u5355\uff0c\u4ee5\u53ca\u8bdd\u9898\u8f83\u4e3a\u8001\u5957\uff0c\u6240\u4ee5\u6ca1\u4ec0\u4e48\u9605\u8bfb\u91cf\u3002<\/p>\n\n\n\n<p>\u800c\u4e14\u73b0\u5728\u8fd9\u79cd\u5546\u57ce\u7cfb\u7edf\u7684\u7f16\u8f91\u5927\u591a\u91c7\u7528vue+spring boot\u7684\u6a21\u5f0f\u8fdb\u884c\u7f16\u8f91\uff0c\u91c7\u7528php\u7684\u5f88\u5c11\u3002<\/p>\n\n\n\n<p>\u4f46\u53c8\u90fd\u662f\u5fc5\u8981\u7684\u529f\u80fd\u65e0\u6cd5\u7701\u53bb\u3002\u4e00\u4e9b\u91cd\u590d\u7684\u8bdd\u5c31\u4e0d\u8bf4\u4e86\uff0c\u76f4\u63a5\u8fdb\u5165\u6b63\u9898\u3002<\/p>\n\n\n\n<p>\u6587\u7ae0\u94fe\u63a5\uff1a<a href=\"https:\/\/blog.yiming1234.cn\/index.php\/2024\/03\/05\/%e4%b8%aa%e4%ba%ba%e5%95%86%e5%9f%8e%e7%b3%bb%e7%bb%9f%e5%bc%80%e6%ba%90%ef%bc%88%e7%99%bb%e5%bd%95%ef%bc%89\/\">https:\/\/blog.yiming1234.cn\/index.php\/2024\/03\/05\/%e4%b8%aa%e4%ba%ba%e5%95%86%e5%9f%8e%e7%b3%bb%e7%bb%9f%e5%bc%80%e6%ba%90%ef%bc%88%e7%99%bb%e5%bd%95%ef%bc%89\/<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/yiming1234.blog.csdn.net\/article\/details\/136496259\">https:\/\/yiming1234.blog.csdn.net\/article\/details\/136496259<\/a><\/p>\n\n\n\n<p>\u8bdd\u4e0d\u591a\u8bf4\uff0c\u76f4\u63a5\u7c98\u8d34\u6e90\u7801\u3002\u524d\u7aef\u9875\u9762\u9700\u8981\u5230\u4e4b\u524d\u7684\u6587\u7ae0\u4e2d\u53bb\u627e\u4e86\u3002<\/p>\n\n\n\n<p>\u6838\u5fc3\u6587\u4ef6\u5c31\u662fregisteraction.php\uff0c\u5269\u4e0b\u7684\u5c31\u662f\u4e00\u4e9b\u8df3\u8f6c\u9875\u9762\u3002<\/p>\n\n\n\n<p>registeraction.php\u7684\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n$username = $_POST&#91;'username'];\n$password = $_POST&#91;'password'];\n$re_password = $_POST&#91;'re_password'];\nrequire \"..\/conn.php\";\n\nfunction isPasswordComplex($password)\n{\n    $uppercase = preg_match('@&#91;A-Z]@', $password);\n    $lowercase = preg_match('@&#91;a-z]@', $password);\n    $number    = preg_match('@&#91;0-9]@', $password);\n    if (!$uppercase || !$lowercase || !$number || strlen($password) &lt; 8) {\n        return false;\n    } else {\n        return true;\n    }\n}\n\nif ($password == $re_password) {\n\n    if (isPasswordComplex($password)) {\n        $stmt_select = $conn->prepare(\"SELECT username FROM content WHERE username = ?\");\n        $stmt_select->bind_param(\"s\", $username);\n        $stmt_select->execute();\n        $ret = $stmt_select->get_result();\n        $num = $ret->num_rows;\n        if ($num &lt; 1) {\n            $stmt_insert_content = $conn->prepare(\"INSERT INTO content (username,password) VALUES(?,?)\");\n            $stmt_insert_content->bind_param(\"ss\", $username, $password);\n            $stmt_insert_content->execute();\n            $result = $stmt_insert_content->get_result();\n\n            $stmt_insert_account = $conn->prepare(\"INSERT INTO account (username) VALUES(?)\");\n            $stmt_insert_account->bind_param(\"s\", $username);\n            $stmt_insert_account->execute();\n\n            $stmt_insert_email = $conn->prepare(\"INSERT INTO email (username) VALUES(?)\");\n            $stmt_insert_email->bind_param(\"s\", $username);\n            $stmt_insert_email->execute();\n\n            $stmt_insert_phone = $conn->prepare(\"INSERT INTO phone (username) VALUES(?)\");\n            $stmt_insert_phone->bind_param(\"s\", $username);\n            $stmt_insert_phone->execute();\n\n            $stmt_insert_subscribe = $conn->prepare(\"INSERT INTO subscribe (username) VALUES(?)\");\n            $stmt_insert_subscribe->bind_param(\"s\", $username);\n            $stmt_insert_subscribe->execute();\n\n            if ($stmt_insert_content->affected_rows > 0) {\n                session_start();\n                $_SESSION&#91;'username'] = $username;\n                $remaining = new DateTime('1000-01-01 00:00:00');\n                $_SESSION&#91;'remaining'] = $remaining;\n                $token = bin2hex(random_bytes(16));\n                $_SESSION&#91;'token'] = $token;\n                header('refresh: 0;url=.\/registersuccess.php');\n                exit;\n            } else {\n                header('refresh: 0;url=.\/loginfail.php');\n            }\n        } else {\n            header('refresh: 0;url=.\/loginexit.php');\n        }\n    } else {\n        header('refresh: 0;url=.\/registerfail.php');\n    }\n} else {\n    header('refresh: 0;url=.\/registerfail2.php');\n}\n<\/code><\/pre>\n\n\n\n<p>\u5176\u4e2d\u6d89\u53ca\u5230\u90ae\u7bb1\u7684\u9a8c\u8bc1\uff08\u5f3a\u5236\u8df3\u8f6c\uff09\uff0c\u5728\u4e4b\u524d\u7684\u6587\u7ae0\u4e2d\u5df2\u7ecf\u4ecb\u7ecd\u8fc7\u4e86\u3002<\/p>\n\n\n\n<p>\u6e90\u7801\u4e0b\u8f7d\u5730\u5740\uff1a\u89c1\u4e4b\u524d\u7684\u6587\u7ae0\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c3e\u58f0<\/h2>\n\n\n\n<p>\u7406\u8bba\u4e0a\u5e94\u8be5\u662f\u8fd8\u6709\u4e00\u4e2a\u5934\u50cf\u4e0a\u4f20\uff0c\u5bc6\u7801\u91cd\u7f6e\uff0c\u4ee5\u53ca\u767b\u5f55\u72b6\u6001\u4fdd\u6301\u529f\u80fd\u7684\u5206\u4eab\u3002\u540e\u9762\u4f1a\u65ad\u65ad\u7eed\u7eed\u8fdb\u884c\u66f4\u65b0\u3002\u4f46\u7531\u4e8e\u8fd9\u4e9b\u529f\u80fd\u5e76\u4e0d\u662f\u5fc5\u8981\u7684\uff0c\u4ee5\u53ca\u9879\u76ee\u7684\u9002\u7528\u8303\u56f4\u6709\u9650\uff0c\u5c31\u5148\u4e0d\u5206\u4eab\u4e86\u3002<\/p>\n\n\n\n<p>\u4e3b\u8981\u662fphp\u7684\u5e94\u7528\u8303\u56f4\u5b9e\u5728\u6709\u9650\uff0c\u800c\u4e14\u76ee\u524d\u6b63\u5728\u81ea\u5b66Vue+Spring Boot\u5185\u5bb9\uff0c\u540e\u9762<strong>\u53ef\u80fd<\/strong>\u4f1a\u4e3b\u8981\u5206\u4eab\u4e00\u4e9b\u8fd9\u65b9\u9762\u7684\u5185\u5bb9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u7531\u4e8e\u8fd1\u671f\u5b9e\u5728\u6ca1\u6709\u4ec0\u4e48\u8bdd\u9898\u53ef\u5199\u548c\u4e00\u4e9b\u6709\u8da3\u7684\u9879\u76ee\u6559\u7a0b\u53ef\u4ee5\u5206\u4eab\u3002\u6240\u4ee5\u6211\u53ea\u80fd\u51b3\u5b9a\u5c06\u6211\u81ea\u5df1\u4eb2\u624b\u7f16\u5199\u7684\u4e00\u4e2a\u8ff7\u4f60\u8ff7\u4f60\u5546 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[11,10],"tags":[],"class_list":["post-699","post","type-post","status-publish","format-standard","hentry","category-web-backend","category-web-frontend"],"_links":{"self":[{"href":"https:\/\/blog.yiming1234.cn\/index.php\/wp-json\/wp\/v2\/posts\/699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.yiming1234.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.yiming1234.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.yiming1234.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.yiming1234.cn\/index.php\/wp-json\/wp\/v2\/comments?post=699"}],"version-history":[{"count":2,"href":"https:\/\/blog.yiming1234.cn\/index.php\/wp-json\/wp\/v2\/posts\/699\/revisions"}],"predecessor-version":[{"id":769,"href":"https:\/\/blog.yiming1234.cn\/index.php\/wp-json\/wp\/v2\/posts\/699\/revisions\/769"}],"wp:attachment":[{"href":"https:\/\/blog.yiming1234.cn\/index.php\/wp-json\/wp\/v2\/media?parent=699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.yiming1234.cn\/index.php\/wp-json\/wp\/v2\/categories?post=699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.yiming1234.cn\/index.php\/wp-json\/wp\/v2\/tags?post=699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}