主頁 > 企業開發 > VUE3.0+Antdv+Asp.net WebApi開發學生資訊管理系統(三)

VUE3.0+Antdv+Asp.net WebApi開發學生資訊管理系統(三)

2022-08-18 09:03:26 企業開發

在B/S系統開發中,前后端分離開發設計已成為一種標準,而VUE作為前端三大主流框架之一,越來越受到大家的青睞,Antdv是Antd在Vue中的實作,本系列文章主要通過Antdv和Asp.net WebApi開發學生資訊管理系統,簡述前后端分離開發的主要相關內容,僅供學習分享使用,如有不足之處,還請指正,

在本示例專案中,主要包含兩大部分:1.前端web專案【vsims.web】2.后端webapi專案【vsims.webapi】,經過前兩篇文章的講解,已經對前端專案的架構和組成部分,以及后端webapi專案的開發有了大致了解,今天繼續開發學生管理模塊,主要講解串列,表單開發的相關內容,

涉及知識點

在本示例中,涉及知識點,主要是前端開發相關:

  • 開發工具:HbuilderX
  • 專案框架:VUE3.0+Antdv
  • Antdv控制元件應用:
    • 串列(a-table):主要用于大量結構化資料的呈現,
    • 表單(a-form):主要用于收集資訊,然后提交到后臺進行處理,以及資料進行校驗等操作,
    • 分頁組件(a-pagination):采用分頁形式分隔長串列,每次只顯示一頁串列,
    • 彈出對話窗(a-modal):需要用戶處理事務,又不希望跳轉頁面以致打斷作業流程時,可以使用 Modal 在當前頁面正中打開一個浮層,承載相應的操作,
    • 其他控制元件:文本框(a-input),按鈕(a-button),單選按鈕(a-radio),下拉框(a-select)等控制元件,關于具體每一個控制元件的使用,可參考官網說明示例,

功能劃分

在本示例中,學生管理模塊功能主要分為4個部分:

  • 查詢功能:根據輸入的查詢條件進行查詢,此功能是一個form表單,
  • 資料展示:將查詢出的結果進行展示,此功能是一個table串列,
  • 分頁功能:資料資料較多,需要分頁展示,每次展示一頁資料,
  • 新增,編輯功能:可以添加學生資訊,也可以編輯資訊,此功能是一個彈出對話框,嵌套一個form表單,

查詢功能

在學生管理模塊中,查詢功能主要通過學號,姓名兩個條件進行查詢,代碼如下所示:

 1 <a-form :model="formState" name="horizontal_query" layout="inline" autocomplete="off" @finish="onFinish" @finishFailed="onFinishFailed">
 2     <a-form-item label="學號" name="no">
 3         <a-input v-model:value="formState.no"></a-input>
 4     </a-form-item>
 5     <a-form-item label="姓名" name="name">
 6         <a-input v-model:value="formState.name"></a-input>
 7     </a-form-item>
 8     <a-form-item>
 9         <a-button type="primary" html-type="submit">查詢</a-button>
10     </a-form-item>
11     <a-form-item>
12         <a-button type="primary" @click="addStudent">新增</a-button>
13     </a-form-item>
14 </a-form>

注意:form表單的提交事件為submit,finish為提交成功后的回應事件,在此事件中可以進行介面呼叫,如下所示:

 1 const onFinish = (values: any) => {
 2     var no = values.no;
 3     var name = values.name;
 4     getStudents(no, name);
 5     console.log('Success:', values);
 6 };
 7 
 8 const onFinishFailed = (errorInfo: any) => {
 9     console.log('Failed:', errorInfo);
10 };
11 
12 const getStudents = (no, name) => {
13     dataSource.length = 0;
14     getD('/api/Student/GetStudents', {
15         "pageSize": pagination.pageSize,
16         "pageNum": pagination.current,
17         "no": no,
18         "name": name
19     }).then(res => {
20         console.log(res);
21         if (res.status == 200) {
22             pagination.total = res.data.count; //總記錄數
23             console.log(pagination.total);
24             for (let i = 0; i < res.data.items.length; i++) {
25                 dataSource.push({
26                     id: res.data.items[i].id,
27                     key: res.data.items[i].id.toString(),
28                     no: res.data.items[i].no,
29                     name: res.data.items[i].name,
30                     age: res.data.items[i].age,
31                     sex: res.data.items[i].sex ? "男" : "女",
32                     sexValue: res.data.items[i].sex,
33                     classesId: res.data.items[i].classesId,
34                     classesName: res.data.items[i].classesName,
35                 });
36             }
37             state.dataSource = [...dataSource];
38         }
39     });
40 };

其中getStudents方法,多個地方會進行呼叫,所以進行了封裝,主要用于學生串列查詢介面訪問,

資料展示

資料展示主要使用a-table控制元件,其中columns定義需要顯示的列,data-source系結資料源,如下所示:

 1 <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false" :row-key="record => record.id">
 2     <template #bodyCell="{ column, text, record }">
 3         <template v-if="[ 'no','name', 'sge', 'dex','classesName'].includes(column.dataIndex)">
 4             <div>{{ text }}</div>
 5         </template>
 6         <template v-else-if="column.dataIndex === 'operation'">
 7             <div class="editable-row-operations">
 8                 <a @click="edit(record.key)">Edit</a>
 9             </div>
10         </template>
11     </template>
12 </a-table>

注意:默認情況下,當資料源發生更新時,a-table控制元件不會資訊頁面重繪,需要系結row-key屬性才可以,

分頁功能

分頁功能主要才用分頁控制元件a-pagination,其中current表示當前頁,total表示總頁碼,change表示系結分頁事件,如下所示:

1 <a-pagination v-model:current="pagination.current" :total="pagination.total" @change="change" />

關于change事件功能,主要用于呼叫getStudents函式,如下所示:

1 const change = (pagination) => {
2     var no = formState.no;
3     var name = formState.name;
4     getStudents(no, name);
5     console.log(pagination);
6 };

新增編輯功能

新增學生和編輯學生都是對單個學生物體進行操作,采用form表單進行提交到后臺介面,其中visible用于控制彈窗的顯示與隱藏,ok表示彈窗的確定事件,班級下拉框(a-select)顯示班級串列,需要在加載頁面時進行預加載,如下所示:

 1 <a-modal ref="modalRef" v-model:visible="visible" okText="保存" cancelText="取消" :wrap-style="{ overflow: 'hidden' }" @ok="handleOk">
 2     <div>
 3         <a-page-header style="border: 1px solid rgb(235, 237, 240)" title="學生管理" sub-title="新增或編輯學生" />
 4         <a-form :model="addEditFormState">
 5             <a-form-item label="學號">
 6                 <a-input v-model:value="addEditFormState.no" />
 7             </a-form-item>
 8             <a-form-item label="姓名">
 9                 <a-input v-model:value="addEditFormState.name" />
10             </a-form-item>
11             <a-form-item label="年齡">
12                 <a-input v-model:value="addEditFormState.age" />
13             </a-form-item>
14             <a-form-item label="性別">
15                 <a-radio-group v-model:value="addEditFormState.sex">
16                     <a-radio :value="true"></a-radio>
17                     <a-radio :value="false"></a-radio>
18                 </a-radio-group>
19             </a-form-item>
20             <a-form-item label="班級">
21                 <a-select ref="select" v-model:value="addEditFormState.classes" style="width: 200px">
22                     <a-select-option :value="item.id" v-for="(item) in dataClasses" :key="item.id">{{item.name}}</a-select-option>
23                 </a-select>
24             </a-form-item>
25         </a-form>
26     </div>
27 </a-modal>

新增編輯提交事件handleOk代碼,其中根據id值判斷是新增學生和編輯學生,如下所示:

 1 const handleOk = (e: MouseEvent) => {
 2     console.log(e);
 3     console.log(addEditFormState);
 4     var url = "";
 5     if (addEditFormState.id >0) {
 6         url = "/api/Student/UpdateStudent"; //編輯
 7     } else {
 8         url = "/api/Student/AddStudent"; //新增
 9     }
10     postD(url, {
11         "id": addEditFormState.id>0?addEditFormState.id:null,
12         "no": addEditFormState.no,
13         "name": addEditFormState.name,
14         "age": addEditFormState.age,
15         "sex": addEditFormState.sex,
16         "classesId": addEditFormState.classes,
17         "createTime": "2022-08-15T15:31:12.224Z",
18         "createUser": 0,
19         "lastEditTime": "2022-08-15T15:31:12.224Z",
20         "lastEditUser": 0
21     }).then(res => {
22         console.log(res);
23         if(res.status==200){
24             if(res.data=https://www.cnblogs.com/hsiang/archive/2022/08/17/=0){
25                 message.success('保存成功!');
26                 visible.value = https://www.cnblogs.com/hsiang/archive/2022/08/17/false;
27                 var no = formState.no;
28                 var name = formState.name;
29                 getStudents(no, name);
30             }else{
31                 message.error('保存失敗!');
32             }
33         }
34     });
35     
36 };

關于學生管理模塊的全部代碼,如下所示:

  1 <template>
  2     <a-page-header style="border: 1px solid rgb(235, 237, 240)" title="學生管理" sub-title="學生資訊基本操作" />
  3     <a-form :model="formState" name="horizontal_query" layout="inline" autocomplete="off" @finish="onFinish" @finishFailed="onFinishFailed">
  4         <a-form-item label="學號" name="no">
  5             <a-input v-model:value="formState.no"></a-input>
  6         </a-form-item>
  7         <a-form-item label="姓名" name="name">
  8             <a-input v-model:value="formState.name"></a-input>
  9         </a-form-item>
 10         <a-form-item>
 11             <a-button type="primary" html-type="submit">查詢</a-button>
 12         </a-form-item>
 13         <a-form-item>
 14             <a-button type="primary" @click="addStudent">新增</a-button>
 15         </a-form-item>
 16     </a-form>
 17     <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false" :row-key="record => record.id">
 18         <template #bodyCell="{ column, text, record }">
 19             <template v-if="[ 'no','name', 'sge', 'dex','classesName'].includes(column.dataIndex)">
 20                 <div>{{ text }}</div>
 21             </template>
 22             <template v-else-if="column.dataIndex === 'operation'">
 23                 <div class="editable-row-operations">
 24                     <a @click="edit(record.key)">Edit</a>
 25                 </div>
 26             </template>
 27         </template>
 28     </a-table>
 29     <a-pagination v-model:current="pagination.current" :total="pagination.total" @change="change" />
 30     <a-modal ref="modalRef" v-model:visible="visible" okText="保存" cancelText="取消" :wrap-style="{ overflow: 'hidden' }" @ok="handleOk">
 31         <div>
 32             <a-page-header style="border: 1px solid rgb(235, 237, 240)" title="學生管理" sub-title="新增或編輯學生" />
 33             <a-form :model="addEditFormState">
 34                 <a-form-item label="學號">
 35                     <a-input v-model:value="addEditFormState.no" />
 36                 </a-form-item>
 37                 <a-form-item label="姓名">
 38                     <a-input v-model:value="addEditFormState.name" />
 39                 </a-form-item>
 40                 <a-form-item label="年齡">
 41                     <a-input v-model:value="addEditFormState.age" />
 42                 </a-form-item>
 43                 <a-form-item label="性別">
 44                     <a-radio-group v-model:value="addEditFormState.sex">
 45                         <a-radio :value="true"></a-radio>
 46                         <a-radio :value="false"></a-radio>
 47                     </a-radio-group>
 48                 </a-form-item>
 49                 <a-form-item label="班級">
 50                     <a-select ref="select" v-model:value="addEditFormState.classes" style="width: 200px">
 51                         <a-select-option :value="item.id" v-for="(item) in dataClasses" :key="item.id">{{item.name}}</a-select-option>
 52                     </a-select>
 53                 </a-form-item>
 54             </a-form>
 55         </div>
 56     </a-modal>
 57 </template>
 58 <script lang="ts">
 59     import {
 60         defineComponent,
 61         reactive,
 62         toRefs,
 63         ref,
 64         toRaw
 65     } from 'vue';
 66     import type {
 67         UnwrapRef
 68     } from 'vue';
 69     import { message } from 'ant-design-vue';
 70     import {
 71         getD,
 72         postD
 73     } from '../api/index.js';
 74 
 75     const columns = [
 76         {
 77             title: '學號',
 78             dataIndex: 'no',
 79             key: 'no',
 80             align: 'center',
 81             width: '20%',
 82         },
 83         {
 84             title: '姓名',
 85             dataIndex: 'name',
 86             key: 'name',
 87             align: 'center',
 88             width: '20%',
 89         },
 90         {
 91             title: '年齡',
 92             dataIndex: 'age',
 93             key: 'age',
 94             align: 'center',
 95             width: '15%',
 96         },
 97         {
 98             title: '性別',
 99             dataIndex: 'sex',
100             key: 'sex',
101             align: 'center',
102             width: '10%',
103         },
104         {
105             title: '班級',
106             dataIndex: 'classesName',
107             key: 'classesName',
108             align: 'center',
109             width: '20%',
110         },
111         {
112             title: '操作',
113             dataIndex: 'operation',
114             key: 'operation',
115             align: 'center',
116         },
117     ];
118     interface DataItem {
119         id: number,
120             key: string,
121             no: string,
122             name: string,
123             age: number,
124             sex: string,
125             sexValue: boolean,
126             classesId: string,
127             classesName: string
128     }
129     interface FormState {
130         no: string;
131         name: string;
132     }
133     interface ClassesItem {
134         id: number,
135             name: string
136     }
137     const pagination = {
138         total: 1,
139         current: 1,
140         pageSize: 10,
141     };
142     const dataClasses: ClassesItem[] = []; //班級串列
143     const dataSource: DataItem[] = [];
144     export default defineComponent({
145         setup() {
146             const formState = reactive < FormState > ({
147                 no: '',
148                 name: '',
149             });
150             const addEditFormState = reactive({
151                 id: 0,
152                 no: '',
153                 name: '',
154                 age: 0,
155                 sex: false,
156                 classes: '',
157             });
158             const visible = ref < boolean > (false);
159             const addStudent = () => {
160                 addEditFormState.id = -1;
161                 addEditFormState.no = '';
162                 addEditFormState.name = '';
163                 addEditFormState.age = 0;
164                 addEditFormState.classes = '';
165                 visible.value = true;
166             };
167 
168             const handleOk = (e: MouseEvent) => {
169                 console.log(e);
170                 console.log(addEditFormState);
171                 var url = "";
172                 if (addEditFormState.id >0) {
173                     url = "/api/Student/UpdateStudent"; //編輯
174                 } else {
175                     url = "/api/Student/AddStudent"; //新增
176                 }
177                 postD(url, {
178                     "id": addEditFormState.id>0?addEditFormState.id:null,
179                     "no": addEditFormState.no,
180                     "name": addEditFormState.name,
181                     "age": addEditFormState.age,
182                     "sex": addEditFormState.sex,
183                     "classesId": addEditFormState.classes,
184                     "createTime": "2022-08-15T15:31:12.224Z",
185                     "createUser": 0,
186                     "lastEditTime": "2022-08-15T15:31:12.224Z",
187                     "lastEditUser": 0
188                 }).then(res => {
189                     console.log(res);
190                     if(res.status==200){
191                         if(res.data==0){
192                             message.success('保存成功!');
193                             visible.value = false;
194                             var no = formState.no;
195                             var name = formState.name;
196                             getStudents(no, name);
197                         }else{
198                             message.error('保存失敗!');
199                         }
200                     }
201                 });
202                 
203             };
204             const onFinish = (values: any) => {
205                 var no = values.no;
206                 var name = values.name;
207                 getStudents(no, name);
208                 console.log('Success:', values);
209             };
210 
211             const onFinishFailed = (errorInfo: any) => {
212                 console.log('Failed:', errorInfo);
213             };
214             const state = reactive({
215                 dataSource: dataSource,
216                 dataClasses: dataClasses
217             });
218             const getClasses=()=>{
219                 getD('/api/Classes/GetClassess', {
220                     "dept": "",
221                     "grade": "",
222                     "pageSize": 0,
223                     "pageNum": 0
224                 }).then(res => {
225                     console.log(res);
226                     if (res.status == 200) {
227                         for (let i = 0; i < res.data.items.length; i++) {
228                             dataClasses.push({
229                                 id: res.data.items[i].id,
230                                 name: res.data.items[i].dept +res.data.items[i].grade+ res.data.items[i].name,
231                             });
232                         }
233                         state.dataClasses = [...dataClasses];
234                     }
235                 });
236             };
237             getClasses();
238             const getStudents = (no, name) => {
239                 dataSource.length = 0;
240                 getD('/api/Student/GetStudents', {
241                     "pageSize": pagination.pageSize,
242                     "pageNum": pagination.current,
243                     "no": no,
244                     "name": name
245                 }).then(res => {
246                     console.log(res);
247                     if (res.status == 200) {
248                         pagination.total = res.data.count; //總記錄數
249                         console.log(pagination.total);
250                         for (let i = 0; i < res.data.items.length; i++) {
251                             dataSource.push({
252                                 id: res.data.items[i].id,
253                                 key: res.data.items[i].id.toString(),
254                                 no: res.data.items[i].no,
255                                 name: res.data.items[i].name,
256                                 age: res.data.items[i].age,
257                                 sex: res.data.items[i].sex ? "" : "",
258                                 sexValue: res.data.items[i].sex,
259                                 classesId: res.data.items[i].classesId,
260                                 classesName: res.data.items[i].classesName,
261                             });
262                         }
263                         state.dataSource = [...dataSource];
264                     }
265                 });
266             };
267             getStudents(null,null);
268             const editableData: UnwrapRef < Record < string, DataItem >> = reactive({});
269 
270             const edit = (key: string) => {
271                 console.log(key);
272                 var student = dataSource.filter(item => key === item.key)[0];
273                 addEditFormState.id = student.id;
274                 addEditFormState.no = student.no;
275                 addEditFormState.name = student.name;
276                 addEditFormState.age = student.age;
277                 addEditFormState.sex = student.sexValue;
278                 addEditFormState.classes = student.classesId;
279                 visible.value = true;
280                 console.log(student);
281             };
282             
283             const change = (pagination) => {
284                 var no = formState.no;
285                 var name = formState.name;
286                 getStudents(no, name);
287                 console.log(pagination);
288             };
289             const onSubmit = () => {
290                 console.log('submit!', toRaw(formState));
291             };
292             return {
293                 formState,
294                 addEditFormState,
295                 ...toRefs(state),
296                 columns,
297                 editingKey: '',
298                 editableData,
299                 edit,
300                 pagination,
301                 change,
302                 onFinish,
303                 onFinishFailed,
304                 onSubmit,
305                 visible,
306                 addStudent,
307                 handleOk,
308                 //modalTitleRef,
309                 //transformStyle,
310             };
311         },
312     });
313 </script>
314 <style>
315     .editable-row-operations a {
316         margin-right: 8px;
317     }
318 
319     .ant-form {
320         height: 6vh;
321         width: 100vh;
322         background-color: transparent;
323     }
324 
325     .ant-modal-content {
326         height: 50vh;
327     }
328 
329     .ant-modal-body .ant-input {
330         width: 40vh;
331     }
332 
333     .ant-modal-body {
334         height: 40vh;
335     }
336 
337     .ant-modal-body .ant-page-header {
338         width: 46vh;
339         padding: 0.5rem;
340     }
341 </style>
View Code

示例截圖

學生管理模塊,示例截圖如下所示:

 

備注

以上就是Antdv+Asp.net WebApi開發學生資訊管理系統第三篇的全部內容,寫文不易,多謝支持,學習編程,從關注【老碼識途】開始!!!


作者:小六公子
出處:http://www.cnblogs.com/hsiang/
本文著作權歸作者和博客園共有,寫文不易,支持原創,歡迎轉載【點贊】,轉載請保留此段宣告,且在文章頁面明顯位置給出原文連接,謝謝,
關注個人公眾號,定時同步更新技術及職場文章

轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/502153.html

標籤:其他

上一篇:Vue+Koa+MongoDB從零打造一個任務管理系統

下一篇:時間格式的轉換---全

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • IEEE1588PTP在數字化變電站時鐘同步方面的應用

    IEEE1588ptp在數字化變電站時鐘同步方面的應用 京準電子科技官微——ahjzsz 一、電力系統時間同步基本概況 隨著對IEC 61850標準研究的不斷深入,國內外學者提出基于IEC61850通信標準體系建設數字化變電站的發展思路。數字化變電站與常規變電站的顯著區別在于程序層傳統的電流/電壓互 ......

    uj5u.com 2020-09-10 03:51:52 more
  • HTTP request smuggling CL.TE

    CL.TE 簡介 前端通過Content-Length處理請求,通過反向代理或者負載均衡將請求轉發到后端,后端Transfer-Encoding優先級較高,以TE處理請求造成安全問題。 檢測 發送如下資料包 POST / HTTP/1.1 Host: ac391f7e1e9af821806e890 ......

    uj5u.com 2020-09-10 03:52:11 more
  • 網路滲透資料大全單——漏洞庫篇

    網路滲透資料大全單——漏洞庫篇漏洞庫 NVD ——美國國家漏洞庫 →http://nvd.nist.gov/。 CERT ——美國國家應急回應中心 →https://www.us-cert.gov/ OSVDB ——開源漏洞庫 →http://osvdb.org Bugtraq ——賽門鐵克 →ht ......

    uj5u.com 2020-09-10 03:52:15 more
  • 京準講述NTP時鐘服務器應用及原理

    京準講述NTP時鐘服務器應用及原理京準講述NTP時鐘服務器應用及原理 安徽京準電子科技官微——ahjzsz 北斗授時原理 授時是指接識訓通過某種方式獲得本地時間與北斗標準時間的鐘差,然后調整本地時鐘使時差控制在一定的精度范圍內。 衛星導航系統通常由三部分組成:導航授時衛星、地面檢測校正維護系統和用戶 ......

    uj5u.com 2020-09-10 03:52:25 more
  • 利用北斗衛星系統設計NTP網路時間服務器

    利用北斗衛星系統設計NTP網路時間服務器 利用北斗衛星系統設計NTP網路時間服務器 安徽京準電子科技官微——ahjzsz 概述 NTP網路時間服務器是一款支持NTP和SNTP網路時間同步協議,高精度、大容量、高品質的高科技時鐘產品。 NTP網路時間服務器設備采用冗余架構設計,高精度時鐘直接來源于北斗 ......

    uj5u.com 2020-09-10 03:52:35 more
  • 詳細解讀電力系統各種對時方式

    詳細解讀電力系統各種對時方式 詳細解讀電力系統各種對時方式 安徽京準電子科技官微——ahjzsz,更多資料請添加VX 衛星同步時鐘是我京準公司開發研制的應用衛星授時時技術的標準時間顯示和發送的裝置,該裝置以M國全球定位系統(GLOBAL POSITIONING SYSTEM,縮寫為GPS)或者我國北 ......

    uj5u.com 2020-09-10 03:52:45 more
  • 如何保證外包團隊接入企業內網安全

    不管企業規模的大小,只要企業想省錢,那么企業的某些服務就一定會采用外包的形式,然而看似美好又經濟的策略,其實也有不好的一面。下面我通過安全的角度來聊聊使用外包團的安全隱患問題。 先看看什么服務會使用外包的,最常見的就是話務/客服這種需要大量重復性、無技術性的服務,或者是一些銷售外包、特殊的職能外包等 ......

    uj5u.com 2020-09-10 03:52:57 more
  • PHP漏洞之【整型數字型SQL注入】

    0x01 什么是SQL注入 SQL是一種注入攻擊,通過前端帶入后端資料庫進行惡意的SQL陳述句查詢。 0x02 SQL整型注入原理 SQL注入一般發生在動態網站URL地址里,當然也會發生在其它地發,如登錄框等等也會存在注入,只要是和資料庫打交道的地方都有可能存在。 如這里http://192.168. ......

    uj5u.com 2020-09-10 03:55:40 more
  • [GXYCTF2019]禁止套娃

    git泄露獲取原始碼 使用GET傳參,引數為exp 經過三層過濾執行 第一層過濾偽協議,第二層過濾帶引數的函式,第三層過濾一些函式 preg_replace('/[a-z,_]+\((?R)?\)/', NULL, $_GET['exp'] (?R)參考當前正則運算式,相當于匹配函式里的引數 因此傳遞 ......

    uj5u.com 2020-09-10 03:56:07 more
  • 等保2.0實施流程

    流程 結論 ......

    uj5u.com 2020-09-10 03:56:16 more
最新发布
  • 使用Django Rest framework搭建Blog

    在前面的Blog例子中我們使用的是GraphQL, 雖然GraphQL的使用處于上升趨勢,但是Rest API還是使用的更廣泛一些. 所以還是決定回到傳統的rest api framework上來, Django rest framework的官網上給了一個很好用的QuickStart, 我參考Qu ......

    uj5u.com 2023-04-20 08:17:54 more
  • 記錄-new Date() 我忍你很久了!

    這里給大家分享我在網上總結出來的一些知識,希望對大家有所幫助 大家平時在開發的時候有沒被new Date()折磨過?就是它的諸多怪異的設定讓你每每用的時候,都可能不小心踩坑。造成程式意外出錯,卻一下子找不到問題出處,那叫一個煩透了…… 下面,我就列舉它的“四宗罪”及應用思考 可惡的四宗罪 1. Sa ......

    uj5u.com 2023-04-20 08:17:47 more
  • 使用Vue.js實作文字跑馬燈效果

    實作文字跑馬燈效果,首先用到 substring()截取 和 setInterval計時器 clearInterval()清除計時器 效果如下: 實作代碼如下: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta ......

    uj5u.com 2023-04-20 08:12:31 more
  • JavaScript 運算子

    JavaScript 運算子/運算子 在 JavaScript 中,有一些運算子可以使代碼更簡潔、易讀和高效。以下是一些常見的運算子: 1、可選鏈運算子(optional chaining operator) ?.是可選鏈運算子(optional chaining operator)。?. 可選鏈操 ......

    uj5u.com 2023-04-20 08:02:25 more
  • CSS—相對單位rem

    一、概述 rem是一個相對長度單位,它的單位長度取決于根標簽html的字體尺寸。rem即root em的意思,中文翻譯為根em。瀏覽器的文本尺寸一般默認為16px,即默認情況下: 1rem = 16px rem布局原理:根據CSS媒體查詢功能,更改根標簽的字體尺寸,實作rem單位隨螢屏尺寸的變化,如 ......

    uj5u.com 2023-04-20 08:02:21 more
  • 我的第一個NPM包:panghu-planebattle-esm(胖虎飛機大戰)使用說明

    好家伙,我的包終于開發完啦 歡迎使用胖虎的飛機大戰包!! 為你的主頁添加色彩 這是一個有趣的網頁小游戲包,使用canvas和js開發 使用ES6模塊化開發 效果圖如下: (覺得圖片太sb的可以自己改) 代碼已開源!! Git: https://gitee.com/tang-and-han-dynas ......

    uj5u.com 2023-04-20 08:01:50 more
  • 如何在 vue3 中使用 jsx/tsx?

    我們都知道,通常情況下我們使用 vue 大多都是用的 SFC(Signle File Component)單檔案組件模式,即一個組件就是一個檔案,但其實 Vue 也是支持使用 JSX 來撰寫組件的。這里不討論 SFC 和 JSX 的好壞,這個仁者見仁智者見智。本篇文章旨在帶領大家快速了解和使用 Vu ......

    uj5u.com 2023-04-20 08:01:37 more
  • 【Vue2.x原始碼系列06】計算屬性computed原理

    本章目標:計算屬性是如何實作的?計算屬性快取原理以及洋蔥模型的應用?在初始化Vue實體時,我們會給每個計算屬性都創建一個對應watcher,我們稱之為計算屬性watcher ......

    uj5u.com 2023-04-20 08:01:31 more
  • http1.1與http2.0

    一、http是什么 通俗來講,http就是計算機通過網路進行通信的規則,是一個基于請求與回應,無狀態的,應用層協議。常用于TCP/IP協議傳輸資料。目前任何終端之間任何一種通信方式都必須按Http協議進行,否則無法連接。tcp(三次握手,四次揮手)。 請求與回應:客戶端請求、服務端回應資料。 無狀態 ......

    uj5u.com 2023-04-20 08:01:10 more
  • http1.1與http2.0

    一、http是什么 通俗來講,http就是計算機通過網路進行通信的規則,是一個基于請求與回應,無狀態的,應用層協議。常用于TCP/IP協議傳輸資料。目前任何終端之間任何一種通信方式都必須按Http協議進行,否則無法連接。tcp(三次握手,四次揮手)。 請求與回應:客戶端請求、服務端回應資料。 無狀態 ......

    uj5u.com 2023-04-20 08:00:32 more