springboot + Vue前后端項目(第十三記)

項目實戰第十三記

  • 寫在前面
  • 1.建立角色表
  • 2. 后端代碼生成
    • 2.1 RoleController
  • 3. 前端頁面的搭建
    • 3.1 Role.vue
    • 3.2 路由
    • 3.3 Aside.vue
    • 3.4 頁面效果
  • 4.建立菜單表
  • 5.后端代碼編寫
    • 5.1 Menu
    • 5.2 MenuController
  • 6.前端頁面的搭建
    • 6.1 Menu.vue
    • 6.2 路由
    • 6.3 Aside.vue
    • 6.4 頁面效果
  • 總結
  • 寫在最后

寫在前面

本篇主要講解動態分配菜單第一章節,每個角色應該具備不一樣的菜單權限

1.建立角色表

DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role`  (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',`role_key` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '唯一標識',`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '名稱',`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '描述',`is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否刪除',PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

2. 后端代碼生成

2.1 RoleController

package com.ppj.controller;import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Arrays;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ppj.common.Result;import com.ppj.service.IRoleService;
import com.ppj.entity.Role;import org.springframework.web.bind.annotation.RestController;/*** <p>*  前端控制器* </p>** @author ppj* @since 2024-05-29*/
@RestController
@RequestMapping("/role")
public class RoleController {@Resourceprivate IRoleService roleService;// 新增或者更新@PostMappingpublic Result save(@RequestBody Role role) {roleService.saveOrUpdate(role);return Result.success();}@DeleteMapping("/{roleIds}")public Result delete(@PathVariable Integer[] roleIds) {roleService.removeByIds(Arrays.asList(roleIds));return Result.success();}@GetMappingpublic Result findAll() {return Result.success(roleService.list());}@GetMapping("/{id}")public Result findOne(@PathVariable Integer id) {return Result.success(roleService.getById(id));}@GetMapping("/page")public Result findPage(@RequestParam Integer pageNum,@RequestParam Integer pageSize,@RequestParam(defaultValue = "") String name) {QueryWrapper<Role> queryWrapper = new QueryWrapper<>();queryWrapper.like("name",name);return Result.success(roleService.page(new Page<>(pageNum, pageSize), queryWrapper));}}

3. 前端頁面的搭建

3.1 Role.vue

<template><div><!-- 設計的查詢 --><div style="margin: 10px 0"><el-inputstyle="width: 200px"placeholder="請輸入名稱"suffix-icon="el-icon-search"v-model="name"/><el-button type="primary" icon="el-icon-search" class="ml-5" @click="getList">搜索</el-button><el-button type="warning" icon="el-icon-reset" @click="resetQuery">重置</el-button></div><div style="margin: 10px 0"><el-button type="primary" @click="handleAdd">新增 <i class="el-icon-circle-plus-outline"></i></el-button><el-button type="warning" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">修改</el-button><el-button type="danger" :disabled="multiple" @click="handleDelete">刪除 <i class="el-icon-remove-outline"></i></el-button></div><el-table :data="tableData" @selection-change="handleSelectionChange"><el-table-column type="selection" width="55" /><el-table-column prop="id" label="角色ID" width="80"></el-table-column><el-table-column prop="roleKey" label="唯一標識"></el-table-column><el-table-column prop="name" label="角色名稱"></el-table-column><el-table-column prop="description" label="角色描述"></el-table-column><el-table-column label="操作"><template v-slot="scope"><el-buttontype="info"icon="el-icon-menu"@click="openMenuAllocDialog(scope.row.id)">分配菜單</el-button><el-button type="success" @click="handleUpdate(scope.row)">編輯 <i class="el-icon-edit"></i></el-button><el-button type="danger" @click="handleDelete(scope.row)">刪除 <i class="el-icon-remove-outline"></i></el-button></template></el-table-column></el-table><div style="padding: 10px 0"><el-pagination@size-change="handleSizeChange"@current-change="handleCurrentChange":current-page="pageNum":page-sizes="[5, 10, 15]":page-size="pageSize"layout="total, sizes, prev, pager, next, jumper":total="total"></el-pagination></div><!-- 角色添加對話框 --><el-dialog title="角色信息" :visible.sync="dialogFormVisible" width="30%"><el-form :model="form"><el-form-item label="唯一標識" :label-width="formLabelWidth"><el-input v-model="form.roleKey" autocomplete="off"></el-input></el-form-item><el-form-item label="角色名稱" :label-width="formLabelWidth"><el-input v-model="form.name" autocomplete="off"></el-input></el-form-item><el-form-item label="描述" :label-width="formLabelWidth"><el-input v-model="form.description" autocomplete="off"></el-input></el-form-item></el-form><div slot="footer" class="dialog-footer"><el-button @click="dialogFormVisible = false">取 消</el-button><el-button type="primary" @click="save">確 定</el-button></div></el-dialog><!-- 分配菜單 --><el-dialog title="菜單分配" :visible.sync="menuDialogVis" width="30%"><el-tree:props="props":data="menuData"show-checkboxnode-key="id"ref="tree":default-expanded-keys="expends":default-checked-keys="checks"><span class="custom-tree-node" slot-scope="{ node, data }"><span><i :class="data.icon"></i> {{ data.name }}</span></span></el-tree><div slot="footer" class="dialog-footer"><el-button @click="menuDialogVis = false">取 消</el-button><el-button type="primary" @click="saveRoleMenu">確 定</el-button></div></el-dialog></div>
</template>
<script>
export default {name: "Role",data() {return {name: "",tableData: [],total: 0,pageSize: 5,pageNum: 1,dialogFormVisible: false,menuDialogVis: false,formLabelWidth: "80px",ids: [],// 非單個禁用single: true,// 非多個禁用multiple: true,form: {id: "",name: "",description: "",},menuData: [],props: {label: 'name',},expends: [],checks: [],roleId: 0,};},//頁面一創建成功created() {//請求分頁查詢數據this.getList();},methods: {getList() {this.request.get("/role/page", {params: {pageNum: this.pageNum,pageSize: this.pageSize,name: this.name,},}).then((res) => {if(res.code === "200"){this.tableData = res.data.records;this.total = res.data.total;}else{this.$message.error(res.msg);}});},//分配菜單openMenuAllocDialog(){this.menuDialogVis = true;//請求菜單數據this.request.get("/menu",{params: {name: ""}}).then(res => {this.menuData = res.data;//展開菜單數據this.expends = this.menuData.map(v => v.id);})},//保存角色下的菜單saveRoleMenu(){},// 重置按鈕resetQuery(){this.username = "";this.pageNum = 1;this.pageSize = 5;this.getList();},handleSizeChange(val) {this.pageSize = val;},handleCurrentChange(val) {this.pageNum = val;this.getList();},// 多選框選中數據handleSelectionChange(selection) {this.ids = selection.map(item => item.id);this.single = selection.length != 1;this.multiple = !selection.length;},// 新增handleAdd(){this.dialogFormVisible = true;this.form = {};},save(){this.request.post("/role",this.form).then(res => {if(res.code === "200" || res.code === 200){this.$message.success("操作成功")}else {this.$message.error("操作失敗")}this.dialogFormVisible = false;this.getList();})},// 修改handleUpdate(row){// 表單置空this.reset();// 重新查詢數據const roleId = row.id || this.ids;this.request.get('/role/'+roleId).then(response => {this.form = response.data;this.dialogFormVisible = true;});},reset(){this.form.roleKey = undefined;this.form.name = undefined;this.form.description = undefined;},// 刪除handleDelete(row){let _this = this;const roleIds = row.id || this.ids;this.$confirm('是否確認刪除角色編號為"' + roleIds + '"的數據項?', '刪除角色', {confirmButtonText: '確定',cancelButtonText: '取消',type: 'warning'}).then(() => {_this.request.delete("/role/"+roleIds).then(res=>{if(res.code === "200" || res.code === 200){_this.$message.success("刪除成功")}else {_this.$message.error("刪除失敗")}this.getList();})}).catch(() => {});}},
};
</script>

3.2 路由

{path: 'role',name: '角色管理',component: () => import('../views/Role.vue'),meta: {title: '角色管理'}
},

3.3 Aside.vue

<el-menu-item index="/role"><i class="el-icon-s-custom"></i><span slot="title">角色管理</span></el-menu-item>

3.4 頁面效果

在這里插入圖片描述
在這里插入圖片描述

4.建立菜單表

DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu`  (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '名稱',`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '路徑',`pid` int(11) NULL DEFAULT NULL COMMENT '父級id',`icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '圖標',`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '描述',`is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '邏輯刪除',PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

5.后端代碼編寫

5.1 Menu

package com.ppj.entity;import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.List;import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;/*** <p>* * </p>** @author ppj* @since 2024-05-29*/
@Getter
@Setter@TableName("sys_menu")
@ApiModel(value = "Menu對象", description = "")
public class Menu implements Serializable {private static final long serialVersionUID = 1L;@ApiModelProperty("id")@TableId(value = "id", type = IdType.AUTO)private Integer id;@ApiModelProperty("名稱")private String name;@ApiModelProperty("路徑")private String path;@ApiModelProperty("父級id")private Integer pid;@ApiModelProperty("圖標")private String icon;@ApiModelProperty("描述")private String description;@ApiModelProperty("邏輯刪除")private Boolean isDelete;// 構造樹形數據@TableField(exist = false)private List<Menu> children;}

5.2 MenuController

package com.ppj.controller;import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ppj.common.Result;import com.ppj.service.IMenuService;
import com.ppj.entity.Menu;import org.springframework.web.bind.annotation.RestController;/*** <p>*  前端控制器* </p>** @author ppj* @since 2024-05-29*/
@RestController
@RequestMapping("/menu")
public class MenuController {@Resourceprivate IMenuService menuService;// 新增或者更新@PostMappingpublic Result save(@RequestBody Menu menu) {menuService.saveOrUpdate(menu);return Result.success();}@DeleteMapping("/{menuIds}")public Result delete(@PathVariable Integer[] menuIds) {menuService.removeByIds(Arrays.asList(menuIds));return Result.success();}@GetMapping("/{id}")public Result findOne(@PathVariable Integer id) {return Result.success(menuService.getById(id));}// 樹形數據@GetMappingpublic Result findAll(@RequestParam(defaultValue = "") String name) {QueryWrapper<Menu> queryWrapper = new QueryWrapper<>();queryWrapper.like("name",name);List<Menu> list = menuService.list(queryWrapper);// 找出一級菜單List<Menu> parentNode = list.stream().filter(m -> m.getPid() == null).collect(Collectors.toList());// 找出一級菜單的子菜單for (Menu menu : parentNode) {menu.setChildren(list.stream().filter(m -> menu.getId().equals(m.getPid())).collect(Collectors.toList()));}return Result.success(parentNode);}@GetMapping("/page")public Result findPage(@RequestParam Integer pageNum,@RequestParam Integer pageSize) {QueryWrapper<Menu> queryWrapper = new QueryWrapper<>();return Result.success(menuService.page(new Page<>(pageNum, pageSize), queryWrapper));}}

6.前端頁面的搭建

6.1 Menu.vue

<template><div><!-- 設計的查詢 --><div style="margin: 10px 0"><el-inputstyle="width: 200px"placeholder="請輸入名稱"suffix-icon="el-icon-search"v-model="name"/><el-button type="primary" icon="el-icon-search" class="ml-5" @click="getList">搜索</el-button><el-button type="warning" icon="el-icon-reset" @click="resetQuery">重置</el-button></div><div style="margin: 10px 0"><el-button type="primary" @click="handleAdd">新增 <i class="el-icon-circle-plus-outline"></i></el-button><el-button type="warning" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">修改</el-button></div><el-table :data="tableData"row-key="id"@selection-change="handleSelectionChange"><el-table-column type="selection" width="55" /><el-table-column prop="id" label="菜單ID"></el-table-column><el-table-columnprop="name"label="菜單名稱"></el-table-column><el-table-columnprop="path"label="菜單路徑"></el-table-column><el-table-columnprop="icon"label="菜單圖標"></el-table-column><el-table-column prop="description" label="描述"></el-table-column><el-table-column label="操作" width="300px"><template v-slot="scope"><el-buttontype="primary"@click="handleAdd(scope.row.id)"v-if="!scope.row.pid && !scope.row.path">新增子菜單</el-button><el-button type="success" @click="handleUpdate(scope.row)">編輯 <i class="el-icon-edit"></i></el-button><el-button type="danger" @click="handleDelete(scope.row)">刪除 <i class="el-icon-remove-outline"></i></el-button></template></el-table-column></el-table><!-- <div style="padding: 10px 0"><el-pagination@size-change="handleSizeChange"@current-change="handleCurrentChange":current-page="pageNum":page-sizes="[5, 10, 15]":page-size="pageSize"layout="total, sizes, prev, pager, next, jumper":total="total"></el-pagination></div> --><!-- 菜單添加對話框 --><el-dialog title="菜單信息" :visible.sync="dialogFormVisible" width="30%"><el-form :model="form"><el-form-item label="菜單名稱" :label-width="formLabelWidth"><el-input v-model="form.name" autocomplete="off"></el-input></el-form-item><el-form-item label="菜單路徑" :label-width="formLabelWidth"><el-input v-model="form.path" autocomplete="off"></el-input></el-form-item><el-form-item label="圖標" :label-width="formLabelWidth"><el-input v-model="form.icon" autocomplete="off"></el-input></el-form-item><el-form-item label="描述" :label-width="formLabelWidth"><el-input v-model="form.description" autocomplete="off"></el-input></el-form-item></el-form><div slot="footer" class="dialog-footer"><el-button @click="dialogFormVisible = false">取 消</el-button><el-button type="primary" @click="save">確 定</el-button></div></el-dialog></div>
</template>
<script>
export default {name: "Menu",data() {return {name: "",tableData: [],total: 0,pageSize: 5,pageNum: 1,dialogFormVisible: false,formLabelWidth: "80px",ids: [],// 非單個禁用single: true,// 非多個禁用multiple: true,form: {id: '',name: "",path: "",icon: "",description: "",},};},//頁面一創建成功created() {//請求分頁查詢數據this.getList();},methods: {getList() {this.request.get("/menu", {params: {name: this.name,},}).then((res) => {if(res.code === "200"){this.tableData = res.data;}else{this.$message.error(res.msg);}});},resetQuery() {this.name = "";this.pageNum = 1;this.pageSize = 5;this.getList();},handleSizeChange(val) {this.pageSize = val;},handleCurrentChange(val) {this.pageNum = val;this.getList();},// 多選框選中數據handleSelectionChange(selection) {this.ids = selection.map(item => item.id);this.single = selection.length != 1;this.multiple = !selection.length;},// 新增handleAdd(id){this.reset();this.dialogFormVisible = true;if(id){  // 新建子菜單時,設置父idthis.form.pid = id;}},save(){this.request.post("/menu",this.form).then(res => {if(res.code === "200" || res.code === 200){this.$message.success("操作成功")}else {this.$message.error("操作失敗")}this.dialogFormVisible = false;this.getList();})},// 修改handleUpdate(row){// 表單置空this.reset();// 重新查詢數據const menuId = row.id || this.ids;this.request.get('/menu/'+menuId).then(response => {this.form = response.data;this.dialogFormVisible = true;});},reset(){this.form.path = undefined;this.form.name = undefined;this.form.icon = undefined;this.form.description = undefined;},// 刪除handleDelete(row){let _this = this;const menuIds = row.id || this.ids;this.$confirm('是否確認刪除菜單編號為"' + menuIds + '"的數據項?', '刪除菜單', {confirmButtonText: '確定',cancelButtonText: '取消',type: 'warning'}).then(() => {_this.request.delete("/menu/"+menuIds).then(res=>{if(res.code === "200" || res.code === 200){_this.$message.success("刪除成功")}else {_this.$message.error("刪除失敗")}this.getList();})}).catch(() => {});}},
};
</script>

6.2 路由

{path: 'menu',name: '菜單管理',component: () => import('../views/Menu.vue'),meta: {title: '菜單管理'}
},

6.3 Aside.vue

<el-menu-item index="/menu"><i class="el-icon-menu"></i><span slot="title">菜單管理</span>
</el-menu-item>

6.4 頁面效果

在這里插入圖片描述

總結

  • 本篇后端難點是構造樹形數據,前端主要是樹形數據菜單和表格展示,細節部分代碼有解釋

寫在最后

如果此文對您有所幫助,請帥戈靚女們務必不要吝嗇你們的Zan,感謝!!不懂的可以在評論區評論,有空會及時回復。
文章會一直更新

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/20444.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/20444.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/20444.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

keepalived安裝文檔

目錄 1、安裝環境 2、安裝keepalived 2.1 上傳keepalived安裝文件 2.2 解壓 2.3 安裝keepalived 2.4 加入開機啟動&#xff1a; 2.5 配置日志文件 2.6 打開防火墻的通訊地址 1、安裝環境 su - root yum -y install kernel-devel* yum -y install openssl-* yum -y …

vx小程序初學

小程序初學 在我還沒接觸到微信小程序之前&#xff0c;通常使用輪播要么手寫或使用swiper插件去實現&#xff0c;當我接觸到微信小程序之后&#xff0c;我看到了微信小程序的強大之處&#xff0c;讓我為大家介紹一下吧&#xff01; swiper與swiper-item一起使用可以做輪播圖 …

把自己的服務器添加到presearch節點

Presearch is a scam. Before, judging by the price of the token you should have been able to get between $150-$200 after 12-13 months of regular searches. "If you use this service for the next 11 years you will have earned $30!" Presearch大約需要…

Easy RoCE:在SONiC交換機上一鍵啟用無損以太網

RDMA&#xff08;遠程直接內存訪問&#xff09;技術是一種繞過 CPU 或操作系統&#xff0c;在計算機之間直接傳輸內存數據的技術。它釋放了內存帶寬和 CPU&#xff0c;使節點之間的通信具有更低的延遲和更高的吞吐量。目前&#xff0c;RDMA 技術已廣泛應用于高性能計算、人工智…

車流量監控系統

1.項目介紹 本文檔是對于“車流量檢測平臺”的應用技術進行匯總&#xff0c;適用于此系統所有開發&#xff0c;測試以及使用人員&#xff0c;其中包括設計背景&#xff0c;應用場景&#xff0c;系統架構&#xff0c;技術分析&#xff0c;系統調度&#xff0c;環境依賴&#xf…

MongoDB~存儲引擎了解

存儲引擎 存儲引擎是一個數據庫的核心&#xff0c;主要負責內存、磁盤里數據的管理和維護。 MongoBD的優勢&#xff0c;在于其數據模型定義的靈活性、以及可拓展性。但不要忽略&#xff0c;其存儲引擎也是插件式的存在&#xff0c;支持不同類型的存儲引擎&#xff0c;使用不同…

導線防碰撞警示燈:高壓線路安全保障

導線防碰撞警示燈&#xff1a;高壓線路安全保障 在廣袤的大地上&#xff0c;高壓線路如同血脈般縱橫交錯&#xff0c;然而&#xff0c;在這看似平靜的電力輸送背后&#xff0c;卻隱藏著不容忽視的安全隱患。特別是在那些輸電線路跨越道路、施工等區域的路段&#xff0c;線下超…

頂點著色技術在AI去衣中的作用

在當今的數字時代&#xff0c;人工智能&#xff08;AI&#xff09;已經滲透到我們生活的方方面面&#xff0c;從智能家居到自動駕駛汽車&#xff0c;再到在線購物推薦。然而&#xff0c;AI的影響遠不止于此。近年來&#xff0c;AI在圖像處理和計算機視覺領域的應用取得了顯著進…

c++字符串相關接口

c字符串相關接口 1.str2wstr(str轉換wstr)2.wstr2str(str轉換wstr)3.Utf8ToAsi(Utf8轉換ANSI)4.AsiToUtf8(ANSI轉換Utf8)5.stringformatA/stringformatW(按照指定的格式格式化字符串)6.GetStringBetween(獲取cStart cEnd之間的字符串)7.Char2Int(char轉int)8.Str2Bin(字符串轉換…

視覺語言大模型llava學習

1. 拉取 https://github.com/haotian-liu/LLaVA 視覺語言大模型是人工智能領域一種重要的多模態模型&#xff0c;它結合了計算機視覺&#xff08;CV&#xff09;和自然語言處理&#xff08;NLP&#xff09;的技術&#xff0c;使得模型能夠同時理解圖像和文本信息。這類模型在多…

hadoop部署

需要3臺機子&#xff0c;Linux為centos7 分別設置靜態ip&#xff0c;設置主機名,配置主機名映射&#xff0c;配置ssh免密登入 hadoop1 192.168.1.7 hadoop2 192.168.1.8 hadoop3 192.168.1.9 vi /etc/sysconfig/network-scripts/ifcfg-ens33TYPE"Ethernet" PROX…

Kotlin 泛型

文章目錄 定義泛型屬性泛型函數泛型類或接口 where 聲明多個約束泛型具體化in、out 限制泛型輸入輸出 定義 有時候我們會有這樣的需求&#xff1a;一個類可以操作某一類型的對象&#xff0c;并且限定只有該類型的參數才能執行相關的操作。 如果我們直接指定該類型Int&#xff…

機器人抓取檢測(Robot Grasping Detection)

目錄 前言 一、物體檢測 二、抓取點生成 三、運動規劃 四、控制 五、總結 前言 機器人抓取檢測&#xff08;Robot Grasping Detection&#xff09;是指通過計算機視覺和機器學習技術&#xff0c;自動識別并確定機器人如何抓取物體的一種技術。這個過程涉及多個步驟和關鍵…

【Python系列】Python 中方法定義與方法調用詳解

&#x1f49d;&#x1f49d;&#x1f49d;歡迎來到我的博客&#xff0c;很高興能夠在這里和您見面&#xff01;希望您在這里可以感受到一份輕松愉快的氛圍&#xff0c;不僅可以獲得有趣的內容和知識&#xff0c;也可以暢所欲言、分享您的想法和見解。 推薦:kwan 的首頁,持續學…

詳細介紹運算符重載函數,清晰明了

祝各位六一快樂~ 前言 1.為什么要進行運算符重載&#xff1f; C中預定義的運算符的操作對象只能是基本數據類型。但實際上&#xff0c;對于許多用戶自定義類型&#xff08;例如類&#xff09;&#xff0c;也需要類似的運算操作。這時就必須在C中重新定義這些運算符&#xff…

短信發送驗證碼及郵件發送驗證碼

發送短信驗證碼 阿里云發送驗證碼 public Integer sendTelCode(String tel) {String url "https://dfsns.market.alicloudapi.com/data/send_sms";String appcode "a3198282fbdf443d97aa9f3cfbe1232e";int code RandomUtil.randomInt(1000,10000);emai…

【DSP】xDAIS算法標準

1. 簡介 在安裝DSP開發支持包時&#xff0c;有名為 “xdais_7_21_01_07”文件夾。xDAIS全稱: TMS320 DSP Algorithm Standard(算法標準)。39條規則&#xff0c;15條指南。參考文檔。參考文章。 2. 三個層次 3.接口 XDAIS Digital Media。編解碼引擎。VISA&#xff08;Video&…

LeetCode前端刷題指南:探索四大領域,精通五大技能,掌握六大題型,運用七大策略

LeetCode前端刷題指南&#xff1a;探索四大領域&#xff0c;精通五大技能&#xff0c;掌握六大題型&#xff0c;運用七大策略 在前端開發的廣闊領域中&#xff0c;刷題是提高自身能力、深入理解算法和數據結構的重要途徑。LeetCode作為知名的在線刷題平臺&#xff0c;為前端開…

牛客小白月賽95VP

早上藍橋杯大寄&#xff0c;算是交了300元買了件T恤qaq 1.簽到&#xff1a;https://ac.nowcoder.com/acm/contest/83687/A 下面是AC代碼&#xff1a; #include<bits/stdc.h> using namespace std; int main() {int a,b;cin>>a>>b;if(ab) cout<<&quo…

簡述你對 SPA 單??的理解,它的優缺點分別是什么 ?

SPA&#xff08;Single-Page Application&#xff0c;單頁應用&#xff09;是一種在Web開發中廣泛使用的應用架構模式。它允許用戶通過交互操作來更新頁面的部分內容&#xff0c;而無需重新加載整個頁面。以下是關于SPA的理解、優點和缺點的簡要說明。 SPA的理解 SPA的核心思…