asp.netajax與jquery和bootstrap的無刷新完美實現

来源:https://www.cnblogs.com/zrprj/archive/2019/04/21/10744605.html
-Advertisement-
Play Games

20190421asp.netajax與jquery和bootstrap的無刷新完美實現 設計代碼和後臺代碼中重要部分加粗和深色以及字型大小加大。 設計前臺代碼: <%@ Page Title="添加/修改商家" Language="C#" MasterPageFile="~/Site_cg007.Ma ...


20190421asp.netajaxjquerybootstrap的無刷新完美實現

設計代碼和後臺代碼中重要部分加粗和深色以及字型大小加大。

設計前臺代碼:

<%@ Page Title="添加/修改商家" Language="C#" MasterPageFile="~/Site_cg007.Master" AutoEventWireup="true" 

    CodeBehind="web_cg007.aspx.cs" Inherits="jfydxfjz.web_cg007" EnableEventValidation="false" %>

 

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <title>開發者</title>

 

   <script type="text/javascript" src="scripts/bootstrap_v30/jquery/jquery-

 

1.8.3.min.js"></script>

  <script type="text/javascript" src="scripts/layer/layer.js"></script>

 <script type="text/javascript" src="scripts/bootstrap_v30/bootstrap/js/bootstrap.min.js"></script>

 <link href="StyleSheet_dn.css" rel="stylesheet" type="text/css" />

 <link href="scripts/bootstrap_v30/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />

 

    <style type="text/css"> 

        body{color:#686868;}

        @media all and (max-width:768px){

            p{font-size:12px;}

            h2{font-size:16px;}

            h3{font-size:14px;}

            li{font-size:14px;margin-left:30px;}

            .myimg{width:50%;}

        }

        /*模態視窗取消背景變暗的效果

        .modal-backdrop-zrp

        {

          opacity: 0 !important;

          filter: alpha(opacity=0) !important;

 

        }

        */

    </style>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:ScriptManager ID="ScriptManager1" runat="server">

             </asp:ScriptManager>

     <div class="container">

         <div class="row">

             <div class="col-md-4 col-xl-12 text-center">

                           <asp:UpdateProgress ID="UpdateProgress_gly" runat="server" AssociatedUpdatePanelID="UpdatePanel_sjgl">

                             <ProgressTemplate><asp:Image ID="Image_gly"

                                   CssClass="myimg" runat="server" ImageUrl="~/images/progress.gif" /></ProgressTemplate>

                           </asp:UpdateProgress>

            </div>

          </div>

    </div>

 

  

      <asp:UpdatePanel ID="UpdatePanel_sjgl" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">

        <ContentTemplate>

              <div class="container">

          <center>

                 

                 <table class="nav-justified">

                     <tr>

                         <td style="text-align:left;">

                            <input type="text" runat="server" id="tbx_kfz_sjqq" placeholder="商家名稱或QQ"   />

                         </td>

                         <td>

                              <asp:Button ID="btn_kfz_cxsjqq" runat="server"  Text="查詢" CssClass="btn_dn" OnClick="btn_kfz_cxsjqq_Click"  />

                         </td>

                        <td>

                               <button class="btn-primary" data-toggle="modal" data-target="#tjsjmodal" id="btn_html_tj">添加</button>

                         </td>

                         <td>

                            

                               <asp:Button ID="btn_kfz_tjgly" runat="server"  Text="添加管理員"  CssClass="btn_dn" OnClick="btn_kfz_tjgly_Click"  />

                         </td>

                     </tr>

                     <tr style="text-align:center">

                         <td colspan="4" style="padding-top:5px;text-align:center">

                              <!--採用自帶的分頁功能-->

                            <center>

                             <asp:GridView ID="GridView_sjgl" runat="server" Width="100%" AllowPaging="True" AutoGenerateColumns="False" CssClass="grid_dn" DataKeyNames="ID" HorizontalAlign="Center" OnRowCommand="GridView_sjgl_RowCommand" OnRowDataBound="GridView_sjgl_RowDataBound" OnPageIndexChanging="GridView_sjgl_PageIndexChanging">

                                 <Columns>

                                     <asp:BoundField DataField="ID" HeaderText="編號">

                                     <HeaderStyle CssClass="header_dn" />

                                     <ItemStyle HorizontalAlign="Left" />

                                     </asp:BoundField>

                                     <asp:BoundField DataField="Dwmc" HeaderText="商家">

                                     <HeaderStyle CssClass="header_dn" />

                                     <ItemStyle HorizontalAlign="Left" />

                                     </asp:BoundField>

                                     <asp:BoundField DataField="sqbh" HeaderText="授權令">

                                     <HeaderStyle CssClass="header_dn" />

                                     <ItemStyle HorizontalAlign="Left" />

                                     </asp:BoundField>

                                     <asp:TemplateField HeaderText="試用">

                                         <HeaderStyle CssClass="header_dn" />

                                         <ItemTemplate>

                                           <asp:Button ID="btn_jk_sy" runat="server" Text="試用"   CssClass="btn"

                                                CommandArgument='<%# Eval("ID") %>'  CommandName="cmn_jz_sy" /> 

                                         </ItemTemplate>

                                     </asp:TemplateField>

                                     <asp:TemplateField HeaderText="註冊">

                                         <HeaderStyle CssClass="header_dn" />

                                         <ItemTemplate>

                                           <asp:Button ID="btn_jk_zc" runat="server" Text="註冊"   CssClass="btn"

                                                CommandArgument='<%# Eval("ID") %>'  CommandName="cmn_jz_zc" /> 

                                         </ItemTemplate>

                                     </asp:TemplateField>

                                 </Columns>

                                 <RowStyle CssClass="row_dn" />

                                 <HeaderStyle CssClass="header_dn" />

                                 <PagerSettings  FirstPageText="首頁" LastPageText="尾頁" Mode="NextPreviousFirstLast" NextPageText="下頁" PreviousPageText="上頁" />

                                 <PagerStyle HorizontalAlign="Center" />

                                 <SelectedRowStyle CssClass="selectrow_dn" />

                             </asp:GridView>

                            </center>

                         </td>

                     </tr>

                    

                 </table>

              </center>

    </div>

            <!--添加商家彈出視窗:#tjsjmodal-->

            <div id="tjsjmodal" class="modal fade bs-example-modal-sm" data-backdrop="static">

                <div class="modal-dialog modal-sm">

                    <div class="modal-content">

                        <div class="modal-header">

                           <button class="close" data-dismiss="modal">×</button>

                            <h4 class="modal-title">添加商家</h4>

                        </div>

                        <div class="modal-body">

                            

                                 <div class="form-group">

                                    商家名稱

                                    <input type="text" runat="server" id="tbx_sjmc" placeholder="輸入商家名稱"  />

                                </div>

                                 <div class="form-group">

                                    授權口令

                                    <input type="text" runat="server" id="tbx_sqkl" placeholder="輸入或者空白" />

                                </div>

                                <div class="form-group">

                                      QQ

                                    <input type="text" runat="server" id="tbx_lxqq" placeholder="輸入QQ號" />

                                </div>

                                <div class="form-group">

                                   <asp:Label ID="lbl_ts" runat="server" ForeColor="Red" Font-Size="Large" />

                                </div>

                        </div>

                        <div class="modal-footer">

                            <button class="btn btn-default" data-dismiss="modal">關閉</button> 

                            <asp:Button ID="btn_gb" CssClass="btn" Text="關閉" runat="server" OnClick="btn_gb_Click" Visible="false" />

                            <asp:Button ID="btn_tjsj" CssClass="btn" Text="添加" runat="server" OnClick="btn_tjsj_Click" />

                        </div>

                    </div>

                </div>

            </div>

 

        </ContentTemplate>

          <Triggers>

            

          </Triggers>

    </asp:UpdatePanel>

    

</asp:Content>

 

後臺代碼:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Data;

using System.Data.SqlClient;

 

namespace jfydxfjz

{

    public partial class web_cg007 : System.Web.UI.Page

    {

        private jf_cyclxfjzEntities sjklj = new jf_cyclxfjzEntities();//資料庫連接

        private webncxk_class gj = new webncxk_class();//加解密工具

        protected void Page_Load(object sender, EventArgs e)

        {

            //加入用戶登錄認證判斷---處理中

            cy_kfz db_kfz = Session["E1DAD727864"] as cy_kfz;

            if (db_kfz == null) //不是開發者

            {

                this.Response.Redirect("~/Default.aspx");

            }

 

            if (!Page.IsPostBack) //數據控制項綁定數據,必須放入這裡,不然每次對數據控制項的操作都無效

            {

                this.GridView_sjgl.DataSource = sjklj.cy_sqdw.OrderByDescending(aa => aa.ID);

                this.GridView_sjgl.DataBind();

            }

 

        }

 

        protected void GridView_sjgl_RowCommand(object sender, GridViewCommandEventArgs e)

        {

            try

            {

                

                if (e.CommandName == "cmn_jz_sy") //單擊了試用按鈕

                {

                    int id = int.Parse(e.CommandArgument.ToString());

 

                    //定位記錄

                    var cxsy = from aa in sjklj.cy_sqdw

                               where aa.ID == id

                               select aa;

                    //授權口令生成器

                    //生成隨機試用口令

                    Random sjs = new Random(DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute +

                    DateTime.Now.Second + DateTime.Now.Millisecond + 20316);

                    int scsjs = sjs.Next(10000, 99999);

                    string sqkl = "a" + scsjs.ToString();//試用口令

                    //沒有加密的口令:

                    string ywkl=sqkl;

                    sqkl = webncxk_class.Encrypt(sqkl, webncxk_class.salt, webncxk_class.jmmy);//加密,自動生成的

                    if (string.IsNullOrWhiteSpace(cxsy.First().sqbh))//沒有加入試用口令,正式使用預設30年

                    {

                        cxsy.First().sqbh = sqkl;

                        sjklj.SaveChanges();

                        //重新綁定

                        (e.CommandSource as Button).Text = ywkl;

                        this.UpdatePanel_sjgl.Update();//有條件更新,而且子控制項

                       // aspnetajaxjavascript.layermsg(this.UpdatePanel_sjgl, "顧客非同步刷新");

                        return;

                    }

                    else

                    {

                        //對口令進行解密

                        string kl = cxsy.First().sqbh.Trim();

                        kl = gj.Decrypt(kl, webncxk_class.salt, webncxk_class.jmmy);

                        if (kl.Contains("a"))

                        {

                            this.UpdatePanel_sjgl.Update();//有條件更新,而且子控制項

                            aspnetajaxjavascript.layermsg(this.UpdatePanel_sjgl, "已經是試用了");

                            return;

                        }

                        else

                        {

                            cxsy.First().sqbh = sqkl;

                            sjklj.SaveChanges();

                            //重新綁定

                            (e.CommandSource as Button).Text = ywkl;

                            this.UpdatePanel_sjgl.Update();//有條件更新,而且子控制項

                            aspnetajaxjavascript.layermsg(this.UpdatePanel_sjgl, "加入試用成功!");

 

                            return;

                        }

 

                    }

                     

                }

 

                //註冊

                if (e.CommandName == "cmn_jz_zc") //單擊了註冊

                {

                    int id = int.Parse(e.CommandArgument.ToString());

                    //定位記錄

                    var cxsy = from aa in sjklj.cy_sqdw

                               where aa.ID == id

                               select aa;

                    //授權口令生成器

                    //生成隨機正式口令

                    Random sjs = new Random(DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute +

                    DateTime.Now.Second + DateTime.Now.Millisecond + 20316);

                    int scsjs = sjs.Next(10000, 99999);

                    string sqkl = "b" + scsjs.ToString();//註冊口令

                    //沒有加密的口令:

                    string ywkl = sqkl;

                    sqkl = webncxk_class.Encrypt(sqkl, webncxk_class.salt, webncxk_class.jmmy);//加密,自動生成的

 

                    if (string.IsNullOrWhiteSpace(cxsy.First().sqbh))//沒有加入正式口令,正式使用預設30年

                    {

                        cxsy.First().sqbh = sqkl;

                        sjklj.SaveChanges();

                        //重新綁定

                        (e.CommandSource as Button).Text = ywkl;

                        this.UpdatePanel_sjgl.Update();//有條件更新,而且子控制項

                        // aspnetajaxjavascript.layermsg(this.UpdatePanel_sjgl, "顧客非同步刷新");

                        return;

                    }

 

 

                    //對口令進行解密

                    string kl = cxsy.First().sqbh.Trim();

                    kl = gj.Decrypt(kl, webncxk_class.salt, webncxk_class.jmmy);

                    if (kl.Contains("b"))

                    {

                        this.UpdatePanel_sjgl.Update();//有條件更新,而且子控制項

                        aspnetajaxjavascript.layermsg(this.UpdatePanel_sjgl, "已經註冊成功!");

                        return;

                    }

                    else

                    {

                        cxsy.First().sqbh = sqkl;

                        cxsy.First().yxq = DateTime.Now.Year + 30;

                        sjklj.SaveChanges();

                        //重新綁定

                        (e.CommandSource as Button).Text = ywkl;

                        this.UpdatePanel_sjgl.Update();//有條件更新,而且子控制項

                        // aspnetajaxjavascript.layermsg(this.UpdatePanel_sjgl, "顧客非同步刷新");

                        return;

                    }

                }

            

            }

            catch (Exception err)

            {

                this.UpdatePanel_sjgl.Update();//有條件更新,而且子控制項

                aspnetajaxjavascript.layermsg(this.UpdatePanel_sjgl, "錯誤:"+err.Message);

            }

         

        }

 

        protected void btn_kfz_cxsjqq_Click(object sender, EventArgs e)

        {

           // this.UpdatePanel_sjgl.Update();

           // aspnetajaxjavascript.layermsg(this.UpdatePanel_sjgl, "測試查詢!");

            try

            {

                string cxtj = this.tbx_kfz_sjqq.Value.Trim();

                if (cxtj == string.Empty)

                {

                   

                    this.UpdatePanel_sjgl.Update();//有條件更新,而且子控制項

                    aspnetajaxjavascript.layermsg(this.UpdatePanel_sjgl, "請輸入學校名稱或者QQ號!");

                    return;

                }

                var cxxx = (from aa in sjklj.cy_sqdw

                            where aa.Dwmc.Contains(cxtj) || aa.qq.Contains(cxtj)

                            select aa).OrderByDescending(bb => bb.ID);

                this.GridView_sjgl.DataSource = cxxx;

                this.GridView_sjgl.DataBind();

                this.UpdatePanel_sjgl.Update();//有條件更新,而且子控制項

            }

            catch

            {

 

            }

        }

 

        protected void GridView_sjgl_RowDataBound(object sender, GridViewRowEventArgs e)

        {

            if (e.Row.RowType == DataControlRowType.DataRow)

            {

 

                try

                {

 

                    int id = int.Parse(this.GridView_sjgl.DataKeys[e.Row.RowIndex].Value.ToString());//獲取主鍵

                    //獲取加密的授權口令

                    string sqkl = sjklj.cy_sqdw.Where(aa => aa.ID == id).First().sqbh;

                    sqkl = gj.Decrypt(sqkl, webncxk_class.salt, webncxk_class.jmmy);//解密

                    // this.Gv_xx.Rows[e.Row.RowIndex].Cells[2].Text = sqkl;//出錯,索引找不到

                    e.Row.Cells[2].Text = sqkl;

                }

                catch 

                {

                   

                }

 

            }

 

        }

 

        protected void GridView_sjgl_PageIndexChanging(object sender, GridViewPageEventArgs e)

        {

            this.GridView_sjgl.PageIndex = e.NewPageIndex;

            this.GridView_sjgl.DataSource = sjklj.cy_sqdw.OrderByDescending(aa => aa.ID);

            this.GridView_sjgl.DataBind();

            //刷新

            this.UpdatePanel_sjgl.Update();

        }

 

        protected void btn_kfz_tjgly_Click(object sender, EventArgs e)

        {

            try

            {

                //123加密為初始密碼

                string jbmm = webncxk_class.Encrypt("123", webncxk_class.salt, webncxk_class.jmmy);

                //查看管理員是否還沒有添加,查找在管理員表中沒有的xk_sqdw記錄

 

                var cxmygly = from aa in sjklj.cy_sqdw

                              where !sjklj.admin_user.Any(bb => bb.dwid == aa.ID)

                              select aa;//這個方法很不錯

                Random sjs = new Random(DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute +

                   DateTime.Now.Second + DateTime.Now.Millisecond + 20316);

               

                foreach (var kk in cxmygly)

                {

                    int scsjs = sjs.Next(1000, 9999);

                    admin_user tj_gly = new admin_user

                    {

                        dwid = kk.ID,

                        Yhm =kk.ID.ToString()+"a"+scsjs.ToString(),//按照a分割出dwid

                        Mm = jbmm

                    };

                    sjklj.admin_user.AddObject(tj_gly);

                }

                sjklj.SaveChanges();

                //layeriujq.Msg("管理員添加完成", "6", "3000", this.Page);

                this.UpdatePanel_sjgl.Update();//有條件更新,而且子控制項

                aspnetajaxjavascript.layermsg(this.UpdatePanel_sjgl, "管理員添加完成!");

                return;

               

            }

            catch

            {

 

            }

        }

 

       

 

        protected void btn_tjsj_Click(object sender, EventArgs e)

        {

            try

            {

                //只需要商家名稱和QQ號

                string sjmc = this.tbx_sjmc.Value.Trim();

                string qq = this.tbx_lxqq.Value.Trim();

                string sqxx = this.tbx_sqkl.Value.Trim();

                

                //生成隨機試用口令

                Random sjs = new Random(DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute +

                DateTime.Now.Second + DateTime.Now.Millisecond + 20316);

                int scsjs = sjs.Next(10000, 99999);

                string sqkl = "a" + scsjs.ToString();//試用口令

       

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 1.基礎準備 1. ubuntu 18.04 2. docker version 18.09 3. netcore 2.1 2.簡介 自從netcore支持跨平臺之後,以及現在很多公司都是採用容器化部署,今天在比較空閑的時候學習了一下。 3.使用 3.1 創建netcore 項目 ,選擇api程式完 ...
  • 最近有一個雲伺服器和資料庫的遷移任務,踩坑爬坑無數次,覺得必須要記錄一下。大家瓜子花生準備好,聽我慢慢講故事#手動笑哭#。 故事背景 公司是做電商業務的,在天貓有幾家旗艦店數據量也很大。阿裡有一個稱為聚石塔的平臺,專門給這些ISV提供各種雲資源,強制綁定了一些業務,原本我們在聚石塔中有一臺ECS和一 ...
  • 一.StackExchange.Redis StackExchange.Redis是由Stack Overflow開發的C#語言Redis客戶端,使用廣泛,本文針對 StackExchange.Redis 進一步擴展使之支持實體 二. 使用Demo 1. 安裝 2. Demo 移步我的項目https ...
  • 建造者模式簡介 建造者模式又稱生成器模式,它將一個複雜對象的構建與它的表示分離,使得同樣的構建過程可以創建不同的表示。這就要求,我們所要處理的對象必須要有非常強的結構化特征,對於開發人員而言,需要抽象出一般的結構化介面出來,方便進行構建工作。 作為一名碼農,最難得的應該就是找對象了,就算勉強找到了, ...
  • 又是一年金三銀四,應該不少小伙伴開始摩拳擦掌準備換個好工作了吧?想要在尋找工作中突出自我,穩穩在大浪淘沙的職場中立足,掌握一些專業工具是很有必要的,今天要給職場人分享投遞簡歷如何選擇安全、便捷的電子郵箱三大法則,作為能力不差、想要變成更好自己的你,值得花2分鐘瞭解一下。 電子郵件的安全性為何如此重要 ...
  • WPF窗體中建有一個DataGrid,運行後修改各行數據,通過Update方法更新後臺資料庫。發現在資料庫中,其中一列FAcctID(文本型)每次都會變為0,還有一列FDebit(貨幣型)不能更新,其他列則沒有問題。主要代碼如下: 排查了好幾個小時,對Xaml代碼綁定、Parameter參數進行修改 ...
  • 在平常得編程中,經常會用到觀察者模式,屬於使用場景很頻繁得設計模式之一。 學習設計模式得目的,知道在何種場景中使用合適得設計模式。 以下我將從現實得場景出發去講設計模式得運用,從比較中去看出優勢 1.觀察者模式得定義 目標狀態發生變化得時候把他得信息通知給註冊過得觀察者們。 當一個對象改變需要同時通 ...
  • 問題描述 在傳統的基於 .NET Framework 的 WPF 程式中,我們可以使用如下代碼段啟動相關的預設應用: 但是上述協議方式在 .NET Core 中不再適用,當我們使用上述方式進行操作,程式會給我們爆如下的錯誤: 經 "神樹桜乃" 大佬提醒,我特意看了一下 ProcessStartInf ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...