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

vue前端与Java后端进行跨域交互

1.后端的几种解决方法

1.在Controller上面加上@CrossOrigin

2.写一个配置文件并且在Controller层加上注解@CORSConfig

package com.wolwo.langyage.base.util;import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/*** CORS configuration*/
@Configuration
public class CORSConfig {@Beanpublic WebMvcConfigurer corsConfigurer() {return new WebMvcConfigurerAdapter() {@Overridepublic void addCorsMappings(CorsRegistry registry) {registry.addMapping("/**").allowedOrigins("http://127.0.0.1:8080,http://localhost:8080").allowedMethods("POST,GET, OPTIONS,DELETE,PUT").allowedHeaders("Content-Type,ContentType,Access-Control-Allow-Headers,Access-Control-Allow-Origin, Authorization, X-Requested-With").allowCredentials(true);}};}}

3.在springmvc配置文件里加入

4.写一个过滤器类并且在web.xml中注册过滤器

package com.pmsapi.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;public class CrossingFilter implements Filter {private boolean isCross = false;@Override
public void destroy() {isCross = false;
}@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)throws IOException, ServletException {if (isCross) {HttpServletRequest httpServletRequest = (HttpServletRequest) request;HttpServletResponse httpServletResponse = (HttpServletResponse) response;System.out.println("拦截请求: " + httpServletRequest.getServletPath());httpServletResponse.setHeader("Access-Control-Allow-Origin", "*");// httpServletResponse.setHeader("Access-Control-Allow-Methods", "*"); // 表示所有请求都有效httpServletResponse.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");httpServletResponse.setHeader("Access-Control-Max-Age", "0");httpServletResponse.setHeader("Access-Control-Allow-Headers","Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId,token");httpServletResponse.setHeader("Access-Control-Allow-Credentials", "true");httpServletResponse.setHeader("XDomainRequestAllowed", "1");}chain.doFilter(request, response);
}@Override
public void init(FilterConfig filterConfig) throws ServletException {String isCrossStr = filterConfig.getInitParameter("IsCross");isCross = isCrossStr.equals("true") ? true : false;System.out.println("跨域开启状态:" + isCrossStr);
}}
<!-- 配置跨域过滤器 -->
<filter><filter-name>CrossingFilter</filter-name><filter-class>com.pmsapi.filter.CrossingFilter</filter-class><init-param><param-name>IsCross</param-name><param-value>true</param-value></init-param>
</filter>
<filter-mapping><filter-name>CrossingFilter</filter-name><url-pattern>/*</url-pattern>
</filter-mapping>

获取前端传来的数据

public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {// 1. 从 map 取 前端发过来的 post 数据
//{username=[xxx],password=[xxx],hobby=[eat,drink]}Map<String, String[]> parameterMap = req.getParameterMap();// 2. 遍历 map 数据 ----> 字符串String namePwd = "";if (parameterMap != null) {for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {namePwd = entry.getKey();System.out.println(namePwd);}}// 3. 字符串 ----> jsonJSONObject params = JSON.parseObject(namePwd);String username = params.getString("username");int pwd = params.getInteger("pwd");
}

2.前端的处理   

查看vue版本npm list vue或是在package.json文件里找”dependencies”直接看到

vue2

原理:给url加上了前缀 /api,我们前端发起请求/dev/unit/queryTree访问https://locall/host:8080/dev/unit/queryTree就当于访问了:https://locall/host:8080/api/dev/unit/queryTree

又因为在 index.js 中的 proxyTable 中拦截了 /api ,并把 /api 及其前面的所有替换成了 target 中的内容,因此实际访问 Url 是https://www.wd.com/dev/unit/queryTree。红色是target,绿色是前端发起的具体请求,对应后端的请求

1.vue.main.js  配置访问的url前缀

import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import App from './App'
import axios from 'axios'//引入axios,来发送请求
Vue.config.productionTip = false
Vue.use(ElementUI)
Vue.prototype.axios = axios
axios.defaults.timeout = 5000;// 在超时前,所有请求都会等待 5 秒
axios.defaults.headers.post['Content-Type']='application/x-www-form-urlencoded;charset=UTF-8';// 配置请求头
axios.defaults.baseURL = '/api';// 作用是我们每次发送的请求都会带一个/api的前缀。
axios.defaults.withCredentials = false;
new Vue({el: '#app',components: {App},template: '<App/>'// render: h => h(App)
})

2.修改config文件夹下的index.js文件,在proxyTable中加上如下代码:  代理,如果没有这部分,那么跨域的路径就是baseurl+具体请求

'/api':{target: "https://www.wd.com/dev",changeOrigin:true,pathRewrite:{'^/api':''     //因为本身的请求中没有api,所以去掉,eg:前端请求/api/ser,实际后端:https://www.wd.com/dev/ser}
}

3.app.vue

<template><div><el-menu></el-menu><el-table></el-table><br/><el-page></el-page></div>
</template>
<script>
import nav from "./components/NavMenu.vue"
import eletable from "./components/Table.vue"
import pageination from "./components/Pagination.vue"
export default {components:{ElMenu:nav,ElTable:eletable,ElPage:pageination},data(){return{}},methods:{},mounted() {this.axios({method: 'get',url: '/test/test',params: this.urlParams}).then((res) => {console.log(res)console.log(res.data)alert(res.data.msg)}).catch((err) => {console.log(err)})}
}
</script>

vue3

在config.js中这样写
devServer: {open: true, //是否自动弹出浏览器页面host: "localhost",port: '8080',https: false,hotOnly: false,proxy: //或者直接写上协议 域名 端口号,在请求的时候加上请求和这个拼接上
{'/api': {target: 'https://www.v2ex.com/api', //API服务器的地址changeOrigin: true,pathRewrite: {'^/api': ''}}},
}

3.vue+webpack项目搭建实现前后端交互

1.检查本地环境

  • node -v
  • npm -v
  • vue -V

2.进入目录文件夹创建项目

vue init webpack vue-project-name

3.安装依赖

npm操作: 与cnpm yarn的区别是他们下载源不同,npm会更满=慢些
安装vue-router:
npm install vue-router --save-dev     dev表示生产环境,开发环境不加dev
安装element-ui: 与路由相关的元素上需要加上router,在vue文件中的element元素上,如果表单中某个元素的值是变量,需加上:    ,比如:key="i"
npm i element-ui -S         -S表示plus的意思,不加plus的只支持vue2.几版本,vue3使用plus的
安装SAss加载器:
npm install sass-loader node-sass --save-dev
安装axios:
npm install --save axios vue-axios
注意安装依赖之后要重新执行nmp install

4.启动浏览器进行访问

npm run dev是适用于老版本;新版本使用npm run server

完成后,可在生成的项目中修改基础配置,比如运行监听端口,默认是8080,如果担心有冲突可自行更改,更改文件在config—index.js 。项目基础信息在package.json文件中,有项目名称、作者、运行说明等,可自行查阅,启动项目命令:npm run dev启动完成后回返回请求的地址,复制到浏览器即可请求项目。


5.实现登录

1

  • http是无状态的通过cookie在客户端记录状态通过session在服务器端记录状态通过token方式维持状态
  • 将登录之后的token,保存到客户端的sessionStorage中.项目中除了登录之外的其他API接口,必须在登录之后才能访问;token只应在当前网站打开期间生效,所以将token保存在sessionStorage中

2.Element-UI组件实现布局

  • el-form
  • el-form-item
  • el-input
  • el-button
  • 字体图标

3.Login.vue

<template><div class="login-wrap"><el-form class="login-container"><h1 class="title">用户登录</h1><el-form-item label="账号"><el-input type="password" v-model="uname" placeholder="登录账号" autocomplete="off"></el-input></el-form-item><el-form-item label="登录密码"><el-input type="password" v-model="password" placeholder="登录密码" autocomplete="off"></el-input></el-form-item><el-form-item><el-button type="primary" style="width: 100%;" @click="dosubmit()">登录</el-button></el-form-item></el-form></div>
</template><script>export default {name: 'login',data: function() {return {uname: "张三",password: "123"}},methods: {dosubmit: function() {let params = {uname: this.uname,password: this.password};}}}
</script><!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>.login-wrap {box-sizing: border-box;width: 100%;height: 100%;padding-top: 10%;background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjEzNjFweCIgaGVpZ2h0PSI2MDlweCIgdmlld0JveD0iMCAwIDEzNjEgNjA5IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yM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yNCwxMzIuMjMxOTg4IEwyMDcuMDgzMzMzLDkwLjQxNjY2NjciIGlkPSJQYXRoLTI1IiBzdHJva2U9IiNDRkRBRTYiIHN0cm9rZS13aWR0aD0iMS4xNjY2NjY2NyI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxjaXJjbGUgaWQ9Ik92YWwtNSIgZmlsbD0iI0MxRDFFMCIgY3g9IjE1Ni45MTY2NjciIGN5PSI4Ljc1IiByPSI4Ljc1Ij48L2NpcmNsZT4KICAgICAgICAgICAgICAgICAgICA8Y2lyY2xlIGlkPSJPdmFsLTUtQ29weS0zIiBmaWxsPSIjQzFEMUUwIiBjeD0iMzkuMDgzMzMzMyIgY3k9IjE0OC43NSIgcj0iNS4yNSI+PC9jaXJjbGU+CiAgICAgICAgICAgICAgICAgICAgPGNpcmNsZSBpZD0iT3ZhbC01LUNvcHktMiIgZmlsbC1vcGFjaXR5PSIwLjYiIGZpbGw9IiNEMURFRUQiIGN4PSI4Ljc1IiBjeT0iMzMuMjUiIHI9IjguNzUiPjwvY2lyY2xlPgogICAgICAgICAgICAgICAgICAgIDxjaXJjbGUgaWQ9Ik92YWwtNS1Db3B5LTQiIGZpbGwtb3BhY2l0eT0iMC42IiBmaWxsPSIjRDFERUVEIiBjeD0iMjQzLjgzMzMzMyIgY3k9IjMwLjMzMzMzMzMiIHI9IjUuODMzMzMzMzMiPjwvY2lyY2xlPgogICAgICAgICAgICAgICAgICAgIDxjaXJjbGUgaWQ9Ik92YWwtNS1Db3B5LTUiIGZpbGw9IiNFMEI0QjciIGN4PSIxNzUuNTgzMzMzIiBjeT0iMjMyLjc1IiByPSI1LjI1Ij48L2NpcmNsZT4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);/* background-color: #112346; */background-repeat: no-repeat;background-position: center right;background-size: 100%;}.login-container {border-radius: 10px;margin: 0px auto;width: 350px;padding: 30px 35px 15px 35px;background: #fff;border: 1px solid #eaeaea;text-align: left;box-shadow: 0 0 20px 2px rgba(0, 0, 0, 0.1);}.title {margin: 0px auto 40px auto;text-align: center;color: #505458;}
</style>

4.配置路由

import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '@/view/Login'Vue.use(Router)export default new Router({routes: [{path: '/',name: 'Login',component: Login},]
})

5.跨域请求

get:

<script>
import axios from 'axios'
import qs from 'qs'export default {name: 'login',data: function() {return {uname: "张三",password: "123"}},methods: {dosubmit: function() {let params = {uname: this.uname,password: this.password};var url = "http://localhost:8080/ssm02/login";axios.get(url, { //注意数据是保存到json对象的params属性params: params}).then(function(response) {console.log(response);}).catch(function(error) {console.log(error);});var str=qs.stringify(params);axios.post(url,str//注意数据是直接保存到json对象).then(function(response) {console.log(response);}).catch(function(error) {console.log(error);});}}}
</script>

post

var str=qs.stringify(params);axios.post(url,str//注意数据是直接保存到json对象).then(function(response) {console.log(response);}).catch(function(error) {console.log(error);});因为POST提交的参数的格式是Request Payload,这样后台取不到数据的(详情见资料“05 Vue中axios踩坑之路-POST传参 - RainSun - CSDN博客.mht”),解决方案:使用qs.js库,将{a:'b',c:'d'}转换成'a=b&c=d'

相关文章:

vue前端与Java后端进行跨域交互

1.后端的几种解决方法 1.在Controller上面加上CrossOrigin 2.写一个配置文件并且在Controller层加上注解CORSConfig package com.wolwo.langyage.base.util;import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configurat…...

【设计模式】2.抽象工厂模式

抽象工厂模式 前面介绍的工厂方法模式中考虑的是一类产品的生产&#xff0c;如畜牧场只养动物、电视机厂只生产电视机、传智播客只培养计算机软件专业的学生等。 这些工厂只生产同种类产品&#xff0c;同种类产品称为同等级产品&#xff0c;也就是说&#xff1a;工厂方法模式…...

Telnet 基础实验1: Telnet 实验

Telnet 基础实验1&#xff1a; Telnet 实验 拓扑图 配置命令 R1 的配置 undo ter mo sys sys R1 interface g0/0/0 ip address 192.168.1.1 255.255.255.0 qR2 的配置 undo ter mo system-view sysname R2 interface g0/0/0 ip address 192.168.1.2 255.255.255.0 q两台设…...

机器学习经典算法——决策树(Decision Tree)

决策树的基本原理 决策树是⼀种分⽽治之的决策过程。⼀个困难的预测问题&#xff0c;通过树的分⽀节点&#xff0c;被划分成两个或多个较为简单的⼦集&#xff0c;从结构上划分为不同的⼦问题。将依规则分割数据集的过程不断递归下去。随着树的深度不断增加&#xff0c;分⽀节…...

MySQl总结

文章目录MySQL数据库的常见考点1、ACID事务原理事务持久性事务原子性MVCC基本概念MVCC基本原理undo logundo log版本链readviewMVCC实现原理RC读已提交RR可重复读MVCC实现原理总结2、并发事务引发的问题3、事务隔离级别4、索引索引结构BTreeHash面试题索引分类思考题语法性能分…...

【学习笔记】NOIP爆零赛7

结论专场&#xff0c;结果被踩暴了 青鱼和序列 赛时的做法是&#xff0c;维护∑aii\sum a_i\times i∑ai​i的取值&#xff0c;发现只和最后一次操作222的位置有关&#xff0c;于是递推O(n)O(n)O(n)解决。 赛后发现还有更神奇的结论 第二个结论是&#xff0c;第一次进行操作…...

一文读懂账号体系产品设计

一、账号体系的概念及价值账号体系是用户在各平台上的通行证。平台给与用户可持续的服务&#xff0c;用户在平台上获取价值&#xff0c;中间的媒介&#xff0c;便是账号体系。阿境将其理解为维系用户与平台之间的枢纽。注&#xff1a;本文中&#xff0c;账号账户&#xff0c;二…...

从“入门”到“专家”,一份3000字完整的性能测试体系的知识分享

随着科技的飞速发展&#xff0c;软件产品广泛应用于各个行业领域&#xff0c;人们对计算机和网络的依赖性越来越大&#xff0c;对新奇事物也越来越感兴趣&#xff0c;成千上万的用户活跃在庞大的网络系统中&#xff0c;这给提供服务的系统带来严重的负荷&#xff0c;"高并…...

构建对话机器人:Rasa3安装和基础入门

在开源对话机器人中&#xff0c;Rasa社区很活跃&#xff0c;在国内很多企业也在使用Rasa做对话机器人&#xff0c;有rasa开发经验的往往是加分项。 当年实习的时候接触到了Rasa&#xff0c;现在工作中也使用Rasa&#xff0c;因此&#xff0c;写写一些经验文档&#xff0c;有助后…...

Spark计算框架入门笔记

Spark是一个用于大规模数据处理的统一计算引擎 注意&#xff1a;Spark不仅仅可以做类似于MapReduce的离线数据计算&#xff0c;还可以做实时数据计算&#xff0c;并且它还可以实现类似于Hive的SQL计算&#xff0c;等等&#xff0c;所以说它是一个统一的计算引擎 既然说到了Spar…...

入职数据分析公认的好书|建议收藏

众所周知&#xff0c;数据分析经常出现在我们的日常生活中&#xff0c;各行各业都需要数据分析。可你知道什么是数据分析&#xff1f;它在企业里到底扮演什么角色&#xff1f;以及如果我们自己也想拥有数据分析的能力&#xff0c;以便更好的满足数据分析的需求&#xff0c;我们…...

Linux查找文件和目录,重定向输出 ,系统默认运行级别的查看和设置理论和练习

♥️作者&#xff1a;小刘在C站 ♥️个人主页&#xff1a;小刘主页 ♥️每天分享云计算网络运维课堂笔记&#xff0c;努力不一定有收获&#xff0c;但一定会有收获加油&#xff01;一起努力&#xff0c;共赴美好人生&#xff01; ♥️夕阳下&#xff0c;是最美的绽放&#xff0…...

Redis源码---键值对中字符串的实现,用char*还是结构体

目录 前言 为什么 Redis 不用 char*&#xff1f; char* 的结构设计 操作函数复杂度 SDS 的设计思想 SDS 结构设计 SDS 操作效率 紧凑型字符串结构的编程技巧 小结 前言 对于 Redis 来说&#xff0c;键值对中的键是字符串&#xff0c;值有时也是字符串在 Redis 中写入一…...

算法 - 剑指Offer 表示数值的字符串

题目 请实现一个函数用来判断字符串是否表示数值&#xff08;包括整数和小数&#xff09;。 数值&#xff08;按顺序&#xff09;可以分成以下几个部分&#xff1a; 若干空格 一个 小数 或者 整数 &#xff08;可选&#xff09;一个 ‘e’ 或 ‘E’ &#xff0c;后面跟着一个 …...

初识机器学习

监督学习与无监督学习supervised learning&#xff1a;监督学习&#xff0c;给出的训练集中有输入也有输出&#xff08;标签&#xff09;&#xff08;也可以说既有特征又有目标&#xff09;&#xff0c;在此基础上让计算机进行学习。学习后通过测试集测试给相应的事物打上标签。…...

VsCode安装PlatformIO 开发ESP arduino,买的板子或者随便ESP,PlatformIO添加Board(不是自定义Board)

这次主要记录怎么给新建选板子的时候没有的板子下程序 我这里是一块 WiFi Kit 32 (V3) PlatformIO里面只有到V2 先从头开始&#xff0c;安装PlatformIO 安装PlatformIO 直接搜索安装 安装有时候会比较慢&#xff0c;左侧出现蚂蚁图标之后点击会显示 右下角会提示正在安…...

golang 复杂数据结构解析

[{"key":"15275771","pack":{"1":[{"name":"消息配置","id":15275771,"version":1,"createUser":"molaifeng","data":"test"}]},"callback&qu…...

不怕被AirTag跟踪?苹果Find My技术越来越普及

苹果的 AirTag 自推出以来&#xff0c;如何有效遏制用户用其进行非法跟踪&#xff0c;是摆在苹果面前的一大难题。一家为执法部门制造无线扫描设备的公司近日通过 KickStarter 平台&#xff0c;众筹了一款消费级产品&#xff0c;可帮助用户检测周围是否存在追踪的 AirTag 等设备…...

Linux驱动中的open函数是如何从软件打通硬件呢?

一、前言 打开文件是Linux系统中最基本的操作之一&#xff0c;open函数可以实现打开文件的功能。下面我将为您介绍open函数打通上层到底层硬件的详细过程。 二、open函数打通软硬件介绍 open函数是系统调用中的一种&#xff0c;其原型定义在头文件unistd.h中&#xff1a; #…...

Java 基础语法

Java 是一门广泛使用的编程语言&#xff0c;由于其简单易学和可移植性&#xff0c;已成为开发 Web 应用程序、移动应用程序、桌面应用程序以及企业级应用程序的首选语言之一。在本文中&#xff0c;我们将探讨 Java 的基础语法&#xff0c;包括变量、数据类型、运算符、控制流等…...

python下如何安装并使用matplotlib(画图模块)

在搜索命令中输入cmd&#xff0c;以管理员身份运行。 输入以下命令&#xff0c;先对pip安装工具进行升级 pip install --upgrade pip 升级完成 之后使用pip安装matplotlib pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple 也可以使用pycharm来安装matp…...

系统分析师---计算机网络思维导图

TCP、IP协议簇&#xff08;4星&#xff09; 传输协议&#xff1a;TCP有连接、可靠、有回应机制、三次握手基于TCP的应用层协议&#xff1a;POP3&#xff1a;邮件收取&#xff0c;默认端口110SMTP&#xff1a;邮件发送&#xff0c;默认端口25FTP&#xff1a;文件传输协议&#…...

算法练习(七)数据分类处理

一、数据分类处理 1、题目描述&#xff1a; 信息社会&#xff0c;有海量的数据需要分析处理&#xff0c;比如公安局分析身份证号码、 QQ 用户、手机号码、银行帐号等信息及活动记录。采集输入大数据和分类规则&#xff0c;通过大数据分类处理程序&#xff0c;将大数据分类输出…...

nohup ./startWebLogic.sh >out.log 2>1 解析

在启动weblogic的时候我们经常看到如下的命令&#xff1a; nohup ./startWebLogic.sh >out.log 2>&1 & 从09年开始用weblogic到现在已经过去3年多了 &#xff0c;今天终于将该命令理解清楚了。 其中 0、1、2分别代表如下含义&#xff1a; 0 – stdin (standa…...

OpenCV 坡度计算(基于DEM,C++版本)

文章目录 一、简介二、实现代码三、实现效果参考资料一、简介 假设一个点位于曲面 z = f ( x , y ) z=f(x,y) z=...

IDEA上使用git,知道这几步操作就够了!

前言由于一年多没用git&#xff08;种种原因不堪回首&#xff09;&#xff0c;所以在上班当天&#xff0c;整个人都不好了&#xff0c;从拉取代码到提交代码&#xff0c;整整花费了不少时间&#xff0c;而且有些操作都不知道啥作用&#xff0c;点也不是&#xff0c;不点也不是&…...

Shell的退出状态(if语句判断的是某个命令的退出状态)

以下内容源于C语言中文网的学习与整理&#xff0c;如有侵权&#xff0c;请告知删除。 一、退出状态 &#xff08;1&#xff09;不管是 Bash 内置命令&#xff0c;还是外部的 Linux 命令&#xff0c;还是自定义的 Shell 函数&#xff0c;当它运行结束或者退出时&#xff0c;都…...

Scala面向对象

与java的区别和联系 类的定义&#xff1a; class Person{ var name "scala" def sayHello(){ println("Hello,"name) } def getName name } 注意&#xff1a;如果在定义方法的时候指定了()&#xff0c;那么在调用的时候()可写可不写&#xff0c;如果在定…...

LLaMA-META发布单卡就能跑的大模型

2023年2月25日&#xff0c;Meta使用2048张A100 GPU&#xff0c;花费21天训练的Transformer大模型LLaMA开源了。 1.4T tokenstakes approximately 21 days 以下是觉得论文中重要的一些要点 1&#xff09;相对较小的模型也可以获得不错的性能 研究者发现在给定计算能力限制的情…...

第一篇自我介绍(单片机)

小白的单片机之旅 &#x1f914;自我介绍&#x1f914; &#x1f60a;学习目标&#x1f60a; &#x1f61c;关于单片机&#x1f61c; &#x1f31d;目标公司&#x1f31d; &#x1f340;小结&#x1f340; &#x1f389;博客主页&#xff1a;小智_x0___0x_ &#x1f389;欢…...

贵阳建设厅网站/杭州seo网站哪家好

概述 之前做了k8s CSI相关组件的源码分析《 kubernetes ceph-csi分析 目录导航》&#xff0c;接下来一段时间&#xff0c;将对k8s的核心组件kube-controller-manager中的一些关键controller做源码分析。 导航链接 1.《 k8s garbage collector源码分析&#xff08;1&#xff…...

我的专业网站建设策划书/安卓aso优化工具

广度优先搜索&#xff0c;深搜超时 需要判断界限&#xff0c;做标记&#xff0c;已到过的地点就不必去了 #include<cstdio> #include<iostream> using namespace std; int head0,tail1; int n,k; int f[199999]; int d[9999999]; int t[9999999]; int bfs(int w) …...

SOHO英文网站制作/中囯军事网

在Delphi中能实现远程调用的有DCOM或COM&#xff0c;这两种方式实现起来非常的相似。DCOM属于旧版本的远程调用技术&#xff0c;非常实用&#xff0c;所提供的服务保存在应用程序工程中。COM是新版本的远程调用技术&#xff0c;所提供的服务保存在动态库所在的工程中。 一、DCO…...

免费模型网站/seo整合营销

转自&#xff1a;http://www.iteye.com/topic/470396 在开源java工具包里&#xff0c;最有名的当属apache commons。其中&#xff0c;以commons lang包最为开发者熟知。 但是它作为第三方包存在&#xff0c;或多或少给开发者带来一些不便利。 面包牛奶总是会有的&#xff0c;从…...

个人如何做网站/app注册推广拉人

当初学 Python 时&#xff0c;想要弄懂 Python 的错误信息的含义可能有点复杂。这里列出了常见的的一些让你程序 crash 的运行时错误。 1&#xff09;忘记在 if , elif , else , for , while , class ,def 声明末尾添加 &#xff1a;&#xff08;导致 “SyntaxError &#xff1…...

西安seo外包费用/惠州seo按天计费

1、vue2.0 响应式数据的原理 概述:Object.defineProperty() 递归数据劫持+订阅发布者模式 Vue2.0在初始化数据时,会给data中的属性使用Object.defineProperty重新定义所有属性,当页面取到对应属性时,会进行依赖收集(收集当前组件的watcher)如果属性发生变化会通知相关依…...