day05 Router、vuex、axios

配置

router和vuex需要在创建vue项目的时候,开始的时候选择Manually select features,于是就可以在下一个创建配置讯问中选择router和vuex。

axios则需要执行命令行:

npm install axios -S

之后再在需要发送请求的view导入即可。

router实现左边点击右边打开

首先需要安装ElementUI,方法见day4 vue2以及ElementUI-CSDN博客。

在App.vue中导入框架,将<nav>、<router-view>标签移动到对应位置。其中to配置相当于servlet请求的路径。

<template><div id="app"><el-container><el-header>欢迎你</el-header><el-container><el-aside width="200px"><nav><ul><li><router-link to="/">Home</router-link></li><li><router-link to="/about">About</router-link></li><li><router-link to="/question">问题管理</router-link></li><li><router-link to="/new">新页面</router-link></li></ul></nav></el-aside><el-main><router-view/></el-main></el-container></el-container></div>
</template><style>
#app {font-family: Avenir, Helvetica, Arial, sans-serif;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;text-align: center;color: #2c3e50;
}nav {padding: 30px;
}nav a {font-weight: bold;color: #2c3e50;
}nav a.router-link-exact-active {color: #42b983;
}
</style>

并在router的 index.js中配置请求路径对应的view们,相当于web.xml。其中有两种方式导入view,第一种可以直接开头import,在routers中的component中就只用写出你的模块名即可,这是静态导入,其实相当于js中的include编译指令,开始就导入自然加载速度会变快,但是动态导入往往常见一些,就比如这里可以直接在component中 ()=>import ('路径'),这样是动态导入,请求该view的时候才会加载,更灵活。

import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
// 路由的配置
Vue.use(VueRouter)const routes = [{path: '/',name: 'home',component: HomeView},{path: '/about',name: 'about',// route level code-splitting// this generates a separate chunk (about.[hash].js) for this route// which is lazy-loaded when the route is visited.component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')},{path:'/question',name:'question',component:() => import(/* webpackChunkName: "about" */ '../views/QuestionView.vue')},{path:'/new',name:'new',component:() => import(/* webpackChunkName: "about" */ '../views/NewView.vue')}
]
// js文件中导出一个 router 实例
const router = new VueRouter({routes
})export default router

使用vuex处理用户的动作

vuex主要往外导出五个属性,在store的index.js中,state用于储存页面共享的数据,actions用于处理发出的动作,mutations用于直接操纵state中的数据,getters中对state中的数据进行再次加工,类似vue中计算属性computed。

就如图片中一样,view中用dispatch发出动作,actions使用commit将动作处理,转给mutations对state进行直接操作,前端可以直接调用state中的数据,来实现数据更新。getters的处理则直接可以前端执行{{$store.getters.方法名}}。

 store中的index.js:

import Vue from 'vue'
import Vuex from 'vuex'Vue.use(Vuex)export default new Vuex.Store({state: {// 共享数据count: 0, // 初值为零myNewList:[]},getters: { // 对state中的数据进行再次加工,类似vue中计算属性computedupdate(state) {return state.count * 10;}},mutations: { // 修改state数据change(state, value) {state.count += value;},sub(state, value) {state.count -= value;}},actions: { // 相应动作处理// 必须与dispatch中的时间名一致sum(context, value) {context.commit('change', value);},sub(context, value) {context.commit('sub', value);}},modules: { // 分模块化开发,一个模块可以有自己的state,getters,mutations,actions}
})

前端调用:

<template><div class="about"><h1>This is an about page</h1><h2>当前计算的和为:{{$store.state.count}}</h2><h2>当前计算的和 ✖ 10 为:{{$store.getters.update}}</h2><el-button @click="add" type="primary" round>我猜你不会点击我</el-button><br/><br/><el-button @click="sub" type="primary" round>我可以回去哦</el-button></div>
</template>
<script>
export default{name: "AboutView",methods:{// 求和时间处理add(){// 进行dispatchthis.$store.dispatch("sum",5);},sub(){this.$store.dispatch("sub",10);}}
}
</script>

使用axios实现前后端连接

其原理是可以使用axios访问不同端口,向不同端口发送请求,有两种方式发送请求:

可以直接在view中导入axios包,直接发送请求,但是因为请求的地址往往容易变化,所以需要用第二种方式来发送请求,首先在util包中创建js页面配置baseUrl(在此导入axios包),也就是端口号,然后在api包中创建针对不同view的不同请求url,也就是请求的具体地址和请求方法以及可能的参数,将方法配置可以其他文件访问(export default),这时候就需要将配置好的js文件直接导入到view中,然后再调用方法即可。

url在view中(第一种):

<template><div class="home"><img alt="Vue logo" src="../assets/logo.png" /><HelloWorld msg="Welcome to Your Vue.js App" /><br/><el-button @click="sendRequest()" type="primary">发送axios请求,进行调用springboot项目</el-button><br/><br/><br/><el-table :data="this.$store.state.myNewList" border style="width: 100%"><el-table-column fixed prop="id" label="编号" width="150"></el-table-column><el-table-column prop="expertName" label="专家姓名" width="120"> </el-table-column><el-table-column prop="questioner" label="提问人" width="120"></el-table-column><el-table-column prop="phone" label="电话" width="120"> </el-table-column><el-table-column prop="plantName" label="农作物名称" width="300"></el-table-column><el-table-column prop="question" label="问题" width="120"> </el-table-column><el-table-column prop="answer" label="回答" width="120"> </el-table-column><el-table-column prop="status" label="状态" width="120"> </el-table-column><el-table-column fixed="right" label="操作" width="100"><template slot-scope="scope"><el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button><el-button type="text" size="small">编辑</el-button></template></el-table-column></el-table></div>
</template><script>
// @ is an alias to /src
import HelloWorld from "@/components/HelloWorld.vue";
import axios from "axios"; // 引入axios库export default {name: "HomeView",components: {HelloWorld,},methods: {sendRequest() {axios.get("http://localhost:8888/question/findAll").then(response => {this.questonList = response.data.data;this.$store.state.myNewList = response.data.data;});},},data(){return {questonList: []}}
};
</script>

url在js文件中(第二种):

<template><div class="home"><img alt="Vue logo" src="../assets/logo.png" /><br /><el-button @click="search" type="primary">search</el-button><el-button @click="add()" type="primary">add</el-button><br /><br /><br /><el-input v-model="inputValue" placeholder="请输入id或专家姓名"></el-input><br /><br /><el-table :data="questionList" border style="width: 100%"><el-table-column fixed prop="id" label="编号" width="150"></el-table-column><el-table-column prop="expertName" label="专家姓名" width="120"></el-table-column><el-table-column prop="questioner" label="提问人" width="120"></el-table-column><el-table-column prop="phone" label="电话" width="120"> </el-table-column><el-table-column prop="plantName" label="农作物名称" width="300"></el-table-column><el-table-column prop="question" label="问题" width="120"></el-table-column><el-table-column prop="answer" label="回答" width="120"></el-table-column><el-table-column prop="status" label="状态" width="120"></el-table-column><el-table-column fixed="right" label="操作" width="100"><template slot-scope="scope"><el-button @click="handleClick(scope.row)" type="text" size="small">删除</el-button><el-button type="text" size="small">编辑</el-button></template></el-table-column></el-table></div>
</template><script>
// @ is an alias to /src
import queApi from "@/api/question"; // 导入封装后的axios请求,具体见src/api/question.jsexport default {name: "HomeView",methods: {sendRequest() {queApi.getQuestionList().then((res) => {this.questionList = res.data.data;this.$store.state.myNewList = this.questionList; // 数据共享});}},data() {return {questionList: [],inputValue: "",};},
};
</script>

api文件中配置:

import request from '../utils/request'; // 导入axios实例/*** 调用boot端,进行/question/findAll查询* @returns {Promise}*/
function getQuestionList() { // 获取问题列表return request({url: '/question/findAll',method: 'get'});
}export default {getQuestionList, // 导出函数
} // 导出对象

除了findAll方法之外,还可以其他方法:

后端

注意axios支持get、post、put、delete等请求,所以可以直接按照swagger的请求规范做,还有一点要注意,需要配置后端可以接受并处理其他端口发出的各种请求,也就需要配置CorsConfig文件:

package com.zheng.config;import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;@Configuration
public class CorsConfig implements WebMvcConfigurer {@Overridepublic void addCorsMappings(CorsRegistry registry) {// 添加映射路径registry.addMapping("/**")// .allowedOrigins("*") //.allowedOriginPatterns("*") //允许哪些域的请求,星号代表允许所有.allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE") // 允许的方法.allowedHeaders("*") // 允许的头部设置.allowCredentials(true) // 是否发送cookie.maxAge(168000); // 预检间隔时间}}

除此之外,如果发送的是post、put请求,也就是要将传递的参数放到请求体中的,需要在获得形参之前加@RequestBody,才能将传递的参数和需要的参数一一对应。

package com.zheng.controller;import com.zheng.entity.Question;
import com.zheng.model.Result;
import com.zheng.service.QuestionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;import java.util.List;/*** Controller整合Swagger*/
@RestController
@RequestMapping("/question")
@Tag(name="question",description = "tb_question控制层") // swagger标签
public class QuestionController {@Autowiredprivate QuestionService questionService;@Operation(description = "question查询全部") // swagger 标签@GetMapping("/findAll")
//    public List<Question> findAll() {
//        return questionService.findAll();
//    }public Result<List<Question>> findAll() {return Result.ok(questionService.findAll());}/*** findById?id=10* @param id* @return*/@Operation(description = "question根据主键查询") // swagger 标签@GetMapping("findById")
//    public Question findById(@RequestParam("id") int id) {
//        return questionService.findById(id);
//    }public Result<Question> findById(@RequestParam("id") int id) {return Result.ok(questionService.findById(id));}@Operation(description = "根据专家名字查询")@GetMapping("/findByExpertName/{expertName}")public Result<List<Question>> findByExpertName(@PathVariable("expertName") String expertName) {return Result.ok(questionService.findByExpertName(expertName));}@PostMapping("/save")@Operation(description = "添加question")public Result<Integer> save(@RequestBody Question question) {return Result.ok(questionService.save(question));}@PutMapping("/update") // 修改只能用put请求,删除只能用delete请求@Operation(description = "修改question")public Result<Integer> update(Question question) {return Result.ok(questionService.update(question));}/*** /delete/10* @param id* @return*/@DeleteMapping("/delete/{qid}")@Operation(description = "按照编号删除question")public Result<Integer> delete(@PathVariable("qid") int id) {return Result.ok(questionService.delete(id));}
}

一个好习惯是将返回的数据封装成一个Result<T>类(这也相当于一个特殊的实体类)来处理,这样当面对不同的数据类型的时候才能正常处理:

package com.zheng.model;import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Result<T> {private Integer code; // 编码 ;200 404 500private String msg; // 消息内容private T data; // 真正的数据public Result(Integer code, T data) {this.code = code;this.data = data;}public Result(String msg, T data) {this.msg = msg;this.data = data;}public Result(T data){this.data = data;}public static<T> Result<T> ok(T data){return new Result(200,"success",data);}public static<T> Result<T> fail(Integer code){return new Result(500,"fail",null);}
}

前端

对于前端如何链接这么多方法呢:

如果是get、delete请求并将传递的参数直接拼接在路径中,而非键值对的形式,那么在前端也可以直接拼接在url中,不能使用参数params,否则404:

function findByExpertName(expertName) {return request({url:'/question/findByExpertName/' + expertName,method:'get'})
}

 对于post请求可以直接这样传递参数(在控制层是直接接受一个对象的类型,所以传入的也是一个对象类型,直接使用data列出要传递的参数即可),对于get请求参数必须params,而post、put、delete请求必须data传递数据:

function addQuestion(data) { // 新增问题return request({url: '/question/save',method: 'post', // post 请求执行添加操作data: data // 发送数据})
}

最后,做的小项目:实现findById以及findByExpertName以及add方法

<template><div class="home"><img alt="Vue logo" src="../assets/logo.png" /><br /><el-button @click="search" type="primary">search</el-button><el-button @click="add()" type="primary">add</el-button><br /><br /><br /><el-input v-model="inputValue" placeholder="请输入id或专家姓名"></el-input><br /><br /><el-table :data="questionList" border style="width: 100%"><el-table-column fixed prop="id" label="编号" width="150"></el-table-column><el-table-column prop="expertName" label="专家姓名" width="120"></el-table-column><el-table-column prop="questioner" label="提问人" width="120"></el-table-column><el-table-column prop="phone" label="电话" width="120"> </el-table-column><el-table-column prop="plantName" label="农作物名称" width="300"></el-table-column><el-table-column prop="question" label="问题" width="120"></el-table-column><el-table-column prop="answer" label="回答" width="120"></el-table-column><el-table-column prop="status" label="状态" width="120"></el-table-column><el-table-column fixed="right" label="操作" width="100"><template slot-scope="scope"><el-button @click="handleClick(scope.row)" type="text" size="small">删除</el-button><el-button type="text" size="small">编辑</el-button></template></el-table-column></el-table><!--  添加的对话框--><el-dialog title="问题信息" :visible.sync="dialogFormVisible"><el-form :model="form" :rules="rules" ref="questionForm"><el-form-itemlabel="expertName":label-width="formLabelWidth"prop="expertName"><el-input v-model="form.expertName" autocomplete="off"></el-input></el-form-item><el-form-itemlabel="questioner":label-width="formLabelWidth"prop="questioner"><el-input v-model="form.questioner" autocomplete="off"></el-input></el-form-item><el-form-item label="phone" :label-width="formLabelWidth" prop="phone"><el-input v-model="form.phone" autocomplete="off"></el-input></el-form-item><el-form-itemlabel="plantName":label-width="formLabelWidth"prop="plantName"><el-input v-model="form.plantName" autocomplete="off"></el-input></el-form-item><el-form-item label="title" :label-width="formLabelWidth" prop="title"><el-input v-model="form.title" autocomplete="off"></el-input></el-form-item><el-form-itemlabel="question":label-width="formLabelWidth"prop="question"><el-input v-model="form.question" autocomplete="off"></el-input></el-form-item><el-form-itemlabel="answer":label-width="formLabelWidth"prop="answer"><el-input v-model="form.answer" autocomplete="off"></el-input></el-form-item><el-form-itemlabel="status":label-width="formLabelWidth"prop="status"><el-input v-model="form.status" autocomplete="off"></el-input></el-form-item></el-form><div slot="footer" class="dialog-footer"><el-button @click="cancel">取 消</el-button><el-button type="primary" @click="save">保 存</el-button></div></el-dialog></div>
</template><script>
// @ is an alias to /src
import queApi from "@/api/question"; // 导入封装后的axios请求,具体见src/api/question.jsexport default {name: "HomeView",methods: {sendRequest() {queApi.getQuestionList().then((res) => {this.questionList = res.data.data;this.$store.state.myNewList = this.questionList;});},isNumber(value) {return /^\d+$/.test(value) && value !== '';},search() {if (this.inputValue == "") {this.sendRequest();} else {if (this.isNumber(this.inputValue)) {this.findById();} else {this.findByExpertName();}}//   this.sendRequest();},findById() {queApi.findById(this.inputValue).then((res) => {this.question = res.data.data;if (this.question != null) {this.$set(this, "questionList", []); // 清空原有数据this.questionList.push(this.question);} else {alert("未查询到数据");}});},add() {this.dialogFormVisible = true;},cancel() {this.dialogFormVisible = false;this.form = {expertName: "",questioner: "",phone: "",plantName: "",title: "",question: "",answer: "",status: "",};},save() {// 验证表单this.$refs.questionForm.validate((validate) => {if (validate) {// 验证通过,可以提交数据//   alert(this.form.expertName);queApi.addQuestion(this.form).then((res) => {if (res.data.code == 200) {alert("添加了" + res.data.data + "条数据");this.sendRequest();} else {alert(res.data.msg);}});this.dialogFormVisible = false;this.form = {expertName: "",questioner: "",phone: "",plantName: "",title: "",question: "",answer: "",status: "",};}});},findByExpertName() {queApi.findByExpertName(this.inputValue).then((res) => {if (res.data.data == null) {alert("未查询到数据");} else {this.questionList = res.data.data;}});},},data() {return {questionList: [],question: {},inputValue: "",dialogFormVisible: false, // 控制添加的对话框是否可见form: {expertName: "",questioner: "",phone: "",plantName: "",title: "",question: "",answer: "",status: "",},formLabelWidth: "100px",rules: {expertName: [{ required: true, message: "请输入专家姓名", trigger: "blur" },],questioner: [{ required: true, message: "请输入提问人", trigger: "blur" },],phone: [{ required: true, message: "请输入电话", trigger: "blur" },//   {//     pattern: /^1[34578]\d{9}$/,//     message: "请输入正确的手机号",//     trigger: "blur",//   },],plantName: [{ required: true, message: "请输入农作物名称", trigger: "blur" },],title: [{ required: true, message: "请输入标题", trigger: "blur" }],question: [{ required: true, message: "请输入问题", trigger: "blur" }],answer: [{ required: true, message: "请输入回答", trigger: "blur" }],status: [{ required: true, message: "请输入状态", trigger: "blur" }],},};},
};
</script>

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

研发(RD)注意事项 / 复杂项目规划、控制方法 PERT 和 CPM

注&#xff1a;机翻&#xff0c;未校对&#xff0c;去掉了原文中广告。 What Is Research and Development (R&D)? 什么是研发&#xff08;R&D&#xff09;&#xff1f; Investopedia / Ellen Lindner Research and Development An ongoing effort to develop or impr…

springboot中使用knife4j访问接口文档的一系列问题

springboot中使用knife4j访问接口文档的一系列问题 1.个人介绍 &#x1f389;&#x1f389;&#x1f389;欢迎来到我的博客,我是一名自学了2年半前端的大一学生,熟悉的技术是JavaScript与Vue.目前正在往全栈方向前进, 如果我的博客给您带来了帮助欢迎您关注我,我将会持续不断的…

Hive3:Centos7环境部署Hive服务

一、安装说明 1、Hadoop集群情况 3台机器&#xff1a;4G2C、2G2C、2G2C 安装教程&#xff1a;Centos7环境安装Hadoop集群 2、安装MySQL&#xff0c;用于存储Hive的元数据 在102机器上安装MySQL 安装MySQL使用服务器的root账号 3、最后安装Hive 安装hive过程使用服务器的atgu…

【C++】选择结构案例-三目运算符

三目运算符语法格式&#xff1a; 布尔表达式?表达式1:表达式2 运算过程&#xff1a;如果布尔表达式的值为 true &#xff0c;则返回 表达式1 的值&#xff0c;否则返回 表达式2 的值 &#xff08;三目运算符指的是&#xff1f;和&#xff1a;&#xff09; 在这个三目运算符…

postman请求响应加解密

部分接口&#xff0c;需要请求加密后&#xff0c;在发动到后端。同时后端返回的响应内容&#xff0c;也是经过了加密。此时&#xff0c;我们先和开发获取到对应的【密钥】&#xff0c;然后在postman的预执行、后执行加入js脚本对明文请求进行加密&#xff0c;然后在发送请求&am…

【游戏制作】使用Python创建一个完整的2048游戏项目

目录 项目运行展示 项目概述 项目目标 项目结构 安装依赖 代码实现 1. 导入库 2. 创建 Game2048 类 3. 设置UI界面 4. 加载二维码图片 5. 创建菜单 6. 游戏逻辑和功能 7. 运行应用 总结 创建一个完整的2048游戏项目 项目运行展示 项目概述 在这个项目中&#xff…

Mysql中如何实现两列的值互换?给你提供些思路。

文章目录 Mysql中如何实现两列的值互换1、第一感觉此sql应该能处理问题了2、需要一个地方存要替换的值&#xff0c;不然两列搞不定。2.1 加第三列&#xff1f;&#xff08;能解决&#xff0c;但是看起来呆呆&#xff09;2.2 上临时表&#xff08;搞点弯路走走&#xff09; 示例…

如何在 SpringBoot 中优雅的做参数校验?

一、故事背景 关于参数合法性验证的重要性就不多说了&#xff0c;即使前端对参数做了基本验证&#xff0c;后端依然也需要进行验证&#xff0c;以防不合规的数据直接进入服务器&#xff0c;如果不对其进行拦截&#xff0c;严重的甚至会造成系统直接崩溃&#xff01; 本文结合…

昇思25天学习打卡营第24天|RNN实现情感分类

RNN实现情感分类学习总结 概述 情感分类是自然语言处理领域的重要任务&#xff0c;主要用于识别文本中表达的情绪。本文使用MindSpore框架实现基于RNN的情感分类模型&#xff0c;示例包括&#xff1a; 输入: “This film is terrible” -> 标签: Negative输入: “This fi…

UE5.4内容示例(1)- 学习笔记

https://www.unrealengine.com/marketplace/zh-CN/product/content-examples 《内容示例》是学习UE5的基础示例&#xff0c;可以用此示例熟悉一遍UE5的功能 模型与材质部分 StaticMeshes FBX_Import_Options Material_Advanced Material_Decals Material_Instances Material_N…

Python 高阶语法

前言&#xff1a; 我们通过上篇文章学习了Python的基础语法&#xff0c;接下来我们来学习Python的高阶语法 1.初识对象 在Python中我们可以做到和生活中那样&#xff0c;设计表格、生产表格、填写表格的组织形式的 面向对象包含 3 大主要特性&#xff1a;  封装  继承 …

Zilliz 推出 Spark Connector:简化非结构化数据处理流程

随着人工智能&#xff08;AI&#xff09;和深度学习&#xff08;Deep Learning&#xff09;技术的高速发展&#xff0c;使用神经网络模型将数据转化为 Embedding 向量 已成为处理非结构化数据并实现语义检索的首选方法&#xff0c;广泛应用于搜索、推荐系统等 AI 业务中。 以生…

用护眼灯还需要开灯吗?护眼灯行业三大套路迷局揭秘

用护眼灯还需要开灯吗&#xff1f;在使用护眼台灯时&#xff0c;同时开启室内的主照明十分必要。如果关闭其他灯具&#xff0c;仅保留护眼台灯&#xff0c;那么只有台灯周围的小片区域能够被照亮&#xff0c;而房间的其他部分则处于相对昏暗的状态。这种明显的光线差异会造成视…

freertos的学习cubemx版

HAL 库的freertos 1 实时 2 任务->线程 3 移植 CMSIS_V2 V1版本 NVIC配置全部是抢占优先级 第四组 抢占级别有 0-15 编码规则&#xff0c; 变量名 &#xff1a;类型前缀&#xff0c; c - char S - int16_t L - int32_t U - unsigned Uc - uint8_t Us - uint…

《书生大模型实战营第3期》入门岛 学习笔记与作业:Python 基础知识

文章大纲 Python 简介1 安装Python1.1 什么是conda&#xff1f;1.1.1 功能与作用&#xff1a;1.1.2 常用命令&#xff1a;1.1.3 适用性&#xff1a; 1.2 Python安装与学习环境准备1.2.1 下载miniconda1.2.2 安装miniconda1.2.3 创建一个python练习专属的conda虚拟环境 2: Pytho…

【制作100个unity游戏之31】用unity制作一个爬坡2d赛车小游戏

最终效果 【制作100个unity游戏之31】用unity制作一个爬坡2d赛车小游戏 前言 今天用unity制作一个简单的爬坡2d赛车小游戏 素材 https://www.spriters-resource.com/mobile/hillclimbracing/ 拼装车素材 车身添加碰撞体&#xff0c;摩檫力0 轮胎添加碰撞体和刚体&#xff0…

【VSCode实战】Golang无法跳转问题竟是如此简单

上一讲【VSCode实战】Go插件依赖无法安装 – 经云的清净小站 (skycreator.top)&#xff0c;开头说到了在VSCode中Golang无法跳转的问题&#xff0c;但文章的最后也没给出解决方案&#xff0c;只解决了安装Go插件的依赖问题。 解决了插件依赖问题&#xff0c;无法跳转的问题也离…

苍穹外卖 02

1.新增员工 controller&#xff1a; EmployeeServiceImpl&#xff1a; 实现controller里的save方法&#xff0c;要调用到mapper层的insert方法 因为员工登录成功后&#xff0c;会将id封装进jwt令牌,并响应给前端 所以后续请求中前端会携带jwt令牌。通过令牌可解析出被封装的…

C++:平衡搜索二叉树(AVL)

hello&#xff0c;各位小伙伴&#xff0c;本篇文章跟大家一起学习《C&#xff1a;平衡搜索二叉树&#xff08;AVL&#xff09;》&#xff0c;感谢大家对我上一篇的支持&#xff0c;如有什么问题&#xff0c;还请多多指教 &#xff01; 文章目录 :maple_leaf:AVL树:maple_leaf:…

大学计算机专业主要课程及概要介绍

大学计算机专业主要课程及概要介绍 大学计算机专业是一门涵盖广泛领域的学科&#xff0c;旨在培养学生在计算机科学与技术方面的理论知识与实践能力。该专业课程设置丰富多样&#xff0c;涵盖了从基础理论到高级应用的多个方面。以下是一些主要的课程及其概要介绍&#xff1a;…