springboot + Vue前后端项目(第十四记)

项目实战第十三记

  • 写在前面
  • 1. 建立字典表
  • 2. 后端DictController
  • 3. Menu.vue
  • 4. 建立sys_role_menu中间表
  • 5.分配菜单接口
  • 6. 前端Role.vue改动
  • 总结
  • 写在最后

写在前面

本篇主要讲解动态分配菜单第二章节

  • 菜单页面优化
    引入图标在这里插入图片描述

  • 角色界面优化
    角色自主分配菜单,并保存至数据库
    在这里插入图片描述

1. 建立字典表


DROP TABLE IF EXISTS `sys_dict`;
CREATE TABLE `sys_dict`  (
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '名称',
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '内容',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '类型'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of sys_dict
-- ----------------------------
INSERT INTO `sys_dict` VALUES ('user', 'el-icon-user', 'icon');
INSERT INTO `sys_dict` VALUES ('user-solid', 'el-icon-user-solid', 'icon');
INSERT INTO `sys_dict` VALUES ('s-home', 'el-icon-s-home', 'icon');
INSERT INTO `sys_dict` VALUES ('menu', 'el-icon-menu', 'icon');
INSERT INTO `sys_dict` VALUES ('document', 'el-icon-document', 'icon');
INSERT INTO `sys_dict` VALUES ('map-location', 'el-icon-map-location', 'icon');

2. 后端DictController

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.IDictService;
import com.ppj.entity.Dict;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ppj
 * @since 2024-05-30
 */
@RestController
@RequestMapping("/dict")
public class DictController {

    @Resource
    private IDictService dictService;

    // 新增或者更新
    @PostMapping
    public Result save(@RequestBody Dict dict) {
        dictService.saveOrUpdate(dict);
        return Result.success();
    }

    @DeleteMapping("/{dictIds}")
    public Result delete(@PathVariable Integer[] dictIds) {
        dictService.removeByIds(Arrays.asList(dictIds));
        return Result.success();
    }

    @GetMapping
    public Result findAll() {
        return Result.success(dictService.list());
    }

    @GetMapping("/page")
    public Result findPage(@RequestParam Integer pageNum,
                                @RequestParam Integer pageSize) {
        QueryWrapper<Dict> queryWrapper = new QueryWrapper<>();
        return Result.success(dictService.page(new Page<>(pageNum, pageSize), queryWrapper));
    }

}

3. Menu.vue

<template>
  <div>
    <!-- 设计的查询 -->
    <div style="margin: 10px 0">
      <el-input
          style="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-column
          prop="name"
          label="菜单名称"
      ></el-table-column>
      <el-table-column
          prop="path"
          label="菜单路径"
      ></el-table-column>
      <el-table-column
          prop="icon"
          label="菜单图标"
      >
        <template v-slot="scope">
          <span :class="scope.row.icon" style="font-size: 20px;text-align: center"></span>
        </template>
      </el-table-column>
      <el-table-column prop="description" label="描述"></el-table-column>

      <el-table-column label="操作" width="300px">
        <template v-slot="scope">
          <el-button
              type="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-select clearable v-model="form.icon" placeholder="请选择" style="width: 100%">
            <el-option v-for="item in icons" :key="item.name" :label="item.name" :value="item.value">
              <i :class="item.value" /> {{ item.name }}
            </el-option>
          </el-select>
        </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: "",
      },
      // 图标集合
      icons: []
    };
  },
  //页面一创建成功
  created() {
    //请求分页查询数据
    this.getList();
    this.getIcons();
  },
  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){  // 新建子菜单时,设置父id
        this.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(() => {
      });
    },
    getIcons(){
      this.request.get("/dict").then(res => {
        if(res.code === "200"){
          this.icons = res.data
        }
      })
    }
  },
};
</script>

4. 建立sys_role_menu中间表


// 多对多   建立中间表,角色id和菜单id作为联合主键

CREATE TABLE `sys_role_menu` (
  `role_id` int(11) NOT NULL COMMENT '角色id',
  `menu_id` int(11) NOT NULL COMMENT '菜单id',
  PRIMARY KEY (`role_id`,`menu_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='角色菜单关系表'

5.分配菜单接口

RoleController

package com.ppj.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ppj.service.IRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

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 {

    @Resource
    private IRoleService roleService;

    @Autowired
    private IRoleMenuService roleMenuService;

    // 新增或者更新
    @PostMapping
    public 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();
    }

    @GetMapping
    public 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));
    }

    @PostMapping("/roleMenu/{roleId}")
    public Result saveRoleMenu(@PathVariable("roleId") Integer roleId, @RequestBody Integer[] menuIds){
        roleMenuService.saveRoleMenu(roleId,menuIds);
        return Result.success();
    }

    @GetMapping("/roleMenu/{roleId}")
    public Result getRoleMenu(@PathVariable("roleId") Integer roleId){
        return Result.success(roleMenuService.getRoleMenu(roleId));
    }

}

RoleMenuServiceImpl

package com.ppj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ppj.entity.RoleMenu;
import com.ppj.mapper.RoleMenuMapper;
import com.ppj.service.IRoleMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ppj
 * @since 2024-05-31
 */
@Service
@Transactional
public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> implements IRoleMenuService {

    @Autowired
    private RoleMenuMapper roleMenuMapper;

    @Override
    public void saveRoleMenu(Integer roleId, Integer[] menuIds) {
        // 先删除该角色所有的权限
        QueryWrapper<RoleMenu> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("role_id",roleId);
        roleMenuMapper.delete(queryWrapper);
        // 在添加新的权限
        RoleMenu roleMenu = new RoleMenu();
        for (Integer menuId : menuIds) {
            roleMenu.setRoleId(roleId);
            roleMenu.setMenuId(menuId);
            save(roleMenu);
        }
    }

    @Override
    public List<Integer> getRoleMenu(Integer roleId) {
        QueryWrapper<RoleMenu> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("role_id",roleId);
        List<RoleMenu> roleMenus = roleMenuMapper.selectList(queryWrapper);
        List<Integer> menuIds = roleMenus.stream().map(RoleMenu::getMenuId).collect(Collectors.toList());
        return menuIds;
    }
}

6. 前端Role.vue改动

<template>
  <div>
    <!-- 设计的查询 -->
    <div style="margin: 10px 0">
      <el-input
          style="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-button
              type="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-checkbox
          node-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: undefined,
    };
  },
  //页面一创建成功
  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(id){
      this.menuDialogVis = true;
      // 角色id赋值
      this.roleId = id;
      //请求菜单数据
      this.request.get("/menu",{
        params: {
          name: ""
        }
      }).then(res => {
        this.menuData = res.data;
        //展开菜单数据
        this.expends = this.menuData.map(v => v.id);
      })
      // 展开已拥有的菜单
      this.request.get("/role/roleMenu/"+id).then(res => {
        this.checks = res.data;
      })
    },
    //保存角色下的菜单
    saveRoleMenu(){
      this.request.post("/role/roleMenu/"+ this.roleId, this.$refs.tree.getCheckedKeys()).then(res => {
        if(res.code === "200"){
          this.$message.success("保存成功");
          this.menuDialogVis = false;
        }else {
          this.$message.error("保存失败");
        }
      })
    },
    // 重置按钮
    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>

总结

  • 本篇主要优化菜单页面和角色页面

写在最后

如果此文对您有所帮助,请帅戈靓女们务必不要吝啬你们的Zan,感谢!!不懂的可以在评论区评论,有空会及时回复。
文章会一直更新

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/675482.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

PTA字符串str1在第i个位置插入字符串str2

字符串str1在第i个位置插入字符串str2&#xff0c;如在字符串1234567890第2位插入ABC。 输入格式: 1234567890 ABC 2 输出格式: 12ABC34567890 #include<stdio.h> #include<string.h> int main() {char s1[100],s2[100];int w;scanf("%s%s%d",s1,s2,…

Docker 基础使用(2) 镜像与容器

文章目录 镜像的含义镜像的构成镜像的作用镜像的指令容器的含义容器的状态容器的指令 Docker 基础使用&#xff08;0&#xff09;基础认识 Docker 基础使用 (1) 使用流程概览 Docker 基础使用&#xff08;2&#xff09; 镜像与容器 Docker 基础使用&#xff08;3&#xff09; 存…

关于stm32的复用和重映射问题

目录 需求IO口的复用和重映射使用复用复用加重映射 总结参考资料 需求 一开始使用stm32c8t6&#xff0c;想实现pwm输出&#xff0c;但是原电路固定在芯片的引脚PB10和PB11上&#xff0c;查看了下引脚的功能&#xff0c;需要使用到复用功能。让改引脚作为定时器PWM的输出IO口。…

tinyrenderer-切线空间法线贴图

法线贴图 法线贴图分两种&#xff0c;一种是模型空间中的&#xff0c;一种是切线空间中的 模型空间中的法线贴图的rgb代表着每个渲染像素法线的xyz&#xff0c;与顶点坐标处于一个空间&#xff0c;图片是五颜六色的。 切线空间中的法线贴图的rgb同样对应xyz&#xff0c;是切线…

排序算法(C++)

参考C算法&#xff0c;这里面有些写法也值得商榷。 1. 冒泡排序算法 冒泡排序算法代码和思路比较简单&#xff0c;大家如果在面试时被要求实现排序时&#xff0c;可以用这种方法来实现。 该算法里&#xff0c;会统一地遍历待排序的数据&#xff0c;每次比较两个相邻的数据&a…

零基础也能学!在RK平台下的OpenHarmony分区镜像烧录

开源鸿蒙硬件方案领跑者 触觉智能 本文适用于在Purple Pi OH开发板进行分区镜像烧录。触觉智能的Purple Pi OH鸿蒙开源主板&#xff0c;是华为Laval官方社区主荐的一款鸿蒙开发主板。 该主板主要针对学生党&#xff0c;极客&#xff0c;工程师&#xff0c;极大降低了开源鸿蒙开…

【Java】设计一个支持敏感数据存储和传输安全的加解密平台

一、问题解析 在一个应用系统运行过程中&#xff0c;需要记录、传输很多数据&#xff0c;这些数据有的是非常敏感的&#xff0c;比如用户姓名、手机号码、密码、甚至信用卡号等等。这些数据如果直接存储在数据库&#xff0c;记录在日志中&#xff0c;或者在公网上传输的话&…

极海APM32F072用Keil5烧录失败Error: Flash Download failed -“Cortex-MO+“

在用Keil5烧录时&#xff0c;出现错误弹窗&#xff0c;大概长这样&#xff1a; 检查了一圈设置&#xff0c;都搞不好。 先用J-Flash&#xff0c;显示读写保护&#xff08;未截图&#xff09;&#xff0c;会跳出界面让选择是否解除读写保护&#xff1a; 1.点击允许读操作YES&am…

循环购模式!增加用户复购的不二之选!

大家好&#xff0c;我是吴军&#xff0c;来自一家专注于软件开发与商业模式设计的公司。我们主要业务是构建商城系统&#xff0c;并为各类企业提供全面的商业模式解决方案。目前&#xff0c;我们已经成功开发了超过200种独特的商业模式&#xff0c;帮助许多企业实现了他们的商业…

C++_deque:deque的数据结构特点

文章目录 &#x1f680;1. deque介绍&#x1f680;2. deque数据结构&#x1f680;3. deque的缺陷&#x1f680;4.为什么选择deque作为stack和queue的底层默认容器&#x1f680;5.deque头插逻辑&#xff08;了解&#xff09; 大家好&#xff01;本文会简单讲讲deque的使用与数据…

实现流程化办公,可以相信拖拽表单设计器!

当前&#xff0c;竞争压力越来越大&#xff0c;利用什么样优良的办公软件实现流程化办公&#xff1f;可以一起来了解低代码技术平台、拖拽表单设计器的优势特点&#xff0c;看看它们是如何助力企业降本、增效、提质的。低代码技术平台的优势特点多&#xff0c;可以助力企业用拖…

第99天:权限提升-数据库提权口令获取MYSQLMSSQLOracleMSF

案例一&#xff1a;提权条件-数据库帐号密码获取方式 提权条件 - 数据库帐号密码获取方式 0 、网站存在高权限 SQL 注入点 1 、数据库的存储文件或备份文件 2 、网站应用源码中的数据库配置文件 3 、采用工具或脚本爆破 ( 需解决外联问题 ) sql注入点 xhcms后台管理系统…

刷新页面控制台莫名奇妙报错显示/files/test_files/file_txt.txt

今天突然发现每次刷新页面都有几个报错&#xff0c;不刷新页面就没有。 这个报错应该不是我们系统的问题&#xff0c;是因为装了浏览器插件的原因。比如我安装了 大家有没有遇到类似的问题。

MyBatis快速入门教程

文章目录 一、介绍什么是持久层为什么要学MyBatis&#xff1f; 二、如何获得MyBatis&#xff1f;三、第一个Mybatis程序数据库导入maven依赖bean 实体类dao持久层resources编写对应的映射文件 mybatis主配置文件测试类运行遇到报错Could not find resource com/qibu/dao/IUserD…

Park Here:城市停车新神器,让停车不再难

在现代城市的快节奏生活中&#xff0c;停车问题往往成为驾驶者的一大困扰。无论是寻找停车位时的焦虑&#xff0c;还是对停车规则的不了解&#xff0c;都让停车变得不那么简单。然而&#xff0c;随着科技的发展&#xff0c;一款名为“Park Here”的移动应用程序正逐渐改变这一现…

论文精读--Swin Transformer

想让ViT像CNN一样分成几个block&#xff0c;做层级式的特征提取&#xff0c;从而使提取出的特征有多尺度的概念 Abstract This paper presents a new vision Transformer, called Swin Transformer, that capably serves as a general-purpose backbone for computer vision. …

做了几年的广告设计,发现一些东西

我换了多个行业&#xff0c;发现了一些广告设计的一些行业规律&#xff0c;先从面试说起。 他们面试比较倾向是本行业的&#xff0c;找到他们去当前公司来当设计&#xff0c;但是重点&#xff1b;还是不喜欢我这种经常被试用期不合格的情况。 还有甲方公司&#xff0c;经常需要…

【机器学习】【遗传算法】【项目实战】药品分拣的优化策略【附Python源码】

仅供学习、参考使用 一、遗传算法简介 遗传算法&#xff08;Genetic Algorithm, GA&#xff09;是机器学习领域中常见的一类算法&#xff0c;其基本思想可以用下述流程图简要表示&#xff1a; &#xff08;图参考论文&#xff1a;Optimization of Worker Scheduling at Logi…

EMQX Enterprise 5.7 发布:新增会话持久化、消息 Schema 验证、规则引擎调试与追踪功能

EMQX Enterprise 5.7.0 版本现已正式发布&#xff01; 在这个版本中&#xff0c;我们引入了一系列新的功能和改进&#xff0c;包括会话持久化、消息 Schema 验证、规则引擎调试与追踪测试等功能。此外&#xff0c;新版本还进行了多项改进以及 BUG 修复&#xff0c;进一步提升了…

QT 编译Lua 动态库,使用Lua脚本混合编程

一,编译Lua动态库 1,下载lua源码 地址:Lua: downloadhttps://www.lua.org/download.html 2,配置 解压lua源码压缩包,里面有个src文件夹,里面的代码就是lua的源码