锘??xml version="1.0" encoding="utf-8" standalone="yes"?>91久久香蕉国产熟女线看,国产成人久久久精品二区三区,欧美国产成人久久精品http://www.shnenglu.com/egametang/zh-cnSat, 28 Jun 2025 12:16:55 GMTSat, 28 Jun 2025 12:16:55 GMT60C++ protobuf 涓嶄粎浠呮槸搴忓垪鍖栤︹?/title><link>http://www.shnenglu.com/egametang/archive/2012/04/12/171063.html</link><dc:creator>鍞愯瘲</dc:creator><author>鍞愯瘲</author><pubDate>Thu, 12 Apr 2012 04:09:00 GMT</pubDate><guid>http://www.shnenglu.com/egametang/archive/2012/04/12/171063.html</guid><wfw:comment>http://www.shnenglu.com/egametang/comments/171063.html</wfw:comment><comments>http://www.shnenglu.com/egametang/archive/2012/04/12/171063.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/egametang/comments/commentRss/171063.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/egametang/services/trackbacks/171063.html</trackback:ping><description><![CDATA[<div><span style="font-size: 12px;">涓鐐瑰皬鐗㈤獨 cppblog鍜屽崥瀹㈠洯鏄暐鍏崇郴鍛紵鍚屼袱杈圭殑浜轟氦嫻佷氦嫻?闅鵑亾鎴戜袱杈歸兘瑕佸彂涓閬嶏紵<br /><br />      C++涓璸rotobuf鏄釜甯哥敤鐨勫簭鍒楀寲搴擄紝緗戠粶娑堟伅鍙戦侊紝娑堟伅瑙f瀽閮藉崄鍒嗘柟渚匡紝xml鍙互騫茬殑錛屽畠閮借兘騫層備絾鏄畠緇濅笉浠呬粎鏄簭鍒楀寲搴撱?/span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">綆鍗曠殑璇達紝protobuf緇機++澧炲姞浜咰# attribute鐨勫姛鑳姐侰++浠庢灝辨湁浜嗗厓鏁版嵁浜嗭紒浼歝#鐨勫悓瀛﹁偗瀹氭槑鐧戒簡榪欏彞璇濈殑鎰忎箟浜嗐?/span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">涓. protobuf鐢ㄤ綔閰嶇疆鏂囦歡錛?/span></div><div><span style="font-size: 12px;">protobuf鎻愪緵浜嗕竴縐峵extformat鐨勫簭鍒楀寲鏍煎紡錛岀被浼糺son鏍煎紡錛屾竻鏅版槗璇匯傛瘮濡備竴媯佃涓烘爲鑺傜偣鎻忚堪鏂囦歡錛?/span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">鏁版嵁瀹氫箟涓猴細</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">message BehaviorNodeConf</span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>required int32 type = 1;</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>// 鏉′歡闇瑕佺殑鍙傛暟</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>repeated int32 args = 2;</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>// 鍖呭惈澶氫釜瀛愯妭鐐?/span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>repeated BehaviorNodeConf node = 3;</span></div><div><span style="font-size: 12px;">};</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">message BehaviorTreeConf</span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>// 琛屼負鏍戠被鍨? AI, ON_HIT, ON_HITTED ...</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>required int32 type = 1;</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>// 琛屼負鏍戣妭鐐?/span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>required BehaviorNodeConf node = 2;</span></div><div><span style="font-size: 12px;">};閰嶇疆鏂囦歡涓猴細</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">type: 5</span></div><div><span style="font-size: 12px;">node:</span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>type: 1</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>node:</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>type: 101</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>args: 2</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>}</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>node:</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>type: 1</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>node:</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>type: 1001</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>args: 0</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>args: 100</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>}</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>node:</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>type: 1001</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>args: 1</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>args: -100</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>}</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>}</span></div><div><span style="font-size: 12px;">} 浠ヤ笅涓よ浠g爜鍗沖彲瑙f瀽榪欎釜閰嶇疆鏂囦歡錛欱ehaviorTreeConf conf;</span></div><div><span style="font-size: 12px;">google::protobuf::TextFormat::ParseFromString(fileContent, &conf);浜? protobuf鐨勫弽灝勭敤娉?/span></div><div><span style="font-size: 12px;">寰堝浜洪兘璇碈++寰堥毦鍋歄rm錛屽洜涓烘病鏈夊弽灝勭瓑絳夛紝鏈変簡protobuf榪欎竴鍒囬兘涓嶆槸闂浜嗭紝濡備笅錛?/span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">select鎿嶄綔錛氳嚜鍔ㄧ敓鎴恠elect璇彞錛屾煡璇竴鏉¤褰曟妸瀹冧繚瀛樺埌person鍙橀噺閲岄潰</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>try</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>DbHelper dbHelper("tcp://127.0.0.1:3306", "root", "111111");</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>DbResultPtr result = dbHelper.Execute(</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>Select<Person>(Column("*")).</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>Where(Column("age") > 10)</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>);</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>auto person = boost::make_shared<Person>();</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>result->One(person);</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>ASSERT_EQ(26, person->age());</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>}</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>catch (const Exception& e)</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>}  update鎿嶄綔: 鑷姩鐢熸垚update璇彞錛岃繖孌典唬鐮佹槸浠庢垜鐨勫崟鍏冩祴璇曢噷闈㈡姞鍑烘潵鐨勶紝澶у鏄庣櫧鎰忔濆氨琛屼簡TEST_F(UpdateTest, Update_Where)</span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>std::string expectedSql;</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>expectedSql =</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>"update Egametang.Person "</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>"set guid = 1, age = 18, comment = 'a good student!' "</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>"where age > 10";</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>Person person;</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>person.set_guid(1);</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>person.set_age(18);</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>person.set_comment("a good student!");</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>Update update(person);</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>update.Where(Column("age") > 10);</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>EXPECT_EQ(expectedSql, update.ToString());</span></div><div><span style="font-size: 12px;">} 涓?protbuf 綾諱技c# attribute鍔熻兘</span></div><div><span style="font-size: 12px;">鐪嬪涓嬩竴孌祊rotobuf瀹氫箟錛歩mport "google/protobuf/descriptor.proto";</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">extend google.protobuf.FileOptions </span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;">    optional string my_file_option = 50000;</span></div><div><span style="font-size: 12px;">}</span></div><div><span style="font-size: 12px;">extend google.protobuf.MessageOptions </span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;">    optional int32 my_message_option = 50001;</span></div><div><span style="font-size: 12px;">}</span></div><div><span style="font-size: 12px;">extend google.protobuf.FieldOptions </span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;">    optional float my_field_option = 50002;</span></div><div><span style="font-size: 12px;">}</span></div><div><span style="font-size: 12px;">extend google.protobuf.EnumOptions </span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;">    optional bool my_enum_option = 50003;</span></div><div><span style="font-size: 12px;">}</span></div><div><span style="font-size: 12px;">extend google.protobuf.EnumValueOptions </span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;">    optional uint32 my_enum_value_option = 50004;</span></div><div><span style="font-size: 12px;">}</span></div><div><span style="font-size: 12px;">extend google.protobuf.ServiceOptions </span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;">    optional MyEnum my_service_option = 50005;</span></div><div><span style="font-size: 12px;">}</span></div><div><span style="font-size: 12px;">extend google.protobuf.MethodOptions </span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;">    optional MyMessage my_method_option = 50006;</span></div><div><span style="font-size: 12px;">}</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">option (my_file_option) = "Hello world!";</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">message MyMessage </span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;">    option (my_message_option) = 1234;</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">    optional int32 foo = 1 [(my_field_option) = 4.5];</span></div><div><span style="font-size: 12px;">    optional string bar = 2;</span></div><div><span style="font-size: 12px;">}</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">enum MyEnum </span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;">    option (my_enum_option) = true;</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">    FOO = 1 [(my_enum_value_option) = 321];</span></div><div><span style="font-size: 12px;">    BAR = 2;</span></div><div><span style="font-size: 12px;">}</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">message RequestType {}</span></div><div><span style="font-size: 12px;">message ResponseType {}</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">service MyService </span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;">    option (my_service_option) = FOO;</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">    rpc MyMethod(RequestType) returns(ResponseType) </span></div><div><span style="font-size: 12px;">    {</span></div><div><span style="font-size: 12px;">        // Note:  my_method_option has type MyMessage.  We can set each field</span></div><div><span style="font-size: 12px;">        //   within it using a separate "option" line.</span></div><div><span style="font-size: 12px;">        option (my_method_option).foo = 567;</span></div><div><span style="font-size: 12px;">        option (my_method_option).bar = "Some string";</span></div><div><span style="font-size: 12px;">    }</span></div><div><span style="font-size: 12px;">}protobuf涓殑option灝辨槸C#涓殑attribute錛宱ption鍚屾牱鍙互鏀懼湪message錛堝悓c#鐨刢lass錛?service錛堝悓c#鐨勬柟娉曪級 浠ュ強message鐨刦ield涓婇潰</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">鍥?娓告垙寮鍙戜腑濡備綍鍒╃敤protobuf鐨勮繖鍔熻兘鍛紵</span></div><div><span style="font-size: 12px;">1.絳栧垝浣跨敤protobuf浣滀負閰嶇疆鏂囦歡錛屾垜鍙互鍦ㄦ暟鎹畾涔変腑璁劇疆鏌愪釜瀛楁鐨刼ption涓篊#鐨勫摢涓帶浠訛紝</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">緙栬緫鍣ㄨ鍒拌繖涓暟鎹畾涔夊氨鍙互鐩存帴鐢熸垚涓涓帶浠訛紝鍥犳鍙互鏍規嵁鏁版嵁瀹氫箟鐢熸垚緙栬緫鍣ㄧ粰絳栧垝濉啓鏁版嵁銆備緥濡傦細</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">message BehaviorNodeConf</span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>required int32 type = 1 [control = "textbox" max = 100 min = 0];</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>// 鏉′歡闇瑕佺殑鍙傛暟</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>repeated int32 args = 2 [control = "textbox"];</span></div><div><span style="font-size: 12px;">}; 2.鍐嶅錛?鎶鑳藉彲浠ユ柦鏀綽uff錛屾瘡涓猙uff閮藉簲璇ユ湁涓涓叧鑱旂殑鎶鑳斤紝閭d箞絳栧垝濉〃鐨勬椂鍊欒濉竴涓妧鑳界殑proto琛ㄨ繕瑕佸~涓涓猙uff鐨刾roto琛紝涓ゅ紶琛ㄧ瓥鍒掑緢瀹規槗灝卞~婕忎簡鎴戜滑鍙互鍔犱笂涓涓害鏉燂紝鐢辯紪杈戝櫒鍘繪鏌ワ細message Spell</span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>required int32 id = 1;</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>optional int32 buffId = 2 [ref = "Buff.id"];</span></div><div><span style="font-size: 12px;">}</span></div><div><span style="font-size: 12px;"><br /></span></div><div><span style="font-size: 12px;">message Buff</span></div><div><span style="font-size: 12px;">{</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>required int32 id = 1 [ref = "Spell.buffId"];</span></div><div><span style="font-size: 12px;"><span style="white-space:pre"> </span>optional int32 time = 2;</span></div><div><span style="font-size: 12px;">}緙栬緫鍣ㄥ~鍐欎竴涓猙uff浼氬幓媯鏌ユ槸鍚︽湁鍏寵仈榪欎釜buff鐨勬妧鑳藉瓨鍦紝濉妧鑳界殑鏃跺欏鏋滃~浜哹uff涔熻寮哄埗閰嶇疆鐩稿簲鐨刡uff錛岃繖鏍峰ぇ澶у噺灝戜簡閰嶇疆閿欒錛岀瓥鍒掍粠姝や粠濉〃閿欒涓В鑴卞嚭鏉ャ? 絳栧垝鐖戒簡錛岀▼搴忓憳鐨勭埥榪樿繙鍚楋紵 浠栧ソ鎴戜篃濂斤紒 protobuf鍐欑殑涓涓畝鏄搊rm,鐩墠瀹炵幇浜唖elect鍜寀pdate錛屽叾瀹冪殑鍚庣畫澧炲姞錛屽師鐞嗘槸涓鏍風殑浠g爜鍦板潃錛?https://github.com/egametang/Egametang/tree/master/Cpp/Platform/Orm</span></div><img src ="http://www.shnenglu.com/egametang/aggbug/171063.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/egametang/" target="_blank">鍞愯瘲</a> 2012-04-12 12:09 <a href="http://www.shnenglu.com/egametang/archive/2012/04/12/171063.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.kygg.net.cn" target="_blank">国产91久久综合</a>| <a href="http://www.5o42i9.cn" target="_blank">精品久久久久久国产</a>| <a href="http://www.lueyi.com.cn" target="_blank">久久免费视频一区</a>| <a href="http://www.kinhi.cn" target="_blank">久久青青色综合</a>| <a href="http://www.sfsqw.cn" target="_blank">久久精品人人做人人妻人人玩</a>| <a href="http://www.uzri.cn" target="_blank">久久久一本精品99久久精品66 </a>| <a href="http://www.17wgame.cn" target="_blank">亚洲欧美伊人久久综合一区二区</a>| <a href="http://www.voos.org.cn" target="_blank">欧美日韩精品久久久免费观看</a>| <a href="http://www.iwck.cn" target="_blank">久久人人爽人人爽人人片av高请</a>| <a href="http://www.odostudio.cn" target="_blank">国产成人综合久久综合</a>| <a href="http://www.niguoyi.cn" target="_blank">欧美国产成人久久精品</a>| <a href="http://www.seowiki.com.cn" target="_blank">久久综合给合久久国产免费</a>| <a href="http://www.buchaqian.org.cn" target="_blank">久久精品一区二区国产</a>| <a href="http://www.girlsp.cn" target="_blank">久久人妻AV中文字幕</a>| <a href="http://www.wubaili.com.cn" target="_blank">72种姿势欧美久久久久大黄蕉</a>| <a href="http://www.bqtao.cn" target="_blank">久久夜色精品国产</a>| <a href="http://www.sh-ar.cn" target="_blank">久久99免费视频</a>| <a href="http://www.zhijin168.com.cn" target="_blank">国产精品久久久久久久app</a>| <a href="http://www.jytextile.cn" target="_blank">日本福利片国产午夜久久</a>| <a href="http://www.rytaoshumiao.cn" target="_blank">无码人妻少妇久久中文字幕蜜桃</a>| <a href="http://www.y7816.cn" target="_blank">韩国三级中文字幕hd久久精品</a>| <a href="http://www.guidegogo.cn" target="_blank">亚洲中文字幕久久精品无码喷水</a>| <a href="http://www.quheitou.net.cn" target="_blank">国产成人精品久久综合</a>| <a href="http://www.szltw.cn" target="_blank">国产精品无码久久久久久</a>| <a href="http://www.clkj168.cn" target="_blank">久久婷婷色综合一区二区</a>| <a href="http://www.epuda.cn" target="_blank">狠狠精品久久久无码中文字幕</a>| <a href="http://www.yk999.cn" target="_blank">国内精品伊人久久久久av一坑</a>| <a href="http://www.9258bbs.cn" target="_blank">怡红院日本一道日本久久</a>| <a href="http://www.wwwh0930com.cn" target="_blank">亚洲狠狠婷婷综合久久蜜芽 </a>| <a href="http://www.5678121.cn" target="_blank">亚洲色婷婷综合久久</a>| <a href="http://www.woyaopeizi.cn" target="_blank">久久久人妻精品无码一区</a>| <a href="http://www.jlife-pal.cn" target="_blank">91精品国产91久久久久久</a>| <a href="http://www.qenw.cn" target="_blank">嫩草影院久久99</a>| <a href="http://www.yhlj.net.cn" target="_blank">国产精品久久久久9999</a>| <a href="http://www.hanshigu.cn" target="_blank">国内精品伊人久久久久av一坑</a>| <a href="http://www.dygdgs.cn" target="_blank">人妻精品久久久久中文字幕一冢本</a>| <a href="http://www.hdv1p7.cn" target="_blank">亚洲美日韩Av中文字幕无码久久久妻妇 </a>| <a href="http://www.dnn.org.cn" target="_blank">久久一区二区三区免费</a>| <a href="http://www.1122sw.cn" target="_blank">久久久精品日本一区二区三区</a>| <a href="http://www.eu0i.cn" target="_blank">国产精品VIDEOSSEX久久发布</a>| <a href="http://www.xsvt.cn" target="_blank">久久国产精品久久</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>