ServiceHelper.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. using Newtonsoft.Json;
  2. using Newtonsoft.Json.Linq;
  3. using PDF_Master.Properties;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Management;
  9. using System.Net;
  10. using System.Runtime.InteropServices;
  11. using System.Security.Cryptography;
  12. using System.Text;
  13. using System.Threading.Tasks;
  14. namespace PDF_Master.Helper
  15. {
  16. /// <summary>
  17. /// 注册登陆相关的工具类
  18. /// </summary>
  19. ///
  20. public static class ServiceHelper
  21. {
  22. public static bool IsLogin=false;
  23. public static string ALLPassword = "";
  24. public static string access_token = "";
  25. public static string outemail = "";
  26. public static string outcode = "";
  27. public static string outregister = "";
  28. public static string outlogin = "";
  29. public static string code = "";
  30. public static string okcode = "";
  31. public static string remsg = "";
  32. public static string state = "";
  33. public static string AppCode = "com.brother.pdfreaderprofree.windows";
  34. public static string RequestHost = "http://139.196.160.101:8081";
  35. //验证邮箱
  36. public static string OKemailUrl = "/pdf-office-sso/auth/validUser";
  37. //验证验证码
  38. public static string OKcodeUrl = "/pdf-office-sso/auth/isEmailCodeValid";
  39. //发送验证码
  40. public static string GetcodeUrl = "/pdf-office-sso/auth/getVerifyCode";
  41. //注册邮箱
  42. public static string registerUrl = "/pdf-office-sso/auth/emailRegister";
  43. //登录
  44. public static string LoginUrl = "/pdf-office-sso/auth/emailLogin";
  45. //登出
  46. public static string LogoutUrl = "/pdf-office-sso/user/logout";
  47. //注销
  48. public static string UseroutUrl = "/pdf-office-sso/user/logOffForUser";
  49. //重置密码
  50. public static string RebirthUrl = "/pdf-office-sso/auth/resetPassword";
  51. //获取用户信息
  52. public static string GetUserUrl = "/pdf-office-sso/user/me";
  53. /// <summary>
  54. /// 用于检查网络是否可以连接互联网,true表示连接成功,false表示连接失败
  55. /// </summary>
  56. /// <returns></returns>
  57. [DllImport("wininet.dll")]
  58. private extern static bool InternetGetConnectedState(int Description, int ReservedValue);
  59. public static bool IsConnectInternet()
  60. {
  61. int Description = 0;
  62. return InternetGetConnectedState(Description, 0);
  63. }
  64. private static string computerInfo;
  65. /// <summary>
  66. /// 电脑品牌信息
  67. /// </summary>
  68. public static string ComputerInfo
  69. {
  70. get {
  71. if (computerInfo == null)
  72. {
  73. computerInfo = GetComputerInfo();
  74. }
  75. return computerInfo;
  76. }
  77. set { computerInfo = value; }
  78. }
  79. private static string systemInfo;
  80. /// <summary>
  81. /// 系统信息
  82. /// </summary>
  83. public static string SystemInfo
  84. {
  85. get
  86. {
  87. if (systemInfo == null)
  88. {
  89. systemInfo = GetSystemInfo();
  90. }
  91. return systemInfo;
  92. }
  93. set { systemInfo = value; }
  94. }
  95. private static string GetSystemInfo()
  96. {
  97. try
  98. {
  99. string s = "";
  100. SelectQuery sq = new SelectQuery("Win32_OperatingSystem");
  101. ManagementObjectSearcher mos = new ManagementObjectSearcher(sq);
  102. ManagementObjectCollection moc = mos.Get();
  103. foreach (ManagementObject mo in moc)
  104. {
  105. s = mo.Properties["Version"].Value.ToString();
  106. }
  107. moc.Dispose();
  108. sq = null;
  109. return s;
  110. }
  111. catch { return ""; }
  112. }
  113. private static string GetComputerInfo()
  114. {
  115. try
  116. {
  117. string s = "";
  118. System.Windows.Controls.TextBox text = new System.Windows.Controls.TextBox();
  119. SelectQuery sq = new SelectQuery("Win32_ComputerSystem");
  120. ManagementObjectSearcher mos = new ManagementObjectSearcher(sq);
  121. ManagementObjectCollection moc = mos.Get();
  122. foreach (ManagementObject mo in moc)
  123. {
  124. s = mo.Properties["Manufacturer"].Value + " " + mo.Properties["Model"].Value;
  125. }
  126. moc.Dispose();
  127. sq = null;
  128. return s;
  129. }
  130. catch { return ""; }
  131. }
  132. /// <summary>
  133. /// 操作系统生成的UUID,用于获取虚拟机用户的设备识别码
  134. /// </summary>
  135. /// <returns></returns>
  136. public static string GetUUID()
  137. {
  138. string systemId = null;
  139. using (ManagementObjectSearcher mos = new ManagementObjectSearcher("select * from Win32_ComputerSystemProduct"))
  140. {
  141. foreach (var item in mos.Get())
  142. {
  143. systemId = item["UUID"].ToString();
  144. }
  145. }
  146. return systemId;
  147. }
  148. /// <summary>
  149. /// 主板编号
  150. /// </summary>
  151. /// <returns></returns>
  152. public static string GetBoardId()
  153. {
  154. var st = string.Empty;
  155. var mos = new ManagementObjectSearcher("Select * from Win32_BaseBoard");
  156. foreach (var o in mos.Get())
  157. {
  158. var mo = (ManagementObject)o;
  159. st = mo["SerialNumber"].ToString();
  160. }
  161. return st;
  162. }
  163. /// <summary>
  164. /// 获取设备唯一ID
  165. /// </summary>
  166. /// <returns></returns>
  167. public static string GetDeviceSerialNumber()
  168. {
  169. StringBuilder DeviceBuilder = new StringBuilder();
  170. bool IsVirtual = false;
  171. string boardId = GetBoardId();
  172. string uuid = GetUUID();
  173. //判断是否是虚拟机用户
  174. if (boardId.ToLower() == "" || boardId.ToLower() == "none")
  175. {
  176. if (string.IsNullOrEmpty(uuid) || uuid.ToLower() == "none")
  177. return string.Empty;
  178. else
  179. IsVirtual = true;
  180. }
  181. //真实机器用户 用主板id作为唯一识别码
  182. if (!IsVirtual)
  183. {
  184. DeviceBuilder.Append(boardId);
  185. }
  186. else
  187. {
  188. DeviceBuilder.Append(uuid);
  189. }
  190. MD5 md5 = MD5.Create();
  191. List<byte> charbytes = new List<byte>();
  192. foreach (char code in DeviceBuilder.ToString().ToArray())
  193. {
  194. charbytes.Add((byte)code);
  195. }
  196. byte[] md5Array = md5.ComputeHash(charbytes.ToArray());
  197. DeviceBuilder = new StringBuilder();
  198. foreach (var code in md5Array)
  199. {
  200. DeviceBuilder.Append(code.ToString("X2"));
  201. }
  202. return DeviceBuilder.ToString();
  203. }
  204. //超时同步为20秒
  205. public static String GetUser()
  206. {
  207. HttpWebResponse response = null;
  208. ServicePointManager.DefaultConnectionLimit = 200;
  209. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(RequestHost + GetUserUrl+"");
  210. request.Method = "Get";
  211. request.Headers.Add("Authorization", $"Bearer {Settings.Default.AppProperties.LoginToken}");
  212. request.ContentType = "text/html;charset=UTF-8";
  213. //request.Accept = "application/vnd.api+json;version=1";
  214. request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
  215. request.Timeout = 20000;
  216. request.ServicePoint.Expect100Continue = false;
  217. try
  218. {
  219. response = (HttpWebResponse)request.GetResponse();
  220. using (StreamReader reader = new StreamReader(response.GetResponseStream()))
  221. {
  222. string responseData = reader.ReadToEnd();
  223. Console.WriteLine(responseData);
  224. reader.Close();
  225. JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
  226. if (response != null)
  227. {
  228. response.Close();
  229. }
  230. if (request != null)
  231. {
  232. request.Abort();
  233. }
  234. Console.WriteLine(responseData);
  235. JToken jToken;
  236. if(jobject.TryGetValue("msg" ,out jToken)==false)
  237. {
  238. App.IsLogin = true;
  239. Settings.Default.UserDate.Email= jobject["email"].ToObject<string>().ToLower();
  240. App.mainWindowViewModel.Useremailchar = Settings.Default.UserDate.Email.Substring(0, 1);
  241. return "ture";
  242. }
  243. else
  244. {
  245. return "false";
  246. }
  247. }
  248. }
  249. catch
  250. {
  251. if (Settings.Default.AppProperties.LoginToken == "")
  252. return "No Token";
  253. else return "300";
  254. }
  255. }
  256. public static String Ok_email(string intemail,string validType)
  257. {
  258. HttpWebResponse response = null;
  259. ServicePointManager.DefaultConnectionLimit = 200;
  260. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(RequestHost + OKemailUrl);
  261. request.Method = "Post";
  262. request.ContentType = "application/json";
  263. //request.Accept = "application/vnd.api+json;version=1";
  264. request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
  265. request.Timeout = 20000;
  266. request.ServicePoint.Expect100Continue = false;
  267. StringWriter sw = new StringWriter();
  268. using (JsonWriter writer = new JsonTextWriter(sw))
  269. {
  270. writer.WriteStartObject();
  271. writer.WritePropertyName("appId");
  272. writer.WriteValue(16);
  273. writer.WritePropertyName("platformType");
  274. writer.WriteValue(0);
  275. writer.WritePropertyName("username");
  276. writer.WriteValue(intemail);
  277. writer.WritePropertyName("validType");
  278. writer.WriteValue(validType);
  279. writer.WriteEndObject();
  280. }
  281. try
  282. {
  283. string postBody = sw.ToString();
  284. using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))
  285. {
  286. writer.Write(postBody);
  287. writer.Close();
  288. }
  289. response = (HttpWebResponse)request.GetResponse();
  290. using (StreamReader reader = new StreamReader(response.GetResponseStream()))
  291. {
  292. string responseData = reader.ReadToEnd();
  293. Console.WriteLine(responseData);
  294. reader.Close();
  295. JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
  296. //outemail = jobject["msg"].ToObject<string>().ToLower();
  297. if (response != null)
  298. {
  299. response.Close();
  300. }
  301. if (request != null)
  302. {
  303. request.Abort();
  304. }
  305. return jobject["code"].ToObject<string>().ToLower();
  306. }
  307. }
  308. catch
  309. {
  310. return "300";
  311. }
  312. }
  313. //⑤报错
  314. public static void Get_code(string action, string email)
  315. {
  316. string post = $"?action={action}&appId=16&receiver={email}&type=0";
  317. HttpWebResponse response = null;
  318. ServicePointManager.DefaultConnectionLimit = 200;
  319. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(RequestHost + GetcodeUrl + post);
  320. request.Method = "Get";
  321. request.ContentType = "text/html;charset=UTF-8";
  322. //request.Accept = "application/vnd.api+json;version=1";
  323. request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
  324. request.Timeout = 20000;
  325. request.ServicePoint.Expect100Continue = false;
  326. try
  327. {
  328. response = (HttpWebResponse)request.GetResponse();
  329. using (StreamReader reader = new StreamReader(response.GetResponseStream()))
  330. {
  331. string responseData = reader.ReadToEnd();
  332. Console.WriteLine(responseData);
  333. reader.Close();
  334. JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
  335. if (response != null)
  336. {
  337. response.Close();
  338. }
  339. if (request != null)
  340. {
  341. request.Abort();
  342. }
  343. }
  344. }
  345. catch
  346. {
  347. }
  348. }
  349. public static String Ok_code(string email, string code, string type)
  350. {
  351. string post = $"?account={email}&code={code}&type={type}&appId=16";
  352. HttpWebResponse response = null;
  353. ServicePointManager.DefaultConnectionLimit = 200;
  354. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(RequestHost + OKcodeUrl + post);
  355. request.Method = "Get";
  356. request.ContentType = "text/html;charset=UTF-8";
  357. //request.Accept = "application/vnd.api+json;version=1";
  358. request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
  359. request.Timeout = 20000;
  360. request.ServicePoint.Expect100Continue = false;
  361. try
  362. {
  363. response = (HttpWebResponse)request.GetResponse();
  364. using (StreamReader reader = new StreamReader(response.GetResponseStream()))
  365. {
  366. string responseData = reader.ReadToEnd();
  367. Console.WriteLine(responseData);
  368. reader.Close();
  369. JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
  370. if (response != null)
  371. {
  372. response.Close();
  373. }
  374. if (request != null)
  375. {
  376. request.Abort();
  377. }
  378. return jobject["code"].ToObject<string>().ToLower();
  379. }
  380. }
  381. catch
  382. {
  383. return "300";
  384. }
  385. }
  386. public static String Register_email(string intemail, string intpassword, string intcode, string uuid)
  387. {
  388. HttpWebResponse response = null;
  389. ServicePointManager.DefaultConnectionLimit = 200;
  390. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(RequestHost + registerUrl);
  391. request.Method = "Post";
  392. request.ContentType = "application/json";
  393. //request.Accept = "application/vnd.api+json;version=1";
  394. request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
  395. request.Timeout = 20000;
  396. request.ServicePoint.Expect100Continue = false;
  397. StringWriter sw = new StringWriter();
  398. using (JsonWriter writer = new JsonTextWriter(sw))
  399. {
  400. writer.WriteStartObject();
  401. writer.WritePropertyName("appId");
  402. writer.WriteValue(16);
  403. writer.WritePropertyName("deviceSign");
  404. writer.WriteValue(uuid);
  405. writer.WritePropertyName("password");
  406. writer.WriteValue(intpassword);
  407. writer.WritePropertyName("platformType");
  408. writer.WriteValue(0);
  409. writer.WritePropertyName("username");
  410. writer.WriteValue(intemail);
  411. writer.WritePropertyName("verifyCode");
  412. writer.WriteValue(intcode);
  413. writer.WriteEndObject();
  414. }
  415. try
  416. {
  417. string postBody = sw.ToString();
  418. using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))
  419. {
  420. writer.Write(postBody);
  421. writer.Close();
  422. }
  423. response = (HttpWebResponse)request.GetResponse();
  424. using (StreamReader reader = new StreamReader(response.GetResponseStream()))
  425. {
  426. string responseData = reader.ReadToEnd();
  427. Console.WriteLine(responseData);
  428. reader.Close();
  429. JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
  430. if (response != null)
  431. {
  432. response.Close();
  433. }
  434. if (request != null)
  435. {
  436. request.Abort();
  437. }
  438. if (jobject["code"].ToObject<string>().ToLower() == "200")
  439. {
  440. App.IsLogin =true;
  441. access_token = jobject["result"]["access_token"].ToObject<string>().ToLower();
  442. Settings.Default.AppProperties.LoginToken = jobject["result"]["access_token"].ToObject<string>().ToLower();
  443. Settings.Default.Save();
  444. GetUser();
  445. }
  446. return jobject["code"].ToObject<string>().ToLower();
  447. }
  448. }
  449. catch
  450. {
  451. return "300";
  452. }
  453. }
  454. public static String Login(string intemail, string intpassword, string uuid)
  455. {
  456. string postBody = $"?appId=16&deviceSign={uuid}&email={intemail}&password={intpassword}&platformType=0";
  457. HttpWebResponse response = null;
  458. ServicePointManager.DefaultConnectionLimit = 200;
  459. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(RequestHost + LoginUrl + postBody);
  460. request.Method = "Post";
  461. request.ContentType = "application/x-www-form-urlencoded";
  462. //request.Accept = "application/vnd.api+json;version=1";
  463. request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
  464. request.Timeout = 20000;
  465. request.ServicePoint.Expect100Continue = false;
  466. try
  467. {
  468. response = (HttpWebResponse)request.GetResponse();
  469. using (StreamReader reader = new StreamReader(response.GetResponseStream()))
  470. {
  471. string responseData = reader.ReadToEnd();
  472. Console.WriteLine(responseData);
  473. reader.Close();
  474. JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
  475. if (response != null)
  476. {
  477. response.Close();
  478. }
  479. if (request != null)
  480. {
  481. request.Abort();
  482. }
  483. if (jobject["code"].ToObject<string>().ToLower() == "200")
  484. {
  485. App.IsLogin = true;
  486. access_token = jobject["result"]["access_token"].ToObject<string>().ToLower();
  487. Settings.Default.AppProperties.LoginToken = jobject["result"]["access_token"].ToObject<string>().ToLower();
  488. Settings.Default.Save();
  489. GetUser();
  490. }
  491. return jobject["code"].ToObject<string>().ToLower();
  492. }
  493. }
  494. catch
  495. {
  496. return "300";
  497. }
  498. }
  499. //⑤报错
  500. public static void Logout(string uuid)
  501. {
  502. string postBody = $"?deviceSign={uuid}&appId=16";
  503. HttpWebResponse response = null;
  504. ServicePointManager.DefaultConnectionLimit = 200;
  505. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(RequestHost + LogoutUrl + postBody);
  506. request.Method = "Post";
  507. request.Headers.Add("Authorization", $"Bearer {Settings.Default.AppProperties.LoginToken}");
  508. request.ContentType = "application/x-www-form-urlencoded";
  509. //request.Accept = "application/vnd.api+json;version=1";
  510. request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
  511. request.Timeout = 20000;
  512. request.ServicePoint.Expect100Continue = false;
  513. try
  514. {
  515. response = (HttpWebResponse)request.GetResponse();
  516. using (StreamReader reader = new StreamReader(response.GetResponseStream()))
  517. {
  518. string responseData = reader.ReadToEnd();
  519. Console.WriteLine(responseData);
  520. reader.Close();
  521. JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
  522. App.IsLogin = false;
  523. if (response != null)
  524. {
  525. response.Close();
  526. }
  527. if (request != null)
  528. {
  529. request.Abort();
  530. }
  531. }
  532. }
  533. catch
  534. {
  535. }
  536. }
  537. public static String Usergout(string code)
  538. {
  539. string postBody = $"?code={code}";
  540. HttpWebResponse response = null;
  541. ServicePointManager.DefaultConnectionLimit = 200;
  542. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(RequestHost + UseroutUrl + postBody);
  543. request.Method = "Post";
  544. request.Headers.Add("Authorization", $"Bearer {Settings.Default.AppProperties.LoginToken}");
  545. request.ContentType = "application/x-www-form-urlencoded";
  546. //request.Accept = "application/vnd.api+json;version=1";
  547. request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
  548. request.Timeout = 20000;
  549. request.ServicePoint.Expect100Continue = false;
  550. try
  551. {
  552. response = (HttpWebResponse)request.GetResponse();
  553. using (StreamReader reader = new StreamReader(response.GetResponseStream()))
  554. {
  555. string responseData = reader.ReadToEnd();
  556. Console.WriteLine(responseData);
  557. reader.Close();
  558. JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
  559. if (response != null)
  560. {
  561. response.Close();
  562. }
  563. if (request != null)
  564. {
  565. request.Abort();
  566. }
  567. return jobject["code"].ToObject<string>().ToLower();
  568. }
  569. }
  570. catch
  571. {
  572. return "300";
  573. }
  574. }
  575. public static String Rebirth(string intemail, string firstpassword, string secondPassword, string intcode)
  576. {
  577. HttpWebResponse response = null;
  578. ServicePointManager.DefaultConnectionLimit = 200;
  579. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(RequestHost + RebirthUrl);
  580. request.Method = "Post";
  581. request.ContentType = "application/json";
  582. //request.Accept = "application/vnd.api+json;version=1";
  583. request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
  584. request.Timeout = 20000;
  585. request.ServicePoint.Expect100Continue = false;
  586. StringWriter sw = new StringWriter();
  587. using (JsonWriter writer = new JsonTextWriter(sw))
  588. {
  589. writer.WriteStartObject();
  590. writer.WritePropertyName("account");
  591. writer.WriteValue(intemail);
  592. writer.WritePropertyName("appId");
  593. writer.WriteValue(16);
  594. writer.WritePropertyName("firstPassword");
  595. writer.WriteValue(firstpassword);
  596. writer.WritePropertyName("platformType");
  597. writer.WriteValue(0);
  598. writer.WritePropertyName("secondPassword");
  599. writer.WriteValue(secondPassword);
  600. writer.WritePropertyName("verifyCode");
  601. writer.WriteValue(intcode);
  602. writer.WriteEndObject();
  603. }
  604. try
  605. {
  606. string postBody = sw.ToString();
  607. using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))
  608. {
  609. writer.Write(postBody);
  610. writer.Close();
  611. }
  612. response = (HttpWebResponse)request.GetResponse();
  613. using (StreamReader reader = new StreamReader(response.GetResponseStream()))
  614. {
  615. string responseData = reader.ReadToEnd();
  616. Console.WriteLine(responseData);
  617. reader.Close();
  618. JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
  619. if (response != null)
  620. {
  621. response.Close();
  622. }
  623. if (request != null)
  624. {
  625. request.Abort();
  626. }
  627. return jobject["code"].ToObject<string>().ToLower();
  628. }
  629. }
  630. catch
  631. {
  632. return "300";
  633. }
  634. }
  635. }
  636. }