{"id":6899,"date":"2024-11-14T08:15:32","date_gmt":"2024-11-14T00:15:32","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6899\/"},"modified":"2024-11-14T08:15:32","modified_gmt":"2024-11-14T00:15:32","slug":"%e5%a4%9a%e5%af%b9%e5%a4%9a%e5%85%b3%e7%b3%bb%e8%a1%a8%e4%b8%ad%e9%9a%8f%e6%9c%ba%e5%ad%97%e7%ac%a6%e4%b8%b2-fk7qg6itn5ajdoa9h9o78v9ksur-%e7%9a%84%e4%bd%9c%e7%94%a8%e6%98%af%e4%bb%80%e4%b9%88","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6899\/","title":{"rendered":"\u591a\u5bf9\u591a\u5173\u7cfb\u8868\u4e2d\u968f\u673a\u5b57\u7b26\u4e32 &#8220;FK7qg6itn5ajdoa9h9o78v9ksur&#8221; \u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173003905220143.jpg\" class=\"aligncenter\" title=\"\u591a\u5bf9\u591a\u5173\u7cfb\u8868\u4e2d\u968f\u673a\u5b57\u7b26\u4e32 &#8220;FK7qg6itn5ajdoa9h9o78v9ksur&#8221; \u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f\u63d2\u56fe\" alt=\"\u591a\u5bf9\u591a\u5173\u7cfb\u8868\u4e2d\u968f\u673a\u5b57\u7b26\u4e32 &#8220;FK7qg6itn5ajdoa9h9o78v9ksur&#8221; \u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u591a\u5bf9\u591a\u5173\u7cfb\u8868\u4e2d\u968f\u673a\u5b57\u7b26\u4e32\u7684\u542b\u4e49\u4e0e\u4f5c\u7528<\/strong><\/p>\n<p>\u5728\u521b\u5efa\u591a\u5bf9\u591a\u5173\u7cfb\u8868\u65f6\uff0c\u53ef\u80fd\u4f1a\u770b\u5230\u7c7b\u4f3c\u5982\u4e0b sql \u8bed\u53e5\uff1a<\/p>\n<pre>CREATE TABLE sys_roles_depts (\n    role_id bigint(20) NOT NULL,\n    dept_id bigint(20) NOT NULL,\n    PRIMARY KEY (role_id, dept_id) USING BTREE,\n    KEY FK7qg6itn5ajdoa9h9o78v9ksur (dept_id) USING BTREE\n);<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5176\u4e2d\uff0c\u95ee\u9898\u4e2d\u7684\u968f\u673a\u5b57\u7b26\u4e32\uff08fk7qg6itn5ajdoa9h9o78v9ksur\uff09\u662f\u7d22\u5f15\u7684\u540d\u3002\u5b83\u8868\u793a\u7ed9 dept_id \u5217\u5efa\u7acb\u7684\u4e8c\u7ea7\u7d22\u5f15\u3002<\/p>\n<p>\u5176\u4f5c\u7528\u662f\u4f18\u5316\u5bf9 dept_id \u5217\u7684\u67e5\u8be2\u6027\u80fd\u3002\u867d\u7136\u6211\u4eec\u5df2\u4e3a role_id \u548c dept_id \u521b\u5efa\u4e86\u4e3b\u952e\u7d22\u5f15\uff0c\u4f46\u4e3b\u952e\u7d22\u5f15\u662f\u4e00\u79cd\u8054\u5408\u7d22\u5f15\uff0c\u5f53\u4ec5\u4f7f\u7528 dept_id \u4f5c\u4e3a\u67e5\u8be2\u6761\u4ef6\u65f6\uff0c\u4e3b\u952e\u7d22\u5f15\u65e0\u6cd5\u4f7f\u7528\u3002\u56e0\u6b64\uff0c\u9700\u8981\u521b\u5efa\u5355\u72ec\u7684\u4e8c\u7ea7\u7d22\u5f15\u4ee5\u63d0\u9ad8\u67e5\u8be2\u6548\u7387\u3002<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u968f\u673a\u5b57\u7b26\u4e32\u7528\u4e8e\u4e3a\u7d22\u5f15\u751f\u6210\u552f\u4e00\u540d\u79f0\u3002\u6211\u4eec\u4e00\u822c\u4f1a\u9075\u5faa\u547d\u540d\u89c4\u8303\uff0c\u4f7f\u7528 idx_ \u4f5c\u4e3a\u7d22\u5f15\u540d\u79f0\u7684\u524d\u7f00\uff0c\u4f8b\u5982 idx_dept_id\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u591a\u5bf9\u591a\u5173\u7cfb\u8868\u4e2d\u968f\u673a\u5b57\u7b26\u4e32 &#8220;FK7qg6itn5ajdoa9h9o78v9ksur&#8221; \u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u591a\u5bf9\u591a\u5173\u7cfb\u8868\u4e2d\u968f\u673a\u5b57\u7b26\u4e32\u7684\u542b\u4e49\u4e0e\u4f5c\u7528 \u5728\u521b\u5efa\u591a\u5bf9\u591a\u5173\u7cfb\u8868\u65f6\uff0c\u53ef\u80fd\u4f1a\u770b\u5230\u7c7b\u4f3c\u5982\u4e0b sql \u8bed\u53e5\uff1a CREATE TABLE sys_roles_depts ( role_id bigint(20) NOT NULL, dept_id bigint(20) NOT NULL, PRIMARY KEY (role_id, dept_id) USING BTREE, KEY FK7qg6itn5ajdoa9h9o78v9ksur (dept_id) USING BTREE ); \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff0c\u95ee\u9898\u4e2d\u7684\u968f\u673a\u5b57\u7b26\u4e32\uff08fk7qg6itn5ajdoa9h9o78v9ksur\uff09\u662f\u7d22\u5f15\u7684\u540d\u3002\u5b83\u8868\u793a\u7ed9 dept_id \u5217\u5efa\u7acb\u7684\u4e8c\u7ea7\u7d22\u5f15\u3002 \u5176\u4f5c\u7528\u662f\u4f18\u5316\u5bf9 dept_id \u5217\u7684\u67e5\u8be2\u6027\u80fd\u3002\u867d\u7136\u6211\u4eec\u5df2\u4e3a role_id \u548c dept_id \u521b\u5efa\u4e86\u4e3b\u952e\u7d22\u5f15\uff0c\u4f46\u4e3b\u952e\u7d22\u5f15\u662f\u4e00\u79cd\u8054\u5408\u7d22\u5f15\uff0c\u5f53\u4ec5\u4f7f\u7528 dept_id \u4f5c\u4e3a\u67e5\u8be2\u6761\u4ef6\u65f6\uff0c\u4e3b\u952e\u7d22\u5f15\u65e0\u6cd5\u4f7f\u7528\u3002\u56e0\u6b64\uff0c\u9700\u8981\u521b\u5efa\u5355\u72ec\u7684\u4e8c\u7ea7\u7d22\u5f15\u4ee5\u63d0\u9ad8\u67e5\u8be2\u6548\u7387\u3002 \u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u968f\u673a\u5b57\u7b26\u4e32\u7528\u4e8e\u4e3a\u7d22\u5f15\u751f\u6210\u552f\u4e00\u540d\u79f0\u3002\u6211\u4eec\u4e00\u822c\u4f1a\u9075\u5faa\u547d\u540d\u89c4\u8303\uff0c\u4f7f\u7528 idx_ \u4f5c\u4e3a\u7d22\u5f15\u540d\u79f0\u7684\u524d\u7f00\uff0c\u4f8b\u5982 idx_dept_id\u3002 \u4ee5\u4e0a\u5c31\u662f\u591a\u5bf9\u591a\u5173\u7cfb\u8868\u4e2d\u968f\u673a\u5b57\u7b26\u4e32 &#8220;FK7qg6itn5ajdoa9h9o78v9ksur&#8221; \u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6899","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6899","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6899"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6899\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}