当前位置: 首页 > news >正文

基于Ant DesignPro Vue实现通过SpringBoot后台加载自定义菜单- 前后端分离

基于Ant DesignPro Vue实现通过SpringBoot后台加载自定义菜单- 前后端分离

本文想基于Ant DesignPro Vue构建的前端+SpringBoot实现的后端接口服务,实现前后端分离开发和独立运行,业务场景是登录认证,认证成功后返回该用户相应权限范围内可见的菜单。

Ant Design Pro相关系列文章:
一、AntDesign Pro安装过程
二、基于Ant DesignPro实现通过SpringBoot后台加载自定义菜单-前端部分
三、基于Ant DesignPro实现通过SpringBoot后台加载自定义菜单-SpringBoot后端部分
四、搭建Vue版Ant Design Pro后台管理系统
五、基于Ant DesignPro Vue实现通过SpringBoot后台加载自定义菜单- 前后端分离

目录

  • 基于Ant DesignPro Vue实现通过SpringBoot后台加载自定义菜单- 前后端分离
  • 一、通过Ant DesignPro Vue构建前端
  • 二、Ant DesignPro Vue前端对接后台服务接口
    • 1、去掉Mock
    • 2、vue.config.js 中配置api代理
    • 3、修改菜单加载是从后台服务接口请求
  • 三、创建Ant DesignPro后台服务SpringBoot项目
    • 1. File->New->Project
    • 2.编辑pom.xml,添加需要的依赖
    • 3.编辑application.properties
    • 4.创建依赖的实体类
      • 4.1 登录请求实体类UserLoginDto.java
      • 4.2 向前端画面传输的用户信息实体类 UserVo.java
      • 4.3 菜单实体类MenuVo.java
      • 4.4 菜单项实体类MenuMetaVo.java
    • 5.创建登录认证(/api/auth/)接口响应处理类
    • 6.创建用户(/api/user/)接口响应处理类
    • 7.创建Account(/api/account)接口响应处理类
  • 四、验证
    • 1.启动服务端
    • 2.启动前端
    • 3.访问前端画面

一、通过Ant DesignPro Vue构建前端

参见 搭建Vue版Ant Design Pro后台管理系统

二、Ant DesignPro Vue前端对接后台服务接口

1、去掉Mock

编辑src/main.js,把mock注释
在这里插入图片描述

2、vue.config.js 中配置api代理

在这里插入图片描述

说明:
上面target配置属性是指后台服务接口URL,默认格式为:target指定的Ulr/api/请求接口

在这里插入图片描述

3、修改菜单加载是从后台服务接口请求

在这里插入图片描述

三、创建Ant DesignPro后台服务SpringBoot项目

1. File->New->Project

第一步第二步
第三步
第四步

2.编辑pom.xml,添加需要的依赖

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.5.5</version><relativePath/></parent><groupId>cn.chinaelink.im</groupId><artifactId>mcvboot</artifactId><version>0.0.1-SNAPSHOT</version><name>mcboot</name><description>Demo project for Spring Boot</description><properties><java.version>1.8</java.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><!-- 热部署加入的引用,1.spring-boot-devtools--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId></dependency><!--json需要的依赖 --><dependency><groupId>net.sf.json-lib</groupId><artifactId>json-lib-ext-spring</artifactId><version>1.0.2</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><!--重点:模板引擎,用于显示网页需要的依赖,如果不需要将静态页面放入当前工程,则不需要解注下面依赖--><!-- 如果要在当前工程中加入静态页面,首先需要解注下面依赖,并在src/main/resources/目录下创建static和templates目录--><!--<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>--></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><includeSystemScope>true</includeSystemScope></configuration></plugin></plugins></build>
</project>

3.编辑application.properties

#配置管理服务端口号,默认为8080
server.port=8080
#服务访问路径
server.servlet.context-path=/# 输出的log文件名
logging.file.name=mc
# 输出的文件的路径
logging.file.path=./logs/mcv/
# 限制日志文件的大小
logging.file.max-size=10MB
# 日志的保存天数
logging.file.max-history=7# 输出级别
logging.level.root=warn
logging.level.cn.com.hxyl.filebs=debug# xml配置文件
logging.config=classpath:logback-spring.xml#关闭缓存
#如果不需要将静态页面放入当前工程,则不需要解注下面依赖
#如果要在当前工程中加入静态页面,首先需要解注下面依赖,并将静态页面文件放入src/main/resources/static/目录下
#spring.thymeleaf.cache=false
#spring.thymeleaf.prefix=classpath:/static/
server.tomcat.threads.max=100
server.tomcat.threads.min-spare=30#开启项目热部署
spring.devtools.restart.enabled=true

4.创建依赖的实体类

在这里插入图片描述

4.1 登录请求实体类UserLoginDto.java

package cn.chinaelink.im.mcvboot.dto;import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;@AllArgsConstructor
@NoArgsConstructor
@Data
public class UserLoginDto {// 用户名private String username;// 密码private String password;// 手机号private String mobile;// 验证码private String captcha;
}

4.2 向前端画面传输的用户信息实体类 UserVo.java

package cn.chinaelink.im.mcvboot.vo;import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;@AllArgsConstructor
@NoArgsConstructor
@Data
public class UserVo {private String id;private String name;private String username;private String password;private String avatar;private int status;private String telephone;private String lastLoginIp;private long lastLoginTime;private String creatorId;private long createTime;private int deleted;private String roleId;private String lang;private String token;
}

4.3 菜单实体类MenuVo.java

package cn.chinaelink.im.mcvboot.vo.menu;import lombok.Data;@Data
public class MenuVo {private String name;private int id;private int parentId;private String component;private String redirect;private String path;private MenuMetaVo meta;
}

4.4 菜单项实体类MenuMetaVo.java

package cn.chinaelink.im.mcvboot.vo.menu;import lombok.Data;@Data
public class MenuMetaVo {private String title;private String icon;private String target;private boolean show;
}

5.创建登录认证(/api/auth/)接口响应处理类

所以有接口实现都是参见src/mock/services/目录的相应的模拟接口js的结果定义的

在这里插入图片描述

AuthController类

import cn.chinaelink.im.mcvboot.dto.UserLoginDto;
import cn.chinaelink.im.mcvboot.vo.UserVo;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;import java.util.Optional;
import java.util.Random;
import java.util.UUID;@Controller
@Slf4j
@RequestMapping("/api/auth")
public class AuthController {@PostMapping("/login")@ResponseBodypublic String login(@RequestBody UserLoginDto userLoginDto) {JSONObject resJson = new JSONObject();if (Optional.ofNullable(userLoginDto.getUsername()).isPresent() &&("ant.design".equals(userLoginDto.getPassword()) ||"admin".equals(userLoginDto.getUsername()))) {UserVo userVo = getAdminUserVo();resJson.put("result",JSONObject.fromObject(userVo).toString());resJson.put("message","认证成功");resJson.put("code",200);resJson.put("_status", 200);resJson.put("token",userVo.getToken());return resJson.toString();} else if(Optional.ofNullable(userLoginDto.getMobile()).isPresent()){UserVo userVo =  getAdminUserVo();resJson.put("result",JSONObject.fromObject(userVo).toString());resJson.put("message","认证成功");resJson.put("code",200);resJson.put("_status", 200);resJson.put("token",userVo.getToken());return resJson.toString();}JSONObject result = new JSONObject();result.put("isLogin", true);resJson.put("result",result);resJson.put("message","错误的用户名和密码,请确认后重试!");resJson.put("code",401);resJson.put("_status", 401);return resJson.toString();}@PostMapping("/2step-code")@ResponseBodypublic JSONObject twoFactor() {JSONObject resJson = new JSONObject();JSONObject dataJson = new JSONObject();dataJson.put("stepCode",new Random().nextInt(1));resJson.put("result", dataJson);return resJson;}@PostMapping("/logout")@ResponseBodypublic JSONObject logout() {JSONObject data = new JSONObject();data.put("result", new JSONObject());data.put("message", "");return data;}private UserVo getAdminUserVo() {UserVo userVo = new UserVo();userVo.setId(UUID.randomUUID().toString());userVo.setName("超级管理员");userVo.setUsername("admin");userVo.setAvatar("https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png");userVo.setStatus(1);userVo.setLastLoginTime(System.currentTimeMillis());userVo.setCreatorId("admin");userVo.setCreateTime(System.currentTimeMillis());userVo.setRoleId("admin");userVo.setLang("zh-CN");userVo.setToken("4291d7da9005377ec9aec4a71ea837f");return userVo;}
}

6.创建用户(/api/user/)接口响应处理类

package cn.chinaelink.im.mcvboot.controller.api;import cn.chinaelink.im.mcvboot.vo.menu.MenuMetaVo;
import cn.chinaelink.im.mcvboot.vo.menu.MenuVo;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;import java.util.ArrayList;
import java.util.List;@Controller
@Slf4j
@RequestMapping("/api/user")
public class UserController {@RequestMapping("/info")@ResponseBodypublic JSONObject info(){JSONObject userInfoJson = new JSONObject();userInfoJson.put("id", "4291d7da9005377ec9aec4a71ea837f");userInfoJson.put("name", "天野远子");userInfoJson.put("username", "admin");userInfoJson.put("password", "");userInfoJson.put("avatar", "/avatar2.jpg'");userInfoJson.put("status", 1);userInfoJson.put("telephone", "");userInfoJson.put("lastLoginIp", "27.154.74.117");userInfoJson.put("lastLoginTime", 1534837621348L);userInfoJson.put("creatorId", "admin'");userInfoJson.put("createTime", 1497160610259L);userInfoJson.put("merchantCode", "TLif2btpzg079h15bk'");userInfoJson.put("deleted", 0);userInfoJson.put("roleId", "admin'");JSONObject roleObj = new JSONObject();roleObj.put("id","admin");roleObj.put("name","管理员");roleObj.put("describe","拥有所有权限");roleObj.put("status", 1);roleObj.put("creatorId","system");roleObj.put("createTime",1497160610259L);roleObj.put("deleted", 0);JSONArray permissionArray = new JSONArray();JSONObject permission1 = new JSONObject();permission1.put("roleId","admin");permission1.put("permissionId","dashboard");permission1.put("permissionName","仪表盘");permission1.put("actions","[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]");JSONArray actionEntitySet = new JSONArray();JSONObject actionEntity1 = new JSONObject();actionEntity1.put("action", "add");actionEntity1.put("describe", "新增");actionEntity1.put("defaultCheck", false);actionEntitySet.add(actionEntity1);JSONObject actionEntity2 = new JSONObject();actionEntity2.put("action", "query");actionEntity2.put("describe", "查询");actionEntity2.put("defaultCheck", false);actionEntitySet.add(actionEntity2);JSONObject actionEntity3 = new JSONObject();actionEntity3.put("action", "get");actionEntity3.put("describe", "详情");actionEntity3.put("defaultCheck", false);actionEntitySet.add(actionEntity3);JSONObject actionEntity4 = new JSONObject();actionEntity4.put("action", "update");actionEntity4.put("describe", "修改");actionEntity4.put("defaultCheck", false);actionEntitySet.add(actionEntity4);JSONObject actionEntity5 = new JSONObject();actionEntity5.put("action", "delete");actionEntity5.put("describe", "删除");actionEntity5.put("defaultCheck", false);actionEntitySet.add(actionEntity5);permission1.put("actionEntitySet", actionEntitySet);permission1.put("actionList", null);permission1.put("dataAccess", null);permissionArray.add(permission1);JSONObject permission2 = new JSONObject();permission2.put("roleId","admin");permission2.put("permissionId","exception");permission2.put("permissionName","异常页面权限");permission2.put("actions","[{\"action\":\"add\",\"defaultCheck\":false,\"describe\":\"新增\"},{\"action\":\"query\",\"defaultCheck\":false,\"describe\":\"查询\"},{\"action\":\"get\",\"defaultCheck\":false,\"describe\":\"详情\"},{\"action\":\"update\",\"defaultCheck\":false,\"describe\":\"修改\"},{\"action\":\"delete\",\"defaultCheck\":false,\"describe\":\"删除\"}]");JSONArray actionEntitySet2 = new JSONArray();JSONObject actionEntity21 = new JSONObject();actionEntity21.put("action", "add");actionEntity21.put("describe", "新增");actionEntity21.put("defaultCheck", false);actionEntitySet2.add(actionEntity21);JSONObject actionEntity22 = new JSONObject();actionEntity22.put("action", "query");actionEntity22.put("describe", "查询");actionEntity22.put("defaultCheck", false);actionEntitySet2.add(actionEntity22);JSONObject actionEntity23 = new JSONObject();actionEntity23.put("action", "get");actionEntity23.put("describe", "详情");actionEntity23.put("defaultCheck", false);actionEntitySet2.add(actionEntity23);JSONObject actionEntity24 = new JSONObject();actionEntity24.put("action", "update");actionEntity24.put("describe", "修改");actionEntity24.put("defaultCheck", false);actionEntitySet2.add(actionEntity24);JSONObject actionEntity25 = new JSONObject();actionEntity25.put("action", "delete");actionEntity25.put("describe", "删除");actionEntity25.put("defaultCheck", false);actionEntitySet2.add(actionEntity25);permission2.put("actionEntitySet", actionEntitySet2);permission2.put("actionList", null);permission2.put("dataAccess", null);permissionArray.add(permission2);roleObj.put("permissions", permissionArray);userInfoJson.put("role", roleObj);JSONObject body = new JSONObject();body.put("result", userInfoJson);return body;}@RequestMapping("/nav")@ResponseBodypublic JSONObject getUserMenus(){List<MenuVo> dataArray = new ArrayList<>();MenuVo menu1 = new MenuVo();menu1.setId(1);menu1.setParentId(0);menu1.setName("dashboard");menu1.setComponent("RouteView");menu1.setRedirect("/dashboard/workplace");MenuMetaVo meta1 = new MenuMetaVo();meta1.setTitle("menu.dashboard");meta1.setIcon("dashboard");meta1.setShow(true);menu1.setMeta(meta1);dataArray.add(menu1);MenuVo menu2 = new MenuVo();menu2.setId(7);menu2.setParentId(1);menu2.setName("workplace");menu2.setComponent("Workplace");MenuMetaVo meta2 = new MenuMetaVo();meta2.setTitle("menu.dashboard.monitor");meta2.setShow(true);menu2.setMeta(meta2);dataArray.add(menu2);MenuVo menu3 = new MenuVo();menu3.setId(3);menu3.setParentId(1);menu3.setName("monitor");menu3.setPath("https://www.baidu.com/");MenuMetaVo meta3 = new MenuMetaVo();meta3.setTitle("menu.dashboard.workplace");meta3.setTarget("_blank");meta3.setShow(true);menu3.setMeta(meta3);dataArray.add(menu3);MenuVo menu4 = new MenuVo();menu4.setId(2);menu4.setParentId(1);menu4.setName("Analysis");menu4.setComponent("Analysis");menu4.setPath("/dashboard/analysis");MenuMetaVo meta4 = new MenuMetaVo();meta4.setTitle("menu.dashboard.analysis");meta4.setShow(true);menu4.setMeta(meta4);dataArray.add(menu4);// FormMenuVo menu5 = new MenuVo();menu5.setId(10);menu5.setParentId(0);menu5.setName("form");menu5.setComponent("RouteView");menu5.setRedirect("/form/base-form");MenuMetaVo meta5 = new MenuMetaVo();meta5.setTitle("menu.form");meta5.setIcon("form");menu5.setMeta(meta5);dataArray.add(menu5);MenuVo menu6 = new MenuVo();menu6.setId(6);menu6.setParentId(10);menu6.setName("basic-form");menu6.setComponent("BasicForm");MenuMetaVo meta6 = new MenuMetaVo();meta6.setTitle("menu.form.basic-form");menu6.setMeta(meta6);dataArray.add(menu6);MenuVo menu7 = new MenuVo();menu7.setId(5);menu7.setParentId(10);menu7.setName("step-form");menu7.setComponent("StepForm");MenuMetaVo meta7 = new MenuMetaVo();meta7.setTitle("menu.form.step-form");menu7.setMeta(meta7);dataArray.add(menu7);MenuVo menu8 = new MenuVo();menu8.setId(4);menu8.setParentId(10);menu8.setName("advanced-form");menu8.setComponent("AdvanceForm");MenuMetaVo meta8 = new MenuMetaVo();meta8.setTitle("menu.form.advanced-form");menu8.setMeta(meta8);dataArray.add(menu8);// ListMenuVo menu9 = new MenuVo();menu9.setId(10010);menu9.setParentId(0);menu9.setName("list");menu9.setComponent("RouteView");menu9.setRedirect("/list/table-list");MenuMetaVo meta9 = new MenuMetaVo();meta9.setTitle("menu.list");meta9.setIcon("table");meta9.setShow(true);menu9.setMeta(meta9);dataArray.add(menu9);MenuVo menu10 = new MenuVo();menu10.setId(10011);menu10.setParentId(10010);menu10.setName("table-list");menu10.setComponent("TableList");menu10.setPath("/list/table-list/:pageNo([1-9]\\d*)?");MenuMetaVo meta10 = new MenuMetaVo();meta10.setTitle("menu.list.table-list");meta10.setShow(true);menu10.setMeta(meta10);dataArray.add(menu10);MenuVo menu11 = new MenuVo();menu11.setId(10012);menu11.setParentId(10010);menu11.setName("basic-list");menu11.setComponent("StandardList");MenuMetaVo meta11 = new MenuMetaVo();meta11.setTitle("menu.list.basic-list");meta11.setShow(true);menu11.setMeta(meta11);dataArray.add(menu11);JSONObject body = new JSONObject();body.put("result", dataArray);return body;}
}

7.创建Account(/api/account)接口响应处理类

package cn.chinaelink.im.mcvboot.controller.api;import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;import java.util.Random;@Controller
@Slf4j
@RequestMapping("/api/account")
public class AccountController {@RequestMapping("/sms")@ResponseBodypublic String smsCaptcha() {Random random = new Random();int num = random.nextInt(89999) + 10000;JSONObject data = new JSONObject();data.put("captcha", num);JSONObject response = new JSONObject();response.put("result", data);return response.toString();}
}

四、验证

1.启动服务端

在这里插入图片描述

启动成功后可以通过浏览器访问http://127.0.0.1:8080/

2.启动前端

在命令行进入前端代码所在目录后,执行下面的命令

D:\work\JavaTeam\workspace\IdeaProjects\antDesignPro\antdvPromc> yarn run serve

在这里插入图片描述

3.访问前端画面

在这里插入图片描述
在这里插入图片描述

说明:
通过访问,前端已正常通过http://192.168.0.100:8080这个后端服务接口登录认证成功,并成功的获取到后台返回的菜单(只返回了两项一级菜单)

相关文章:

基于Ant DesignPro Vue实现通过SpringBoot后台加载自定义菜单- 前后端分离

基于Ant DesignPro Vue实现通过SpringBoot后台加载自定义菜单- 前后端分离 本文想基于Ant DesignPro Vue构建的前端SpringBoot实现的后端接口服务&#xff0c;实现前后端分离开发和独立运行&#xff0c;业务场景是登录认证&#xff0c;认证成功后返回该用户相应权限范围内可见的…...

Acwing---843. n-皇后问题

n-皇后问题1.题目2.基本思想3.代码实现1.题目 n−皇后问题是指将 n 个皇后放在 nn 的国际象棋棋盘上&#xff0c;使得皇后不能相互攻击到&#xff0c;即任意两个皇后都不能处于同一行、同一列或同一斜线上。 现在给定整数 n&#xff0c;请你输出所有的满足条件的棋子摆法。 …...

彻底搞清楚内存泄漏的原因,如何避免内存泄漏,如何定位内存泄漏

作为C/C开发人员&#xff0c;内存泄漏是最容易遇到的问题之一&#xff0c;这是由C/C语言的特性引起的。C/C语言与其他语言不同&#xff0c;需要开发者去申请和释放内存&#xff0c;即需要开发者去管理内存&#xff0c;如果内存使用不当&#xff0c;就容易造成段错误(segment fa…...

自动驾驶目标检测项目实战——基于深度学习框架yolov的交通标志检测

自动驾驶目标检测项目实战——基于深度学习框架yolov的交通标志检测 目前目标检测算法有很多&#xff0c;流行的就有faster-rnn和yolov&#xff0c;本文使用了几年前的yolov3框架进行训练&#xff0c;效果还是很好&#xff0c;当然也可以使用更高版本的Yolov进行实战。本代码使…...

flink兼容性验证

flink介绍&#xff1a;https://blog.csdn.net/weixin_43563705/article/details/107604693 一、安装启动 安装flink及其依赖 yum install java-1.8.0-openjdk curl tar mkdir -p /usr/local/flink wget https://mirrors.aliyun.com/apache/flink/flink-1.16.1/flink-1.16.1-bi…...

智慧工厂数字孪生可视化监测系统有效提升厂区安全管控效力

我国制造业正处于产业升级的关键时期&#xff0c;基于数据进行生产策略制定与管理是大势所趋&#xff0c;而数据可视化以更直观的方式成为数据分析传递信息的重要工具。 深圳华锐视点通过三维可视化手段对工厂各类设备进行三维建模&#xff0c;真实复现设备设施外观、结构、运转…...

c++中基本类型详细解释外加基本运算规则

&#x1f440;&#x1f440;#c中包括算数类型和空类型。 类型含义wchat_t宽字符bool布尔类型char字符chat16_tunicode字符chat_32unicode字符short短整型int整形long长整型longlong长整型float单精度浮点型double双精度浮点型longdouble扩展精度浮点型 &#x1f440;&#x1f…...

扬帆优配“机器人+”方案加码产业发展,这些股有望高增长

“机器人”发明新需求&#xff0c;2022年中国机器人市场规模约为174亿美元。 美国时刻3月1日&#xff0c;特斯拉在得克萨斯州超级工厂举办投资者日活动&#xff0c;展示了人形机器人Optimus的视频&#xff0c;更夸大的是&#xff0c;视频中的机器人好像在制作另一个机器人&…...

推送投票制作微信推送里投票制作教程在线投票活动制作

近些年来&#xff0c;第三方的微信投票制作平台如雨后春笋般络绎不绝。随着手机的互联网的发展及微信开放平台各项基于手机能力的开放&#xff0c;更多人选择微信投票小程序平台&#xff0c;因为它有非常大的优势。1.它比起微信公众号自带的投票系统、传统的H5投票系统有可以图…...

【架构师】跟我一起学架构——微服务分层监控

博客昵称&#xff1a;架构师Cool 最喜欢的座右铭&#xff1a;一以贯之的努力&#xff0c;不得懈怠的人生。 作者简介&#xff1a;一名Coder&#xff0c;软件设计师/鸿蒙高级工程师认证&#xff0c;在备战高级架构师/系统分析师&#xff0c;欢迎关注小弟&#xff01; 博主小留言…...

Linux:https静态网站搭建案例

目录介绍httpshttps通信过程例介绍https 整个实验是在http实验基础上进行的 因为http协议在传输的时候采用的是明文传输&#xff0c;有安全隐患&#xff0c;所以出现了https&#xff08;安全套接字层超文本传输协议&#xff09; HTTPS并不是一个新协议&#xff0c; 而是HTTP…...

前端css整理

如何水平垂直居中一个盒子&#xff1f; 1.已知高度&#xff1a;子盒子设置 display: inline-block; 父盒子设置 line-height 等于高度实现垂直居中&#xff1b;使用 text-align:center实现水平居中 2.父盒子 display:flex; align-items:center;justify-content:center; 3.定位&…...

混凝土搅拌站远程监控解决方案

一、项目背景 随着大规模的基础设施建设&#xff0c;对混凝土搅拌设备的需求量日益增加&#xff0c;对其技术指标的要求也日益提高&#xff0c;其技术性能将直接关系到工程的质量和使用寿命。而混凝土生产的质量是在生产过程中形成的&#xff0c;而非最终强度的检测。混凝土生…...

Spark SQL 学习总结

文章目录&#xff08;一&#xff09;Spark SQL&#xff08;二&#xff09;SParkSession&#xff08;三&#xff09;DataFrame常见算子操作&#xff08;四&#xff09;DataFrame的sql操作&#xff08;五&#xff09;RDD转换为DataFrame&#xff08;1&#xff09;反射方式&#x…...

深度学习 - 37.TF x Keras Deep Cross Network DCN 实现

目录 一.引言 二.模型简介 1.Embedding and stacking layer 2.Cross Network 2.1 模型架构分析 2.2 计算逻辑...

Ubuntu中使用Synaptic进行包管理

Synaptic概况 Synaptic 是一个轻量级的 apt 软件包管理器系统的 GUI 前端&#xff0c;所有你可以在终端中使用 apt-get 命令来做的事&#xff0c;都可以通过 Synaptic 来实现。优势 图形化安装界面&#xff0c;同时可以安装配置相关依赖&#xff0c;避免由于依赖问题导致的各类…...

python之selenium库安装及用法(定位法、获取文本、文本框输入、鼠标点击、滑动滚动条)

一、selenium库安装 pip install selenium二、浏览器驱动安装 谷歌浏览器驱动下载地址&#xff1a;https://chromedriver.storage.googleapis.com/index.html 根据你电脑的谷歌浏览器版本&#xff0c;下载相应的就行。我下载的是110.0.5481.XX中的chromedriver_win32.zip 下载…...

FPGA纯verilog实现图像视频旋转 串口指令控制旋转角度 提供工程源码和技术支持

目录1、前言2、理论基础3、设计思路和框架图像输入和采集图像旋转处理图像缓存图像输出4、vivado工程详解5、上板调试验证6、福利&#xff1a;工程代码的获取1、前言 图像旋转是一种常用的图像处理技术&#xff0c;其基本原理就是指图像以某一点为中心旋转一定的角度&#xff…...

EventGraph:Event Extraction as Semantic Graph Parsing 论文解读

EventGraph: Event Extraction as Semantic Graph Parsing 论文&#xff1a;2022.case-1.2.pdf (aclanthology.org) 代码&#xff1a;huiling-y/EventGraph (github.com) 期刊/会议&#xff1a;CASE 2022 摘要 事件抽取涉及到事件触发词和相应事件论元的检测和抽取。现有系…...

【蓝桥杯集训·每日一题】AcWing 3696. 构造有向无环图

文章目录一、题目1、原题链接2、题目描述二、解题报告1、思路分析2、时间复杂度3、代码详解三、知识风暴拓扑排序一、题目 1、原题链接 3696. 构造有向无环图 2、题目描述 给定一个由 n 个点和 m 条边构成的图。 不保证给定的图是连通的。 图中的一部分边的方向已经确定&#…...

基于算法竞赛的c++编程(28)结构体的进阶应用

结构体的嵌套与复杂数据组织 在C中&#xff0c;结构体可以嵌套使用&#xff0c;形成更复杂的数据结构。例如&#xff0c;可以通过嵌套结构体描述多层级数据关系&#xff1a; struct Address {string city;string street;int zipCode; };struct Employee {string name;int id;…...

在软件开发中正确使用MySQL日期时间类型的深度解析

在日常软件开发场景中&#xff0c;时间信息的存储是底层且核心的需求。从金融交易的精确记账时间、用户操作的行为日志&#xff0c;到供应链系统的物流节点时间戳&#xff0c;时间数据的准确性直接决定业务逻辑的可靠性。MySQL作为主流关系型数据库&#xff0c;其日期时间类型的…...

linux之kylin系统nginx的安装

一、nginx的作用 1.可做高性能的web服务器 直接处理静态资源&#xff08;HTML/CSS/图片等&#xff09;&#xff0c;响应速度远超传统服务器类似apache支持高并发连接 2.反向代理服务器 隐藏后端服务器IP地址&#xff0c;提高安全性 3.负载均衡服务器 支持多种策略分发流量…...

Prompt Tuning、P-Tuning、Prefix Tuning的区别

一、Prompt Tuning、P-Tuning、Prefix Tuning的区别 1. Prompt Tuning(提示调优) 核心思想:固定预训练模型参数,仅学习额外的连续提示向量(通常是嵌入层的一部分)。实现方式:在输入文本前添加可训练的连续向量(软提示),模型只更新这些提示参数。优势:参数量少(仅提…...

三维GIS开发cesium智慧地铁教程(5)Cesium相机控制

一、环境搭建 <script src"../cesium1.99/Build/Cesium/Cesium.js"></script> <link rel"stylesheet" href"../cesium1.99/Build/Cesium/Widgets/widgets.css"> 关键配置点&#xff1a; 路径验证&#xff1a;确保相对路径.…...

以下是对华为 HarmonyOS NETX 5属性动画(ArkTS)文档的结构化整理,通过层级标题、表格和代码块提升可读性:

一、属性动画概述NETX 作用&#xff1a;实现组件通用属性的渐变过渡效果&#xff0c;提升用户体验。支持属性&#xff1a;width、height、backgroundColor、opacity、scale、rotate、translate等。注意事项&#xff1a; 布局类属性&#xff08;如宽高&#xff09;变化时&#…...

【JVM】- 内存结构

引言 JVM&#xff1a;Java Virtual Machine 定义&#xff1a;Java虚拟机&#xff0c;Java二进制字节码的运行环境好处&#xff1a; 一次编写&#xff0c;到处运行自动内存管理&#xff0c;垃圾回收的功能数组下标越界检查&#xff08;会抛异常&#xff0c;不会覆盖到其他代码…...

自然语言处理——循环神经网络

自然语言处理——循环神经网络 循环神经网络应用到基于机器学习的自然语言处理任务序列到类别同步的序列到序列模式异步的序列到序列模式 参数学习和长程依赖问题基于门控的循环神经网络门控循环单元&#xff08;GRU&#xff09;长短期记忆神经网络&#xff08;LSTM&#xff09…...

智能分布式爬虫的数据处理流水线优化:基于深度强化学习的数据质量控制

在数字化浪潮席卷全球的今天&#xff0c;数据已成为企业和研究机构的核心资产。智能分布式爬虫作为高效的数据采集工具&#xff0c;在大规模数据获取中发挥着关键作用。然而&#xff0c;传统的数据处理流水线在面对复杂多变的网络环境和海量异构数据时&#xff0c;常出现数据质…...

A2A JS SDK 完整教程:快速入门指南

目录 什么是 A2A JS SDK?A2A JS 安装与设置A2A JS 核心概念创建你的第一个 A2A JS 代理A2A JS 服务端开发A2A JS 客户端使用A2A JS 高级特性A2A JS 最佳实践A2A JS 故障排除 什么是 A2A JS SDK? A2A JS SDK 是一个专为 JavaScript/TypeScript 开发者设计的强大库&#xff…...