winkkkkk9421
请问什么是gpui?
"GPUI" (https://link.segmentfault.com/?enc=5kAqrLjSrFUcMb%2B%2BoU7f8A%3D%3D.t6Eg%2BGj9zi9ELUChzo%2BOAqmH5d5mvm54k5MZNwpvs%2BE%3D)
是 Zed 作者为开发 Zed 而使用 Rust 编写的一个 UI 框架。
GPUI 是一种混合立即模式和保留模式、GPU 加速的 Rust UI 框架,旨在支持各种应用程序1。
***
1. "https://github.com/zed-industries/zed/blob/main/crates/gpui/README.md" (https://link.segmentfault.com/?enc=x03DbXlZEB%2B%2BDMXRQDAa7Q%3D%3D.2wS4JnTjLzaOpyUHliVrFX4YhyVHRGNgfCnLmw74Fl1qRnT3VUsNmXij8PLwL%2FeSgyAlZGb3voYlfrBvI%2Fd3roK6kobAwuUWF9rNvhbICfs%3D) ↩
winkkkkk9421
如何在命令行 sync fork 同步已克隆的代码仓库?
git remote add upstream https://github.com/milvus-io/pymilvus.git
git fetch upstream
git checkout master
git merge upstream/master
git push origin master
参见:"https://zhuanlan.zhihu.com/p/291845721" (https://link.segmentfault.com/?enc=dFPSyDpyE1D871hDTiFSQQ%3D%3D.%2FjfsP0YxACbU9boLlclUCiMttzS6NrcKMeGS%2Fhs6ZnrpKNpYmQBjyGGLS3QNutqy)
winkkkkk9421
问一个VUE3中的useAttrs问题?
定义一个组件:
atts
import { useAttrs } from "vue"
const props = defineProps(['class','title']);
let $atts = useAttrs();
console.log($atts);
来调用这个组件的页面:
import atts from '../components/atts.vue'
const handler = ()=>{
alert('222');
}
运行之后点击页面中的文字atts,你会发现alert弹出了一次。按理说不是应该弹出两次才对的吗?
然后我略微的修改下组件:
atts
import { useAttrs } from "vue"
const props = defineProps(['class','title']);
let $atts = useAttrs();
console.log($atts);
这次再来点击中的文字atts,你会发现alert弹出了两次。
啥原因啊?
winkkkkk9421
canvas坐标变换问题?
"https://zhuanlan.zhihu.com/p/433974226" (https://link.segmentfault.com/?enc=cdVYVgjOK9fyKYtw7iLYEQ%3D%3D.EqCFcppFvarwcmh3FqN45m7SUy8v7c62HBPzOnHgVZ5X%2Bz0sTe5OkyY1DbQBL077)
winkkkkk9421
请问如何对数组类型type提出一条元素 & 其他的type,进而做一个props?
我现在有如下的props
export type TabsCompProps = {
label: string,
children: React.ReactNode,
key: string,
breadcrumbs: string[]
}[]
export type DetailProps = {
content: string
}
我想要做一个props如下:
type TabsWithDetailProps = {...}[]
TabsWithDetailProps是一个数组,数组里面的元素由TabsCompProps数组提出的一条信息和DetailProps
组成。请问应该如何做呢?
winkkkkk9421
请问封装axios时,你们会把loading功能封进去吗?
当前有个很纠结的问题,我想封装一个axios请求工具,想作为一个独立工具使用,但如果把loading组件(很多第三方UI组件库都有提供)封进去,这样就会破坏这个axios工具的独立性,因为你需要依赖某一个第三方UI组件库提供的loading组件,如果axios请求工具不提供loading功能,感觉有点封的不完整,请问大神们,你们到底如何解决的呢?麻烦指点下小白的我,谢谢
winkkkkk9421
Nuxt3 能不能怎么样可以在根目录 id="__nuxt" 上加一个class?
你想说 "__nuxt" 吧?"__next" 是什么鬼……
根节点能自定义的只有 id 和 tag。不过你依然可以用 JS 原生 DOM API 来操作:
document.getElementById('__nuxt').classList.add('page-content');
winkkkkk9421
Debian 12 开机自动启动 jar 为什么不行?
你可以包你的jar 做成systemctl弄成系统服务,这样可以弄成自启
"https://blog.csdn.net/JineD/article/details/114819292" (https://link.segmentfault.com/?enc=zD7QeD9pFq0M8%2B6aPWQwPA%3D%3D.VEsJT2gYY86xI%2BqE%2BwC71vRO1o0pW5%2Fby3Auf7dOEQv1q9VZqAqSY1PUL6%2BI8V8a15b730Wi4SNgHJ0XDeipcg%3D%3D)
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250105/5c0716d599a0d10f890e8a96c229f5f4.png)
winkkkkk9421
[Vue Error]Error in nextTick: "TypeError: Cannot read properties of undefined (reading 'xxx')前端报错?
打开一个页面时,报如下的错误
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250105/1e86c7f6ff3db99865b37be4d9cbd623.png)
在报错的vue文件中是存在add这个函数的,为啥会报undefined呢?
winkkkkk9421
自己做了个app,有内容发布功能,需要表情包,有免费的吗?
抖音 小红书 这些app的评论都是自己的表情图
有没有免费,好用的免费表情图推荐下载?
winkkkkk9421
ts对象函数的重载怎么写?
type Test = {
o1(num: number, flag?: boolean): number | number[];
};
class OTest implements Test {
o1(num: number): number;
o1(num: number, flag: boolean): number[];
o1(num: number, flag?: boolean): number | number[] {
if (flag) {
return [num];
} else {
return num;
}
}
}
const testInstance = new OTest();
console.log(testInstance.o1(1)); // 输出: 1
console.log(testInstance.o1(1, true)); // 输出: [1]
winkkkkk9421
vue/uniapp中,如何将十六进制字符串转换成有符号 2 补码中的十进制?
需要判断有没有负号,有负号拿有负号的值,没负号就拿正常的的值,
例如c4转换后为-60,格式就是像c4这样的,全是两位的
小弟在这里先感谢各位大神们,感激不尽,祝大神们发财祝大神们取漂亮老婆
winkkkkk9421
阿里云oss图片不支持浏览器缓存?
项目中有图库功能,用户可以上传自己的图片到阿里云oss,然后有个图库,图库用react-window实现了虚拟列表去滚动。
比如接口请求回来100条数据,100张图片在虚拟列表中滚动。
滚动到下面,再滚动到上面时,发现图片没有http缓存,每次新的图片出来http状态都是200,都需要几十毫秒去请求,阿里云oss能不能设置让浏览器支持http缓存,这样已经加载过的图片,就不用再次http请求了。
winkkkkk9421
VChart中如何定义label 显示的数值小数位数?
我使用VChart图表时,发现如果数字的小数位比较长时显示效果很不美观,有什么办法能控制标签显示的小数位长度吗?
"ada5214a-6f76-47e3-a246-6b0197644e40.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241231/beca38757964bee167d255e069d83a3f.png)
winkkkkk9421
npm包安装问题?
请大佬指教,我pnpm安装的包,node_modules 里也看到了,但是import还是未导入,还是红色的
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241229/9773e125f8e174e7c2ec0d63e2a60d2d.png)
这个是vue3打印包的安装
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241229/6e5c1d4bfcf4358dfe1cebb05c69177c.png)
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241229/01a6012b3a9cdb6287c817467afbc74a.png)
winkkkkk9421
这种git问题怎么解决?
主要使用"git cherry-pick"命令处理。
将 git 切换到生产分支,使用"git cherry-pick commit_hash"命令将功能B涉及到的commit复制到生产分支上。
Ps:如果git的图形操作界面是中文版的,"cherry-pick"会被翻译为"优选"。
winkkkkk9421
js 鼠标选中一段文本 当从后往前选 怎么获取到选择的文本?
需要实现类似csdn下面的效果,鼠标选中一段文本,弹出操作菜单
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241226/a5bb7175623db9fd41b0440a790e2b5b.png)
鼠标选中采用的是mouseup事件,当选中文本时,通过window.getSelection()获取选中的文本,目前存在的问题是:
1.当从前往后选中文本时,可以获取到选中的文本内容,但当从后往前时,获取不到文本内容(前提是文本为json字符串或者是url编码等,非普通文字)
2.当选中文本后,弹出菜单,点击除菜单区域外其他地方时,关闭菜单区域
针对问题2,在mouted中对document添加mouseup或click事件,关闭菜单,都无法实现关闭,只有选择别的文本时,才会关闭上一次的菜单
请问,大家有什么好的处理办法嘛?
winkkkkk9421
请问现在最新的小程序 是不是不能直接通过任何接口获取用户昵称了,只能靠用户手动填写么 ?
"https://developers.weixin.qq.com/miniprogram/dev/framework/op..." (https://link.segmentfault.com/?enc=uPNTMHAphEPwDNT7Um%2FV3w%3D%3D.5fG1f5PzI%2FkudxQooG6GK8R291Z3krUrLx%2FzzLN42PK4ifCwftN%2BnNn9fu7TcMwnP4LPJPWAB9ZD734JWvm4fInWvMiPfRjgDX3RuXzeC%2FhKiESM1cwghiow4yRk8%2FcW)
winkkkkk9421
Java将数据放到缓存中,当需要从缓存中获取数据的时候获取不到?
另外,你这类都使用"@Component"注解,Bean默认就是单例,"getInstance()"多此一举?
需要看下你在调用时怎么做的,理论上你最好使用"@Resource"之类注解进行依赖注入,而不是使用"getInstance()"这种方式。
既然是单例,就无需考虑多实例场景,故"static"也可省略。
***
另外,推挤你使用"@PostConstruct"或者"InitializingBean",来完成一些Bean的业务类初始化动作。
既然使用Spring,就好好去用它
***
推荐你使用这种方式
@Component
public class ScenarioBuffer implements IActionListener {
// 没必要使用 static
// public static List getBAsset(String groupId) {
public List getBAsset(String groupId) {
if (assetBuffer.containsKey(groupId)) {
return assetBuffer.get(groupId);
}
return null;
}
}
@Service
public class XxxService {
// 注入依赖
@Resource
private ScenarioBuffer scenarioBuffer;
public void xxx() {
// 直接使用即可
final List asset = scenarioBuffer.getBAsset("xxx");
}
}
winkkkkk9421
web怎么实现在图片上绘制多边形且可编辑?
效果类似高德这种的:
https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241212/ddc2f9958b94039bd3acf04dd8795cf8.png
winkkkkk9421
uniapp里面这种轮播样式怎么实现?
使用这个插件:
«"https://ext.dcloud.net.cn/plugin?id=12408" (https://link.segmentfault.com/?enc=XkbDsWdE8Nnh2rydbP4k7Q%3D%3D.V6l2zkAB9p%2FWBJXIVx1jsk8r5Ui4c2z7twHY7hXBg5OGdWTFny03KXmyEIlJAc%2BW)
»
或者这个:
«"https://ext.dcloud.net.cn/plugin?id=12404" (https://link.segmentfault.com/?enc=x9PmW8TbDOwjL4PaUUO2iA%3D%3D.yG1lTvtSH5jTzqTEe63zyLiuLhYblQbmmo1Q5opVIIhE7coDh76iEIm%2BNc9XgeHe)
»
或者这个:
«"https://ext.dcloud.net.cn/plugin?id=11718" (https://link.segmentfault.com/?enc=X3UqGDkDq7sWbazu4duTxw%3D%3D.xD%2FPPVXK8mveX6bAxsLonj0TokSdcQ5MqUMVw9wg6WCUa4Rnf79IA4rHlVY0rPPg)
»
任选一个好用的吧
winkkkkk9421
vue el-input数据处理问题?
要求el-input输入的值是数字数组形式:[123,123],组件定义的value是string类型,所以在查询的时候需要对input输入的值进行转换。
我的处理方式:
// 处理表单所有元素数据
// 处理表单所有元素数据
handleAllFormItem () {
// 处理空数据
let newForm = {}
let objs = {}
let obj = {}
const { searchForm } = this
// 处理工单号
let str = searchForm.ticket_id
if(typeof str !== 'undefined') {
const tickId = str.split(',').map(Number)
objs = { ticket_id: tickId }
}
obj = {...searchForm, ...objs}
console.log(obj, 'searchForm------')
newForm = this.handleFormFormat(obj)
// newForm = { ...this.handleFormFormat(searchForm), ...objs}
return newForm
},
handleFormFormat方法是处理动态表单数据格式化的:
handleFormFormat (searchForm) {
const newForm = {}
for (const key in searchForm) {
let item = this.searchForm[key]
// bool 非整数字符串
if (
typeof item === 'boolean' ||
typeof item === 'number' ||
(!Array.isArray(item) && isNaN(Number(item)))
) {
newForm[key] = item
continue
}
// 整数字符串,数组
if (item && item.length > 0) {
if (Array.isArray(item)) {
let arr = []
item.forEach((it) => {
if (!isNaN(Number(it))) {
it = Number(it)
}
arr.push(it)
})
newForm[key] = arr
continue
}
if (!isNaN(Number(item))) {
item = Number(item)
}
newForm[key] = item
}
}
return newForm
},
什么条件不输的时候查出的结果打印:
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241207/ef1dc5fa5e909a4ee06232e95bb6a8ee.png)
输入数字后查询打印结构(显示数据处理过后的):
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241207/a788ce33654bd3b1800adcc111ec41cf.png)
但是network传的值却没有改变,还是字符串形式的:
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241207/c655a3c6e22965674c8841990246c7a9.png)
求助大佬提点一下,哪里问题
winkkkkk9421
有没有快速自动生成查询条件的数据查询框架?
JDBC:这是最简单的数据库查询方法,通过Java API提供。您只需定义好SQL查询语句,然后在前端页面上设置查询条件,最后导出结果表单。
Dash:这是一款文档查询工具,但它也可以用于创建查询工具。您可以将其与Python结合,利用其丰富的文档库来快速构建前端界面,并设置查询条件。
SQLAlchemy:这是Python中的一款优秀的ORM框架,可以与各种第三方web框架(如flask、tornado、django、fastapi等)结合使用。它提供了一种更接近原生的方式来执行SQL查询,使得开发者可以更加灵活地定义查询条件和输出字段。
winkkkkk9421
请教下 element-plus中封装 datepicker,点击后没反应,是怎么回事?
// script
const props = defineProps(['modelValue'])
const emits = defineEmits(['update:modelValue'])
const attrs = useAttrs()
const value = computed({
get(){
return props.modelValue
},
set(val){
emits('update:modelValue', val)
}
})
// template
winkkkkk9421
open3d读取bin文件x,y,z,r,g,b,intensity转为pcd?
import open3d as o3d
# 读取点云数据
pcd = o3d.t.io.read_point_cloud("name.pcd")
pcd_intensity = pcd.point["intensity"] # 访问强度
pcd_points = pcd.point["positions"] # 访问位置
# 转换为NumPy数组(如果需要)
pcd_intensity = pcd_intensity[:, :].numpy()
pcd_points = pcd_points[:, :].numpy()
# 生成带有强度信息的新点云
device = o3d.core.Device("CPU:0")
dtype = o3d.core.float32
pcd = o3d.t.geometry.PointCloud(device)
pcd.point["positions"] = o3d.core.Tensor(pcd_points, dtype, device)
pcd.point["intensity"] = o3d.core.Tensor(pcd_intensity, dtype, device)
# 将新点云写入PCD文件
o3d.t.io.write_point_cloud("name1.pcd", pcd, write_ascii=True)
winkkkkk9421
uniapp h5开发,我想把页面内的一个canvas点击一个按钮转成图片保存到手机上?
用uniapp开发的h5页面,用在微信和小程序公众号上面,我想把一个canvas点击某个按钮后变成图片保存到手机上,但是我用下面两种方法都拿不到canvas,到底用什么命令呀?有人做过没?是uniapp的h5页面。
document.getElementById("myCanvas")
document.querySelector("#myCanvas")
winkkkkk9421
服务器做了端口映射,外网访问公网ip+端口号能通,内网服务器访问公网ip+端口号就不通怎么回事?
是不是成环了?应该怎么解决,服务器是Windows的。
winkkkkk9421
这种类型的颜色渐变页面以及交互前端应该怎么做啊?
你可以使用vue-color库来实现调色板,效果如下图所示,基本能满足你的需求了
* 项目主页地址: "https://github.com/xiaokaike/vue-color#readme" (https://link.segmentfault.com/?enc=vLup0ifhV7pR0DVywNkGQA%3D%3D.ZM1zYenkRVogK0kK2AR22UH7Kr5zON%2FK3UTHFysdCU2BoIzbjdgzSopKbvjeH%2Fga)
* demo 地址 "https://xiaokaike.github.io/vue-color/" (https://link.segmentfault.com/?enc=b7IvKyYMSBm2fvQ9cU%2FJxA%3D%3D.hP0Uskp%2FyXfaGJifN1%2BEiLRyImTVchfGgW9KRwxA3%2Bq5g%2B7Jr8nHG043N4GgjBLm)
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241122/eda0dee3b583cb072703d9f19f9a7b92.png)
winkkkkk9421
单服务器视频网站cpu wa高,如何优化?
我是一名内网视频网站管理员。目前我们的网站在局域网内部署,向用户提供在线视频服务。在访问量大时,整体网站访问速度很慢。
服务器环境是centos7 apache mysql php,使用海洋cms作为内容管理系统。
在访问量大时(80端口连接数大约1200),使用top命令查看发现load average达到上百(cpu仅有8核心),并且大部分cpu使用都是wa状态。
由于服务器使用的是挂载的网络存储,我想可能是硬盘io限制了速度。
请问有没有优化办法?
winkkkkk9421
mybatis-plus使用静态工具查询时出现语句错误报错?
两个类,User中包含order
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Table(name = "user_order",charset = MySqlCharsetConstant.UTF8,engine = MySqlEngineConstant.InnoDB)
public class Order {
@Column(name = "id",type = MySqlTypeConstant.VARCHAR,length = 3,comment = "用户id")
private String user_id;
@Column(name = "address",type = MySqlTypeConstant.VARCHAR,length = 100,comment = "收货地址")
private String user_address;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@ToString
@Table(name = "user",charset = MySqlCharsetConstant.UTF8,engine = MySqlEngineConstant.InnoDB)
public class User {
@Column(name = "id",isKey = true,type = MySqlTypeConstant.VARCHAR,length = 100,comment = "主键ID")
private String id;
@TableField("user_name")
private String name;
@TableField("user_age")
private Integer age;
@TableField("user_email")
private String email;
@TableField(exist = false)
private List orders;
}
其中mapper和mapper.xml均用mybatis-plus自动生成
UserMapper
public interface UserServcie extends IService {}
UserMapperImpl
@Service
public class UserServcieImp extends ServiceImpl implements UserServcie{}
OrderMapper
public interface OrderService extends IService {}
OrderMapperImpl
@Service
public class OrderServiceImpl extends ServiceImpl implements OrderService {}
测试
// 测试
Db.lambdaQuery(Order.class).in(Order::getUser_id,id).list();
报错如下
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order WHERE (user_id IN ('3'))' at line 1
### The error may exist in com/train/spring_mybatis_plus/mapper/OrderMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT user_id,user_address FROM order WHERE (user_id IN (?))
### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order WHERE (user_id IN ('3'))' at line 1
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:156)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:166)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at com.sun.proxy.$Proxy80.selectList(Unknown Source)
at com.baomidou.mybatisplus.extension.conditions.query.ChainQuery.lambda$list$1d3f6527$1(ChainQuery.java:39)
at com.baomidou.mybatisplus.extension.toolkit.SqlHelper.execute(SqlHelper.java:318)
at com.baomidou.mybatisplus.extension.conditions.ChainWrapper.execute(ChainWrapper.java:65)
at com.baomidou.mybatisplus.extension.conditions.query.ChainQuery.list(ChainQuery.java:39)
at com.train.spring_mybatis_plus.service.UserServcieImp.selectUserOrder(UserServcieImp.java:61)
at com.train.spring_mybatis_plus.service.UserServcieImp$$FastClassBySpringCGLIB$$ac685e70.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386)
at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703)
at com.train.spring_mybatis_plus.service.UserServcieImp$$EnhancerBySpringCGLIB$$b8ea8e2d.selectUserOrder()
at com.train.spring_mybatis_plus.SpringMybatisPlusApplicationTests.testSelectOrderByUserId(SpringMybatisPlusApplicationTests.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)
at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order WHERE (user_id IN ('3'))' at line 1
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:121)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:916)
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:354)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:65)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:80)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:65)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:333)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:110)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:90)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154)
... 88 more
这种报错是什么造成的呢?如何破
winkkkkk9421
请问teamviewr有办法在内网模式生成唯一ID吗?
请问teamviewr有办法在内网模式生成唯一ID吗?
因为设备使用WIFI连接,IP是浮动且是192.168.4.215跟WIFI之间的IP,而不是内网10.153.x.x的IP
无法使用IP或是电脑名称远端连接此车间的电脑(车间电脑不能开外网)
请问teamviewr有办法在内网模式生成唯一ID吗? 如: 154546789,内网能ping通的电脑,能借此ID连接
winkkkkk9421
如何将js数组中对象的属性值相等的对象组合成一个新的数组元素,然后返回一个新的数组?
将js数组中对象的属性值相等的对象组合成一个新的数组元素。
可以使用reduce、map等函数
比如:
// 原始数组
const arr = [
{title: '标题1', url: 'url', groupId: -1},
{title: '标题2', url: 'url', groupId: 123},
{title: '标题3', url: 'url', groupId: 123},
{title: '标题4', url: 'url', groupId: -1},
{title: '标题5', url: 'url', groupId: 456},
{title: '标题6', url: 'url', groupId: 456},
{title: '标题6', url: 'url', groupId: 789},
]
// 期望结果
const resArr = [
{title: '标题1', url: 'url'},
{groupId: 123, group: [{title: '标题2', url: 'url'}, {title: '标题3', url: 'url'}]},
{title: '标题4', url: 'url'},
{groupId: 456, group: [{title: '标题5', url: 'url'}, {title: '标题6', url: 'url'}]}
]
如果 "groupId" 为-1,则删除其"groupId"属性,并按顺序将该元素加入新的数组中即可
另外:arr数组中相同groupId的元素在数组中的位置总是相邻 的。(groupId为-1的除外)
比如:
// 正例
const arr = [
{title: '标题1', url: 'url', groupId: -1},
{title: '标题2', url: 'url', groupId: 123},
{title: '标题3', url: 'url', groupId: 123},
{title: '标题4', url: 'url', groupId: -1},
{title: '标题5', url: 'url', groupId: 456},
{title: '标题6', url: 'url', groupId: 456},
{title: '标题4', url: 'url', groupId: -1},
]
// 反例
const arr = [
{title: '标题1', url: 'url', groupId: -1},
{title: '标题2', url: 'url', groupId: 123},
{title: '标题4', url: 'url', groupId: -1},
{title: '标题3', url: 'url', groupId: 123},
{title: '标题5', url: 'url', groupId: 456},
{title: '标题5', url: 'url', groupId: 789},
{title: '标题6', url: 'url', groupId: 456},
]
winkkkkk9421
Delphi可不可以制作出像c#那样的dll类库?
问题理解
你希望了解在Delphi中是否可以创建类似于C#中的DLL类库,以便在另一个项目中直接使用DLL中的类和方法,而不需要通过复杂的exports声明或ActiveX接口设计。
回答
在Delphi中,你可以通过以下步骤创建和使用类似于C#中的DLL类库:
1. 创建DLL项目:
- 创建一个新的DLL项目(例如"dll.dpr")。
- 在该项目中定义你的类和方法。例如:unit MyDllUnit;
interface
type
TMyCls = class
public
procedure Foo();
end;
implementation
procedure TMyCls.Foo();
begin
// 方法实现
end;
initialization
finalization
end.
2. 编译DLL:
- 编译该项目生成"dll.dll"文件。
3. 在主项目中引入DLL:
- 在主项目(例如"test.dpr")中,使用"uses"语句引入DLL中的单元。program Test;
uses
MyDllUnit;
var
cls: TMyCls;
begin
cls := TMyCls.Create();
cls.Foo();
cls.Free();
end.
4. 配置项目路径:
- 确保主项目能够找到DLL文件。可以将DLL文件放在主项目的同一目录下,或者在主项目的搜索路径中添加DLL的目录。
关键点
- 不需要exports声明:通过将类定义在DLL的单元中,并在主项目中引入该单元,可以直接使用类和方法,无需使用"exports"声明。
- 不需要ActiveX接口:这种方法避免了使用ActiveX接口的复杂性,简化了DLL的使用。
通过上述步骤,你可以在Delphi中实现类似于C#中的DLL类库的使用方式,直接创建和使用DLL中的类。
winkkkkk9421
视频接口返回类型解析?
有一个短视频接口,我想知道如何能通过axios请求或者后端请求,直接获得视频地址
"http://v.nrzj.vip/video.php?_t=0.9640358809997094" (https://link.segmentfault.com/?enc=5k2JCvg8am3kxjyov%2BVTiw%3D%3D.vvBgjCn87x9%2BCd2p6UwGHCqMGtxvTRDeBm%2B%2BERQnolQRmObGxGigkrRWS09ca3lexQ06V1%2FSmR6x81LjCZkB2w%3D%3D)
(1)放在浏览器可以直接下载视频,并每次下载不同的视频
(2)放在video的src中可以直接播放,并且每次创建video组件都会播放新的视频
(3)因为有时候接口会失败,失败时想做处理,所以src需要动态的,最好可以把接口外置,自己这边请求一下,失败了调用redis缓存的视频地址,因为每十次大概失败一次,失败率有点高。
这边也在考虑用java请求这个接口然后用application/octet-stream接收,然后自己处理压缩二次封装。但是不是很理解这个类型的视频接口,不理解这种返回的是什么类型的东西,还望大佬解答
winkkkkk9421
这种效果有没有合适的插件推荐呢?
"upload.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241109/26c3b2d28d5893db470759170ef38cb2.png)
大佬们,这个功能有没有合适的插件推荐:
1、底图图片支持缩放
2、可以在图片上加marker(图中的实心红色圆圈、黑色圆圈和绿色圆圈,颜色代表状态),也可以随着图片的缩放而缩放,但位置不能变
不知道应该怎么搜,希望有经验的小伙伴们推荐一个合适的插件
winkkkkk9421
扫码登录成功后, 如何维护浏览器登录状态?
正常流程就是建立token,基本上主流项目,都是通过token来进行登陆校验,不过不需要建立token表,你可以存redis里,或者使用jwt生成token,这样就直接通过算法来确定token是否正确,不需要额外进行存储
winkkkkk9421
如何在chrome element面板调试一个需要页面交互才能显示,交互结束会立刻消失的节点?
复杂页面有一个元素,需要页面交互才会被创建,比如拖动操作才会显示出来,但是如果需要交互就无法去chrome
element面板里找这个element了。一旦鼠标移动到element面板,交互结束,这个元素就会消失,也无法看到它,如何才能在element里调试它,以及它的样式呢?
希望能在element面板调试它的样式,看它的html属性等
winkkkkk9421
哪位高手能给看下,这张图片上面的黄色文字是什么字体?
哪位高手能给看下,这张图片上面的黄色文字是什么字体?
https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241106/370864faf835863200f51d3e41926e4b.png
网上实在是没找到。但我看到有两个主体都用过,说明不是某人单独拥有的独有设计,可能是一个通用字体。
网上找了半天也没找到。有了正确答案可以发个红包给你,谢谢!
winkkkkk9421
JWT 怎么解决用户被禁用的问题?
使用 JWT 作为用户登录认证的时候,是否需要每次都通过 jwt payload 里面的信息(如 ID)来通过数据库查询出用户?
否则怎么判断当前用户是否已经被禁用、删除、角色权限变化等信息,直接使用 jwt payload 里面的信息很可能已经过时?
winkkkkk9421
为什么浏览器初次进入页面时会直接使用强缓存,导致资源不会更新,后续刷新则会使用协商缓存?
使用浏览器打开网址的时候网站的文档文件(index.html)会直接从缓存中读取(强缓存),不会发起请求,而之后再从这个页面点击刷新按钮时就不会直接从缓存中读取了,而是进行协商缓存,如果文件发生改变了则会去获取最新的文件。
由于初次进入页面的时候直接从缓存中读取,所以导致了就算服务器上的文件改变了浏览器也不会更新,我希望可以在第一次进入浏览器的时候就进行协商缓存,如果文件发生了变化就重新请求资源。
因此,我想请教一下:
1.为什么产生这种现象
2.有什么解决方案,我现在想到的是通过js进行一次页面刷新
3.chrome浏览器可不可以使用js进行强制刷新(等同于 Ctrl+F5 的功能),这个问题只是顺带问的,上面问题中提到的刷新就是普通的刷新。
"image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241105/506800a06135f19d45adefdceec51b1e.png)
使用的 "http-server" npm 包搭建的资源服务器。
问题展示
1. "image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241105/5564203f8b347cb76fd896b79229ab21.png)
就算服务器上的资源更新了,此次进入页面也不会获取最新的内容
"image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241105/6c0e47045429c36a5c25476931068363.png)
2. 点击当前页面的刷新按钮(或者按 F5)
如果资源更新了,此次刷新就会获取最新的内容
"image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241105/1aa4c836b4fc5e97512d05d986d34b38.png)
补充
响应头中没有设置"Cache-Control"的也会有这种情况
"image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241105/7ec50c5f44c2d84696765f2d1fb28eb1.png)
"image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241105/aa3343c3e608406bdebd817c800dcc3e.png)
winkkkkk9421
如何设置div内的模块靠左显示,模块内容按行显示?
"image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241103/67bda890ea9c5fe22de262624a27ac73.png)
是要这样的吗, id是List的加上这个:
display: flex;
flex-wrap: wrap;
span 改成div
Title
ul {
padding: 0;
position: relative;
top: 70%;
left: 45%;
overflow: hidden;
list-style: none;
border: 0px solid #c1c1c1;
display: inline-block;
margin-top: 5px;
height: 30px;
}
li {
float: left;
padding: 5px;
color: #273346;
font-size: 15px;
cursor: pointer;
}
li:hover {
font-weight: bold;
background: #C1C1C1;
}
.active {
background: #CCE8FF;
}
#List {
display: flex;
flex-wrap: wrap;
}
#List > div {
text-align: center;
}
//定义变量
let data = [
{ id: 1, name: '小岚', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 2, name: '小懒', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 3, name: '小烂', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 4, name: '小澜', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 5, name: '小蓝', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 6, name: '小兰', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 7, name: '小栏', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 8, name: '小揽', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 9, name: '小览', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 10, name: '小斓', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 11, name: '小榄', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 12, name: '小岚', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 13, name: '小岚', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 14, name: '小岚', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 15, name: '小岚', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 16, name: '小岚', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 17, name: '小岚', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 18, name: '小岚', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
{ id: 19, name: '小岚', age: 25, gender: '女', src: 'https://vebaike.com/uploads/202309/1695222065Xi0uLws5_s.png' },
];
var nodeEle = document.createElement('div');
nodeEle.id = "listpage";
document.documentElement.appendChild(nodeEle);//元素加入body
const newnodeDiv = document.getElementById("listpage");
newnodeDiv.innerHTML = '';
newnodeDiv.setAttribute('style', '' +
'position:fixed;' +
//'right:0px;' +
'top:0px;' +
'left:0px;' +
// 'left:620px;' +
// 'bottom:240px;' +
//'left:' + newwid + 'px;' +
//'top:'+ newhei + 'px;' +
//'bottom:'+ he + 'px;' +
'width:1277px;' +//最大宽度
'height:592px;' +//最大高度
//'height:auto;' +
'overflow:auto;' +
//'overflow-wrap: break-word;' +
'font-size:14px!important;' +
//'padding:40px;' +
'border-radius:5px!important;' +
//'border:none;' +
//'border:1px solid #ccc!important;' +
'border:1px solid #a9a9a9!important;' +
'background-color:#fff!important;' +
'z-index:2147483647!important;' +//显示最顶层
'');
var div0 = document.createElement('div');
div0.innerText = '封面';
div0.style.width = '1500px';
newnodeDiv.appendChild(div0);
var newDiv = document.createElement('div');
newDiv.id = "List";
newDiv.style.height = 'auto';
newDiv.style.width = '1500px';
newnodeDiv.appendChild(newDiv);
let div = document.getElementById("List");
currentPage = 1,
pageCount = 12,
list = null,
li = null;
function paginationByJS(data, div, currentPage, pageCount, list, li) {
//拿到我们的总页码
function getTotalPage(data, pageCount) {
if (Math.ceil(data.length / pageCount) 0 && !data.length && !totalPge > 0 && !pageCount > 0) {
return console.error('您传入的参数有误');
}
//当前页在头尾的情况
if (currentPage === 1) {
return (totalPge === 1) ? {
begin: 0,
end: data.length - 1
} : {
begin: 0,
end: pageCount - 1
}
}
if (currentPage === totalPge) {
begin = ((currentPage - 1) * pageCount);
end = data.length - 1;
return {
begin, end
}
}
//在中间的情况
if (currentPage > 1 && currentPage parseInt(i.innerText) === currentPage)).classList.add('active');
}
//返回渲染数组
function getRenderList() {
let temp = getArrIndex(currentPage, data, getTotalPage(data, pageCount), pageCount);
return data.slice(temp.begin, temp.end + 1); //slice方法取头不拿尾
}
//第一次创造列表数据
function createBtn(totalPage) {
//let ul = document.getElementsByTagName('ul')[0];
var newUl = document.createElement('ul');
newUl.id = "ul-list";
//let ul = document.getElementsByTagName('ul');
newnodeDiv.appendChild(newUl);
const ul = document.getElementById("ul-list");
//每次都至少显示五个 当前 当前的前2个 当前的后2个
for (let i = 1; i 6 && totalPage > 7) {
li.innerText = '...';
ul.appendChild(li);
li = document.createElement('li');
li.innerText = totalPage;
ul.appendChild(li);
li = document.createElement('li');
li.innerText = '>';
ul.appendChild(li);
break;
}
ul.appendChild(li);
//到头了您
if (i === totalPage) {
li = document.createElement('li'); li.innerText = '>';
ul.appendChild(li);
}
}
}
function btnControl(totalPage, currentPage) {
//小于7 就直接全部排出来就ok 不用搞这些花里胡哨的
if (totalPage { //实际页码改变的按钮
index = parseInt(i.innerText);
return (index !== 1 && index !== totalPage && index.toString() !== 'NaN');
}),
headFlag = list[2],
endFlag = list[list.length - 3];
//控制插入 '...'
if (currentPage > 4 && headFlag.innerText !== '...') {
li = document.createElement('li');
li.innerText = '...';
list[0].parentElement.insertBefore(li, headFlag);
}
if ((currentPage > 1) && endFlag.innerText !== '...') {
li = document.createElement('li');
li.innerText = '...';
list[0].parentElement.insertBefore(li, list[list.length - 2]); //加入之前的所以是 list.length-2
}
//控制删除 '...'
if (currentPage = totalPage && endFlag.innerText === '...') {
endFlag.parentNode.removeChild(endFlag);
}
//关键的控制 基于他们展示时当前页 和 头尾 在边界位置以及普通位置的情况来做考虑
//在中间的时候 以currentPage为中心 前后2格
if (before > 1 && after ': currentPage = currentPage === totalPage ? totalPage : currentPage + 1; break;
case '...': break;
default: currentPage = parseInt(target.innerText);
}
}
}
function displayData() {
let arr = getRenderList(), p;//最后得到的数据
div.innerHTML = ''; //重置div内容区域
arr.forEach(i => {
var div1 = document.createElement('div');
var img1 = document.createElement('img');
var s0 = document.createElement('div')
var s1 = document.createElement('div');
var s2 = document.createElement('div');
img1.src = i.src;
img1.style.width = '240px';
s1.innerText = i.name;
s2.innerText = i.age;
div1.appendChild(img1);
div1.appendChild(s1);
div1.appendChild(s2);
// div1.appendChild(s0);
div.appendChild(div1);
}); //展示一下
}
//这个是事件的监听函数
function pagination(target) {
let totalPage = getTotalPage(data, pageCount);
//兼容拿到事件
arrowControl(target, totalPage);
btnControl(totalPage, parseInt(currentPage));
isActive();
displayData();
}
//首次注册生成第一页数据和分页栏
function firstInit() {
createBtn(parseInt(getTotalPage(data, pageCount)));
isActive();
displayData();
}
window.onload = function () {
firstInit();
Array.from(document.getElementsByTagName('li')).forEach(i => i.onclick = function (e) {
pagination(e)
});
}
}
paginationByJS(data, div, currentPage, pageCount, list, li)
winkkkkk9421
next13 react项目 setupProxy.js 不起作用?
next13 构建的react项目 setupProxy.js不起作用了?
在src下和根目录下都配置了setupProxy.js都是不起作用
"image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241102/1656399f1cfb468a9e91a73ea7da765a.png)
"image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241102/c107704d2cf0213d5bf850164c1ce16c.png)
"image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241102/4a553cd79cca680f98d8e1ab0a2e1c74.png)
winkkkkk9421
json文件转成二进制一定比原来的数据量小吗?
json文件转成二进制一定比原来的数据量小吗?
如果一定小,为什么不这样做
winkkkkk9421
Java8、Springboot2停止支持后老项目如何处理?
如题,我看了下java8支持到2030年,springboot
2.x支持到2023年11月,由此类推,mysql等组件应该也会在不久的将来停止支持,那到时候要老项目要怎么办?没有官方的支持,普通的IT人员肯定是不能修补漏洞啥的,但是升级软件感觉也不大现实,一来工作量大,二来容易出问题。我想问问通常企业里是如何处理这种问题的?
winkkkkk9421
docker+nginx部署的前端问题?
尝试下在root以/结尾
winkkkkk9421
互联网大厂薪资职级对照表,速来围观!
互联网大厂薪资职级对照表
百度
- 职级变化:2015年前职级含金量高,随市值变化调整,近年因AI发展恢复。
- 薪资结构:具体职级和薪资细节需参考最新图表。
- 图表链接:"百度职级薪资" (https://wmprod.oss-cn-shanghai.aliyuncs.com/community/FjvKFWIOFSeuQ4oN_l05QiEyTbtv.png)
阿里巴巴
- 职级变化:从P3-P12调整为14-28级,反映职级体系动态调整。
- 薪资结构:具体职级和薪资细节需参考最新图表。
- 图表链接:"阿里职级薪资" (https://wmprod.oss-cn-shanghai.aliyuncs.com/community/Fiw3Oge12eUS1iWiCtYQ105DzPWK.png)
腾讯
- 职级变化:近年变化不大,内部裁员影响职级含金量。
- 薪资结构:具体职级和薪资细节需参考最新图表。
- 图表链接:"腾讯职级薪资" (https://wmprod.oss-cn-shanghai.aliyuncs.com/community/FngS32TymbikxcOEimp9qiDIS81Q.png)
字节跳动
- 职级变化:职级含金量显著提升,对标阿里P7和P8。
- 薪资结构:具体职级和薪资细节需参考最新图表。
- 图表链接:"字节跳动职级薪资" (https://wmprod.oss-cn-shanghai.aliyuncs.com/community/FmGcThrxyVrS-xPzMKscMFgSFGfE.png)
美团
- 职级变化:职级含金量上升,L7员工成为核心一线。
- 薪资结构:对标阿里P7。
- 图表链接:"美团职级薪资" (https://wmprod.oss-cn-shanghai.aliyuncs.com/community/FmefjSfBS0u6CJ3F6yz-fWLgye_C.png)
拼多多
- 薪资水平:初级工程师年薪中位数78.2万,领先各大厂。
- 图表链接:"拼多多职级薪资" (https://wmprod.oss-cn-shanghai.aliyuncs.com/community/FqwvX5nDeB3VpS38UraBy32i193V.png)
华为
- 职级体系:13级到22级,分A/B/C三档。
- 薪资结构:基本工资、年终奖、分红(TUP)。
- 图表链接:"华为职级薪资" (https://wmprod.oss-cn-shanghai.aliyuncs.com/community/FnshvqjWx_DYhR39AG2xfsOIi-ta.png)
京东
- 职级体系:M、T、P、O序列,对应不同岗位。
- 薪资结构:月薪、年终奖、股票期权。
- 图表链接:"京东职级薪资" (https://wmprod.oss-cn-shanghai.aliyuncs.com/community/FpHzPb13vyiphSjozwYZ_IPyjv8f.png)
滴滴
- 职级体系:不同职位等级。
- 薪资结构:15薪(部分16或17薪),年终奖、股票期权。
- 图表链接:"滴滴职级薪资" (https://wmprod.oss-cn-shanghai.aliyuncs.com/community/FlxiMCsuXTnfuLr-q73L9uVL3imf.png)
自我评估
- 工具推荐:万码优才个人薪酬功能,上传简历评估薪资水平和对标大厂等级。
winkkkkk9421
elmentui的表格多选在移动端要点击两次才能选择上?
elmentui的表格多选在移动端要双击才能选择上,不知道有没有大佬遇到过这个问题
winkkkkk9421
IDEA编写Java时System下无代码提示,怎么办?
IDEA编写Java代码是,System下无提示,System.out.println爆红,编译没问题。
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241015/d473759b260a161ca42c037e6f4256d0.png)
项目结构中页正确添加了依赖
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241015/08175753d3f3ae11d5a85ee217f5ec8c.png)
Maven配置文件如下
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241015/747eabf8bffa5edb6f87411b76b9edcd.png)
但是没用使用到Meven
winkkkkk9421
Socket重连后,之前的send请求怎么自动再发送一遍?
之前send请求的接口,socket重连后,怎么让之前的send再重新请求一次?
所有的send都存一遍,又没办法保证不需要的不运行。
重新刷新页面又会白屏。
winkkkkk9421
nuxt2框架如何使用vue的事件总线?
$bus 得你手动注入吧