{"id":28841,"date":"2024-11-25T09:55:23","date_gmt":"2024-11-25T01:55:23","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28841\/"},"modified":"2024-11-25T09:55:23","modified_gmt":"2024-11-25T01:55:23","slug":"phpcms-phpsso%e4%b8%8d%e8%83%bd%e5%90%8c%e6%ad%a5%e9%80%80%e5%87%ba%e6%80%8e%e4%b9%88%e5%8a%9e","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28841\/","title":{"rendered":"phpcms phpsso\u4e0d\u80fd\u540c\u6b65\u9000\u51fa\u600e\u4e48\u529e"},"content":{"rendered":"<p style=\"text-align: center\"><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5e38dba52728c865.jpg\" class=\"aligncenter\" title=\"phpcms phpsso\u4e0d\u80fd\u540c\u6b65\u9000\u51fa\u600e\u4e48\u529e\u63d2\u56fe\" alt=\"phpcms phpsso\u4e0d\u80fd\u540c\u6b65\u9000\u51fa\u600e\u4e48\u529e\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong>\u4e0d\u80fd\u540c\u6b65\u9000\u51fa\u600e\u4e48\u529e\uff1f<span style=\"font-size: 14px;line-height: 1.76em\">phpcmsv9 phpsso\u65e0\u6cd5\u540c\u6b65\u9000\u51fa \uff1f<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>phpcmsv9\u81ea\u5e26\u4e86\u4e00\u4e2aphpsso_server\u7528\u4e8e\u591a\u7ad9\u70b9\u540c\u6b65\u767b\u5f55\uff0c\u8fd8\u53ef\u4ee5\u6574\u5408ucenter\u3002\u4e3a\u4e86\u4e0d\u6539\u52a8\u592a\u591a\u7684\u4ee3\u7801\uff0c\u4eca\u5929\u6574\u5408ECSHOP\u548cPHPCMS\u7684\u65f6\u5019\u8fd8\u662f\u7528\u4e86\u8fd9\u4e2aphpsso\u3002<\/p>\n<p>ECSHOP\u5f88\u65b9\u4fbf\uff0c\u7b80\u5355\u914d\u7f6e\u4e86\u4e00\u4e0b\u5c31\u53ef\u4ee5\u548cucenter\u901a\u4fe1\u4e86\u3002\u8fd9\u4e2aphpsso\u641e\u4e86\u534a\u5929\u6ca1\u6709\u6210\u529f\u548cucenter\u901a\u4fe1\u3002\u7ecf\u8fc7\u51e0\u4e2a\u5c0f\u65f6\u7684\u7422\u78e8\uff0c\u6700\u7ec8\u8fd8\u662f\u6210\u529f\u8ba9\u4ed6\u4eec\u901a\u4fe1\u4e86\u3002<\/p>\n<p>\u6ce8\u518c\uff0c\u767b\u5f55\uff0c\u90fd\u53ef\u4ee5\u540c\u6b65\uff0c\u552f\u72ec\u5728phpcms\u4e2d\u9000\u51fa\u767b\u5f55\u65f6ECSHOP\u6ca1\u6709\u9000\u51fa\uff0c\u53cd\u4e4b\u786e\u53ef\u4ee5\u3002<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p><strong>\u95ee\u9898\u51fa\u73b0\u7684\u539f\u56e0:&nbsp;<\/strong><\/p>\n<p>&nbsp;\u9996\u9875\u770b\u5230\u4e86PHPCMS\u7684\u767b\u51fa\u7684\u4ee3\u7801\u91cc\u9762\u6709\u4e00\u53e5\u540c\u6b65\u767b\u51fa\u7684\u8bed\u53e5\uff1a<\/p>\n<pre>$synlogoutstr&nbsp;=&nbsp;$this-&amp;gt;client-&amp;gt;ps_member_synlogout();<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>&nbsp;\u8fd9\u4e2a\u540c\u6b65\u767b\u51fa\u7684\u4ee3\u7801\u662f\u8fd9\u6837\u7684<\/p>\n<pre>\/**&nbsp;\n&nbsp;*&nbsp;\u540c\u6b65\u9000\u51fa&nbsp;\n&nbsp;*&nbsp;@param&nbsp;string&nbsp;$uid&nbsp;\n&nbsp;*&nbsp;@return&nbsp;string&nbsp;javascript\u7528\u6237\u540c\u6b65\u9000\u51fajs&nbsp;\n&nbsp;*\/&nbsp;&nbsp;\npublic&nbsp;function&nbsp;ps_member_synlogout()&nbsp;{&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$this-&amp;gt;_ps_send(\"synlogout',&nbsp;array());&nbsp;&nbsp;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6ce8\u610f\u8fd9\u91cc_ps_send\u7684\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u4e00\u4e2a\u7a7a\u7684\u6570\u7ec4<\/p>\n<p>\u518d\u770b\u5230phpsso_server\u4e2dphpsso\u7c7b\u7684\u6784\u9020\u51fd\u6570\uff1a<\/p>\n<pre>if(isset($_POST[\"data']))&nbsp;{&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;parse_str(sys_auth($_POST['data'],&nbsp;'DECODE',&nbsp;$this-&amp;gt;applist[$this-&amp;gt;appid]['authkey']),&nbsp;$this-&amp;gt;data);&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;if(emptyempty($this-&amp;gt;data)&nbsp;||&nbsp;!is_array($this-&amp;gt;data))&nbsp;{&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit('0');&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;\n}&nbsp;else&nbsp;{&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;exit('0');&nbsp;&nbsp;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u91cc\u5bf9$this-&gt;data\u6709\u4e00\u4e2a\u5224\u65ad\uff0c\u5982\u679cempty\u8fd4\u56detrue\u5c31\u76f4\u63a5\u8fd4\u56de0\u4e0d\u4f1a\u518d\u6267\u884c\u4e0b\u9762\u7684\u540c\u6b65\u9000\u51fa\u4ee3\u7801\u4e86\u3002\u800c\u4e0a\u9762\u4e00\u6b65\u53ef\u4ee5\u770b\u5230\u8c03\u7528\u540c\u6b65\u767b\u51fa\u65f6\u4f20\u5165\u7684data\u53c2\u6570\u6070\u6070\u5c31\u662farray()\uff0cempty\u5f53\u7136\u4f1a\u8fd4\u56detrue\u3002\u4e8e\u662f\u8c03\u7528\u540c\u6b65\u9000\u51fa\u5c31\u5728\u8fd9\u91cc\u7ec8\u6b62\u3002<\/p>\n<p><strong>\u95ee\u9898\u7684\u89e3\u51b3\u529e\u6cd5:&nbsp;<\/strong><\/p>\n<p>\u77e5\u9053\u4e86\u539f\u56e0\u8981\u60f3\u89e3\u51b3\u5c31\u5f88\u5bb9\u6613\u4e86\uff0c\u4e3b\u8981\u6709\u4e24\u79cd\u3002<\/p>\n<p>\u4fdd\u9669\u4e00\u70b9\u7684\u65b9\u6cd5\u662f\u5230ps_member_synlogout\u91cc\u9762\u7ed9\u90a3\u4e2a\u7a7a\u7684\u6570\u7ec4\u968f\u4fbf\u589e\u52a0\u4e00\u4e2a\u5143\u7d20\u3002<\/p>\n<p>\u7b2c\u4e8c\u79cd\u5c31\u662f\u53bb\u6389empty($this-&gt;data)\u8fd9\u4e2a\u5224\u65ad\u3002<\/p>\n<p>PHP\u4e2d\u6587\u7f51\uff0c\u5927\u91cf\u7684\u514d\u8d39\uff0c\u6b22\u8fce\u5728\u7ebf\u5b66\u4e60\uff01<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f phpsso\u4e0d\u80fd\u540c\u6b65\u9000\u51fa\u600e\u4e48\u529e\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0d\u80fd\u540c\u6b65\u9000\u51fa\u600e\u4e48\u529e\uff1fphpcmsv9 phpsso\u65e0\u6cd5\u540c\u6b65\u9000\u51fa \uff1f &nbsp; phpcmsv9\u81ea\u5e26\u4e86\u4e00\u4e2aphpsso_server\u7528\u4e8e\u591a\u7ad9\u70b9\u540c\u6b65\u767b\u5f55\uff0c\u8fd8\u53ef\u4ee5\u6574\u5408ucenter\u3002\u4e3a\u4e86\u4e0d\u6539\u52a8\u592a\u591a\u7684\u4ee3\u7801\uff0c\u4eca\u5929\u6574\u5408ECSHOP\u548cPHPCMS\u7684\u65f6\u5019\u8fd8\u662f\u7528\u4e86\u8fd9\u4e2aphpsso\u3002 ECSHOP\u5f88\u65b9\u4fbf\uff0c\u7b80\u5355\u914d\u7f6e\u4e86\u4e00\u4e0b\u5c31\u53ef\u4ee5\u548cucenter\u901a\u4fe1\u4e86\u3002\u8fd9\u4e2aphpsso\u641e\u4e86\u534a\u5929\u6ca1\u6709\u6210\u529f\u548cucenter\u901a\u4fe1\u3002\u7ecf\u8fc7\u51e0\u4e2a\u5c0f\u65f6\u7684\u7422\u78e8\uff0c\u6700\u7ec8\u8fd8\u662f\u6210\u529f\u8ba9\u4ed6\u4eec\u901a\u4fe1\u4e86\u3002 \u6ce8\u518c\uff0c\u767b\u5f55\uff0c\u90fd\u53ef\u4ee5\u540c\u6b65\uff0c\u552f\u72ec\u5728phpcms\u4e2d\u9000\u51fa\u767b\u5f55\u65f6ECSHOP\u6ca1\u6709\u9000\u51fa\uff0c\u53cd\u4e4b\u786e\u53ef\u4ee5\u3002 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u95ee\u9898\u51fa\u73b0\u7684\u539f\u56e0:&nbsp; &nbsp;\u9996\u9875\u770b\u5230\u4e86PHPCMS\u7684\u767b\u51fa\u7684\u4ee3\u7801\u91cc\u9762\u6709\u4e00\u53e5\u540c\u6b65\u767b\u51fa\u7684\u8bed\u53e5\uff1a $synlogoutstr&nbsp;=&nbsp;$this-&amp;gt;client-&amp;gt;ps_member_synlogout(); \u767b\u5f55\u540e\u590d\u5236 &nbsp;\u8fd9\u4e2a\u540c\u6b65\u767b\u51fa\u7684\u4ee3\u7801\u662f\u8fd9\u6837\u7684 \/**&nbsp; &nbsp;*&nbsp;\u540c\u6b65\u9000\u51fa&nbsp; &nbsp;*&nbsp;@param&nbsp;string&nbsp;$uid&nbsp; &nbsp;*&nbsp;@return&nbsp;string&nbsp;javascript\u7528\u6237\u540c\u6b65\u9000\u51fajs&nbsp; &nbsp;*\/&nbsp;&nbsp; public&nbsp;function&nbsp;ps_member_synlogout()&nbsp;{&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$this-&amp;gt;_ps_send(&#8220;synlogout&#8217;,&nbsp;array());&nbsp;&nbsp; } \u767b\u5f55\u540e\u590d\u5236 \u6ce8\u610f\u8fd9\u91cc_ps_send\u7684\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u4e00\u4e2a\u7a7a\u7684\u6570\u7ec4 \u518d\u770b\u5230phpsso_server\u4e2dphpsso\u7c7b\u7684\u6784\u9020\u51fd\u6570\uff1a if(isset($_POST[&#8220;data&#8217;]))&nbsp;{&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;parse_str(sys_auth($_POST[&#8216;data&#8217;],&nbsp;&#8216;DECODE&#8217;,&nbsp;$this-&amp;gt;applist[$this-&amp;gt;appid][&#8216;authkey&#8217;]),&nbsp;$this-&amp;gt;data);&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;if(emptyempty($this-&amp;gt;data)&nbsp;||&nbsp;!is_array($this-&amp;gt;data))&nbsp;{&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit(&#8216;0&#8217;);&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp; }&nbsp;else&nbsp;{&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;exit(&#8216;0&#8217;);&nbsp;&nbsp; } \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u91cc\u5bf9$this-&gt;data\u6709\u4e00\u4e2a\u5224\u65ad\uff0c\u5982\u679cempty\u8fd4\u56detrue\u5c31\u76f4\u63a5\u8fd4\u56de0\u4e0d\u4f1a\u518d\u6267\u884c\u4e0b\u9762\u7684\u540c\u6b65\u9000\u51fa\u4ee3\u7801\u4e86\u3002\u800c\u4e0a\u9762\u4e00\u6b65\u53ef\u4ee5\u770b\u5230\u8c03\u7528\u540c\u6b65\u767b\u51fa\u65f6\u4f20\u5165\u7684data\u53c2\u6570\u6070\u6070\u5c31\u662farray()\uff0cempty\u5f53\u7136\u4f1a\u8fd4\u56detrue\u3002\u4e8e\u662f\u8c03\u7528\u540c\u6b65\u9000\u51fa\u5c31\u5728\u8fd9\u91cc\u7ec8\u6b62\u3002 \u95ee\u9898\u7684\u89e3\u51b3\u529e\u6cd5:&nbsp; \u77e5\u9053\u4e86\u539f\u56e0\u8981\u60f3\u89e3\u51b3\u5c31\u5f88\u5bb9\u6613\u4e86\uff0c\u4e3b\u8981\u6709\u4e24\u79cd\u3002 \u4fdd\u9669\u4e00\u70b9\u7684\u65b9\u6cd5\u662f\u5230ps_member_synlogout\u91cc\u9762\u7ed9\u90a3\u4e2a\u7a7a\u7684\u6570\u7ec4\u968f\u4fbf\u589e\u52a0\u4e00\u4e2a\u5143\u7d20\u3002 \u7b2c\u4e8c\u79cd\u5c31\u662f\u53bb\u6389empty($this-&gt;data)\u8fd9\u4e2a\u5224\u65ad\u3002 PHP\u4e2d\u6587\u7f51\uff0c\u5927\u91cf\u7684\u514d\u8d39\uff0c\u6b22\u8fce\u5728\u7ebf\u5b66\u4e60\uff01 \u4ee5\u4e0a\u5c31\u662f phpsso\u4e0d\u80fd\u540c\u6b65\u9000\u51fa\u600e\u4e48\u529e\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\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":[18],"tags":[],"class_list":["post-28841","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28841","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=28841"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28841\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}