锘??xml version="1.0" encoding="utf-8" standalone="yes"?>中文字幕一区二区三区久久网站,精品久久久久久久中文字幕,久久久久久久精品妇女99http://m.shnenglu.com/egametang/zh-cnTue, 06 May 2025 20:28:17 GMTTue, 06 May 2025 20:28:17 GMT60C++ protobuf 涓嶄粎浠呮槸搴忓垪鍖栤︹?/title><link>http://m.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://m.shnenglu.com/egametang/archive/2012/04/12/171063.html</guid><wfw:comment>http://m.shnenglu.com/egametang/comments/171063.html</wfw:comment><comments>http://m.shnenglu.com/egametang/archive/2012/04/12/171063.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://m.shnenglu.com/egametang/comments/commentRss/171063.html</wfw:commentRss><trackback:ping>http://m.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://m.shnenglu.com/egametang/aggbug/171063.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/egametang/" target="_blank">鍞愯瘲</a> 2012-04-12 12:09 <a href="http://m.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://m.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.qwkhd.cn" target="_blank">久久夜色精品国产噜噜亚洲AV</a>| <a href="http://www.aoshidun.com.cn" target="_blank">91精品国产91久久综合</a>| <a href="http://www.qhd33.cn" target="_blank">久久久久国产一区二区三区</a>| <a href="http://www.baobaonin.cn" target="_blank">久久国产成人</a>| <a href="http://www.laopaiwaihui.cn" target="_blank">久久精品国产久精国产果冻传媒 </a>| <a href="http://www.123822.cn" target="_blank">亚洲精品美女久久久久99小说 </a>| <a href="http://www.timng.cn" target="_blank">国产成人精品久久一区二区三区</a>| <a href="http://www.g753.cn" target="_blank">色综合久久88色综合天天</a>| <a href="http://www.xyjsj88.com.cn" target="_blank">久久久久久青草大香综合精品</a>| <a href="http://www.dgwhmnk.cn" target="_blank">99精品久久精品一区二区</a>| <a href="http://www.whchangxin.com.cn" target="_blank">2021久久国自产拍精品</a>| <a href="http://www.t24196.cn" target="_blank">青青热久久国产久精品</a>| <a href="http://www.ctihf.com.cn" target="_blank">国内精品久久久久影院日本 </a>| <a href="http://www.laoji2004.cn" target="_blank">久久99国产精品99久久</a>| <a href="http://www.sf2777.cn" target="_blank">伊人色综合久久天天网</a>| <a href="http://www.90734.com.cn" target="_blank">久久99国产精一区二区三区</a>| <a href="http://www.27cv.cn" target="_blank">久久妇女高潮几次MBA</a>| <a href="http://www.7cfw.cn" target="_blank">亚洲精品成人久久久</a>| <a href="http://www.floodlighting.cn" target="_blank">国产精品女同久久久久电影院</a>| <a href="http://www.bnwpw.cn" target="_blank">国内精品久久国产</a>| <a href="http://www.odctb.cn" target="_blank">久久国产热这里只有精品</a>| <a href="http://www.joyq.com.cn" target="_blank">国产精品一久久香蕉国产线看</a>| <a href="http://www.lnboxue.cn" target="_blank">亚洲国产成人精品91久久久 </a>| <a href="http://www.qysf88.cn" target="_blank">国内精品欧美久久精品</a>| <a href="http://www.szac.org.cn" target="_blank">国产精品99精品久久免费</a>| <a href="http://www.hefxxw.cn" target="_blank">久久只这里是精品66</a>| <a href="http://www.qcb8.cn" target="_blank">久久毛片免费看一区二区三区</a>| <a href="http://www.grcooling.com.cn" target="_blank">精品久久久久久国产潘金莲</a>| <a href="http://www.hfhyzt.cn" target="_blank">久久亚洲AV无码精品色午夜麻豆</a>| <a href="http://www.cn1s.cn" target="_blank">日本久久中文字幕</a>| <a href="http://www.laobianjing.cn" target="_blank">久久久免费观成人影院</a>| <a href="http://www.jxjkyt.cn" target="_blank">色噜噜狠狠先锋影音久久</a>| <a href="http://www.jrbjh.cn" target="_blank">91精品国产91久久久久久青草</a>| <a href="http://www.950aw.cn" target="_blank">久久久av波多野一区二区</a>| <a href="http://www.qancen.cn" target="_blank">中文字幕久久波多野结衣av</a>| <a href="http://www.4000261688.cn" target="_blank">亚洲伊人久久综合影院</a>| <a href="http://www.huizegufen.cn" target="_blank">亚洲第一永久AV网站久久精品男人的天堂AV </a>| <a href="http://www.mengdie.net.cn" target="_blank">麻豆AV一区二区三区久久 </a>| <a href="http://www.52maila.cn" target="_blank">久久高清一级毛片</a>| <a href="http://www.shopzoom.cn" target="_blank">久久亚洲2019中文字幕</a>| <a href="http://www.weijiawu.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>