NBlog整合OSS图库

NBlog部署维护流程记录(持续更新):https://blog.csdn.net/qq_43349112/article/details/136129806

由于项目是fork的,所以我本身并不清楚哪里使用了图床,因此下面就是我熟悉项目期间边做边调整的。

目前已经调整的功能点:

  • QQ头像存储
  • 后端管理-图床管理

!更改配置和写代码的时候,注意不要把敏感信息上传到git仓库!

不小心上传了配置文件,又搞了好久。。。

如果已经上传了,可以参考这个博客进行处理:git 删除历史提交中的某个文件,包含所有记录,过滤所有记录_git filter-branch --index-filter "git rm -rf --cac-CSDN博客

image-20240310191935850

1.QQ头像存储

1.1 修改配置

修改配置文件applicaiton-dev.properties

# 评论中QQ头像存储方式: 本地:local GitHub:github 又拍云:upyun 阿里云:aliyun
upload.channel=aliyun# 阿里云OSS
upload.aliyun.endpoint=oss-cn-shanghai.aliyuncs.com
upload.aliyun.bucket-name=chaobk-img-repo
upload.aliyun.path=cblog-qq
upload.aliyun.access-key-id=LTAI5tMbd4PzFjzLkPMssheu
upload.aliyun.secret-access-key=xxxxxxxxxxxxxxxxxxxxxxxxxx

1.2 新增实体类

新加入实体类,用来存放配置的值:

package com.chaobk.config.properties;import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;@Data
@Configuration
@ConfigurationProperties(prefix = "upload.aliyun")
public class AliyunProperties {private String endpoint;private String bucketName;private String path;private String accessKeyId;private String secretAccessKey;
}

1.3 修改bean工厂

修改上传方式bean生成器,即新增的第四个case块:

package com.chaobk.util.upload.channel;import com.chaobk.constant.UploadConstants;
import com.chaobk.util.common.SpringContextUtils;/*** 文件上传方式** @author: Naccl* @date: 2022-01-23*/
public class ChannelFactory {/*** 创建文件上传方式** @param channelName 方式名称* @return 文件上传Channel*/public static FileUploadChannel getChannel(String channelName) {switch (channelName.toLowerCase()) {case UploadConstants.LOCAL:return SpringContextUtils.getBean(LocalChannel.class);case UploadConstants.GITHUB:return SpringContextUtils.getBean(GithubChannel.class);case UploadConstants.UPYUN:return SpringContextUtils.getBean(UpyunChannel.class);case UploadConstants.ALIYUN:return SpringContextUtils.getBean(AliyunChannel.class);}throw new RuntimeException("Unsupported value in [application.properties]: [upload.channel]");}
}

1.4 新增上传类

添加上传的操作类:

package com.chaobk.util.upload.channel;import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.model.PutObjectRequest;
import com.chaobk.config.properties.AliyunProperties;
import com.chaobk.util.upload.UploadUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;import java.io.ByteArrayInputStream;
import java.util.UUID;/*** 阿里云OSS存储上传*/
@Lazy
@Component
public class AliyunChannel implements FileUploadChannel {private AliyunProperties aliyunProperties;private OSS ossClient;public AliyunChannel(AliyunProperties aliyunProperties) {this.aliyunProperties = aliyunProperties;this.ossClient = new OSSClientBuilder().build(aliyunProperties.getEndpoint(), aliyunProperties.getAccessKeyId(), aliyunProperties.getSecretAccessKey());}@Overridepublic String upload(UploadUtils.ImageResource image) throws Exception {String uploadName = aliyunProperties.getPath() + "/" + UUID.randomUUID() + "." + image.getType();PutObjectRequest putObjectRequest = new PutObjectRequest(aliyunProperties.getBucketName(), uploadName, new ByteArrayInputStream(image.getData()));try {ossClient.putObject(putObjectRequest);return String.format("https://%s.%s/%s", aliyunProperties.getBucketName(), aliyunProperties.getEndpoint(), uploadName);} catch (Exception e) {throw new RuntimeException("阿里云OSS上传失败");} finally {putObjectRequest.getInputStream().close();}}
}

后端处理完成,进行测试

1.5 测试

测试前需要先确保redis中没有要测试账号的缓存数据。

首先在博客页面填写评论:

image-20240310184826974

评论成功,路径正确,完成。

image-20240310185253969

2.后端管理-图床管理

纯前端代码。

主要是参考着官方的文档操作:安装和使用OSS Node.js SDK_对象存储(OSS)-阿里云帮助中心 (aliyun.com)

2.1 安装OSS

npm install ali-oss --save

2.2 调整setting.vue

照猫画虎,新增方法、aliyunConfig对象以及各种标签

<template><div><el-alert title="图床配置及用法请查看:https://github.com/Naccl/PictureHosting" type="warning" show-iconv-if="hintShow"></el-alert><el-card><div slot="header"><span>GitHub配置</span></div><el-row><el-col><el-input placeholder="请输入token进行初始化" v-model="githubToken" :clearable="true"@keyup.native.enter="searchGithubUser" style="min-width: 500px"><el-button slot="append" icon="el-icon-search" @click="searchGithubUser">查询</el-button></el-input></el-col></el-row><el-row><el-col><span class="middle">当前用户:</span><el-avatar :size="50" :src="githubUserInfo.avatar_url">User</el-avatar><span class="middle">{{ githubUserInfo.login }}</span></el-col></el-row><el-row><el-col><el-button type="primary" size="medium" icon="el-icon-check" :disabled="!isGithubSave"@click="saveGithub(true)">保存配置</el-button><el-button type="info" size="medium" icon="el-icon-close" @click="saveGithub(false)">清除配置</el-button></el-col></el-row></el-card><el-card><div slot="header"><span>又拍云存储配置</span></div><el-form :model="upyunConfig" label-width="100px"><el-form-item label="操作员名称"><el-input v-model="upyunConfig.username"></el-input></el-form-item><el-form-item label="操作员密码"><el-input v-model="upyunConfig.password"></el-input></el-form-item><el-form-item label="存储空间名"><el-input v-model="upyunConfig.bucketName"></el-input></el-form-item><el-form-item label="CDN访问域名"><el-input v-model="upyunConfig.domain"></el-input></el-form-item><el-button type="primary" size="medium" icon="el-icon-check" :disabled="!isUpyunSave" @click="saveUpyun(true)">保存配置</el-button><el-button type="info" size="medium" icon="el-icon-close" @click="saveUpyun(false)">清除配置</el-button></el-form></el-card><el-card><div slot="header"><span>腾讯云存储配置</span></div><el-form :model="txyunConfig" label-width="100px"><el-form-item label="secret-id"><el-input v-model="txyunConfig.secretId"></el-input></el-form-item><el-form-item label="secret-key"><el-input v-model="txyunConfig.secretKey"></el-input></el-form-item><el-form-item label="存储空间名"><el-input v-model="txyunConfig.bucketName"></el-input></el-form-item><el-form-item label="地域"><el-input v-model="txyunConfig.region"></el-input></el-form-item><el-form-item label="CDN访问域名"><el-input v-model="txyunConfig.domain"></el-input></el-form-item><el-button type="primary" size="medium" icon="el-icon-check" :disabled="!isTxyunSave" @click="saveTxyun(true)">保存配置</el-button><el-button type="info" size="medium" icon="el-icon-close" @click="saveTxyun(false)">清除配置</el-button></el-form></el-card><el-card><div slot="header"><span>阿里云存储配置</span></div><el-form :model="aliyunConfig" label-width="100px"><el-form-item label="endpoint"><el-input v-model="aliyunConfig.endpoint"></el-input></el-form-item><el-form-item label="bucket-name"><el-input v-model="aliyunConfig.bucketName"></el-input></el-form-item><el-form-item label="access-key-id"><el-input v-model="aliyunConfig.accessKeyId"></el-input></el-form-item><el-form-item label="secret-access-key"><el-input v-model="aliyunConfig.secretAccessKey"></el-input></el-form-item><el-button type="primary" size="medium" icon="el-icon-check" :disabled="!isAliyunSave"@click="saveAliyun(true)">保存配置</el-button><el-button type="info" size="medium" icon="el-icon-close" @click="saveUpyun(false)">清除配置</el-button></el-form></el-card></div>
</template><script>
import {getUserInfo} from "@/api/github";export default {name: "Setting",data() {return {githubToken: '',githubUserInfo: {login: '未配置'},isGithubSave: false,hintShow: false,upyunConfig: {username: '',password: '',bucketName: '',domain: ''},txyunConfig: {secretId: '',secretKey: '',bucketName: '',region: '',domain: ''},aliyunConfig: {endpoint: '',bucketName: '',accessKeyId: '',secretAccessKey: ''}}},computed: {isUpyunSave() {return this.upyunConfig.username && this.upyunConfig.password && this.upyunConfig.bucketName && this.upyunConfig.domain},isTxyunSave() {return this.txyunConfig.secretId && this.txyunConfig.secretKey && this.txyunConfig.bucketName && this.txyunConfig.region && this.txyunConfig.domain},isAliyunSave() {return this.aliyunConfig.endpoint && this.aliyunConfig.bucketName && this.aliyunConfig.accessKeyId && this.aliyunConfig.secretAccessKey}},created() {this.githubToken = localStorage.getItem("githubToken")const githubUserInfo = localStorage.getItem('githubUserInfo')if (this.githubToken && githubUserInfo) {this.githubUserInfo = JSON.parse(githubUserInfo)this.isGithubSave = true} else {this.githubUserInfo = {login: '未配置'}}const upyunConfig = localStorage.getItem('upyunConfig')if (upyunConfig) {this.upyunConfig = JSON.parse(upyunConfig)}const txyunConfig = localStorage.getItem('txyunConfig')if (txyunConfig) {this.txyunConfig = JSON.parse(txyunConfig)}const aliyunConfig = localStorage.getItem('aliyunConfig')if (aliyunConfig) {this.aliyunConfig = JSON.parse(aliyunConfig)}const userJson = window.localStorage.getItem('user') || '{}'const user = JSON.parse(userJson)if (userJson !== '{}' && user.role !== 'ROLE_admin') {//对于访客模式,增加个提示this.hintShow = true}},methods: {// 获取用户信息searchGithubUser() {getUserInfo(this.githubToken).then(res => {this.githubUserInfo = resthis.isGithubSave = true})},saveGithub(save) {if (save) {localStorage.setItem('githubToken', this.githubToken)localStorage.setItem('githubUserInfo', JSON.stringify(this.githubUserInfo))this.msgSuccess('保存成功')} else {localStorage.removeItem('githubToken')localStorage.removeItem('githubUserInfo')this.msgSuccess('清除成功')}},saveUpyun(save) {if (save) {localStorage.setItem('upyunToken', btoa(`${this.upyunConfig.username}:${this.upyunConfig.password}`))localStorage.setItem('upyunConfig', JSON.stringify(this.upyunConfig))this.msgSuccess('保存成功')} else {localStorage.removeItem('upyunConfig')this.msgSuccess('清除成功')}},saveTxyun(save) {if (save) {localStorage.setItem('txyunConfig', JSON.stringify(this.txyunConfig))this.msgSuccess('保存成功')} else {localStorage.removeItem('txyunConfig')this.msgSuccess('清除成功')}},saveAliyun(save) {if (save) {localStorage.setItem('aliyunConfig', JSON.stringify(this.aliyunConfig))this.msgSuccess('保存成功')} else {localStorage.removeItem('aliyunConfig')this.msgSuccess('清楚成功')}}},
}
</script>

2.3 index.js新增路由

index.js新增路由

{path: 'aliyun',name: 'AliyunManage',component: () => import('@/views/pictureHosting/AliyunManage.vue'),meta: {title: '阿里云', icon: 'el-icon-folder-opened'}
},

image-20240310185937324

2.4 新增AliyunManage.vue

UpyunManage.vue的拿过来复制修改下即可,整体的页面框架差不多,重写里面的增删查方法:

<template><div><el-row><el-select v-model="aliyunConfig.bucketName" disabled style="min-width: 200px"></el-select><el-cascader v-model="activePath" placeholder="请选择目录" :options="pathArr" :props="pathProps" style="min-width: 450px"></el-cascader><el-button type="primary" size="medium" icon="el-icon-search" @click="search">查询</el-button><el-button class="right-item" type="primary" size="medium" icon="el-icon-upload" @click="isDrawerShow=!isDrawerShow">上传</el-button></el-row><el-alert title="只显示<img>标签支持的 apng,avif,bmp,gif,ico,cur,jpg,jpeg,jfif,pjpeg,pjp,png,svg,tif,tiff,webp 格式的图片,见 https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/img" type="warning" show-icon close-text="不再提示" v-if="hintShow1" @close="noDisplay(1)"></el-alert><el-alert title="最多显示100个文件" type="warning" show-icon close-text="不再提示" v-if="hintShow2" @close="noDisplay(2)"></el-alert><el-row v-viewer><div class="image-container" v-for="(file,index) in fileList" :key="index"><el-image :src="file.url" fit="scale-down"></el-image><div class="image-content"><div class="info"><span>{{ file.name }}</span></div><div class="icons"><el-tooltip class="item" effect="dark" content="复制图片url" placement="bottom"><i class="icon el-icon-link" @click="copy(1,file)"></i></el-tooltip><el-tooltip class="item" effect="dark" content="复制MD格式" placement="bottom"><SvgIcon icon-class="markdown" class-name="icon" @click="copy(2,file)"></SvgIcon></el-tooltip><i class="icon el-icon-delete" @click="delFile(file)"></i></div></div></div></el-row><el-drawer title="上传文件" :visible.sync="isDrawerShow" direction="rtl" size="40%" :wrapperClosable="false" :close-on-press-escape="false"><el-row><el-radio v-model="nameType" label="1">使用源文件名</el-radio><el-radio v-model="nameType" label="2">使用UUID文件名</el-radio><el-button size="small" type="primary" icon="el-icon-upload" v-throttle="[submitUpload,`click`,3000]">确定上传</el-button></el-row><el-row>当前目录:{{ realPath }}</el-row><el-row><el-switch v-model="isCustomPath" active-text="自定义目录"></el-switch><el-input placeholder="例:oldFolder/newFolder/" v-model="customPath" :disabled="!isCustomPath" size="medium" style="margin-top: 10px"></el-input></el-row><el-upload ref="uploadRef" action="" :http-request="upload" drag multiple :file-list="uploadList" list-type="picture" :auto-upload="false"><i class="el-icon-upload"></i><div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div></el-upload></el-drawer></div>
</template><script>
import SvgIcon from "@/components/SvgIcon";
import {isImgExt} from "@/util/validate";
import {randomUUID} from "@/util/uuid";
import {copy} from "@/util/copy";
import OSS from 'ali-oss';export default {name: "AliyunManage",components: {SvgIcon},data() {return {ossClient: {},aliyunConfig: {endpoint: '',bucketName: '',path: '',accessKeyId: '',secretAccessKey: ''},pathArr: [{value: '', label: '根目录'}],activePath: [''],//默认选中根目录pathProps: {lazy: true,checkStrictly: true,lazyLoad: async (node, resolve) => {let path = node.path.join('/')let nodes = []await this.getReposContents(nodes, path)resolve(nodes)}},hintShow1: true,hintShow2: true,fileList: [],isDrawerShow: false,nameType: '1',uploadList: [],isCustomPath: false,customPath: '',}},computed: {realPath() {if (this.isCustomPath) {return `/${this.customPath}`}return `${this.activePath.join('/')}/`}},created() {this.hintShow1 = localStorage.getItem('aliyunHintShow1') ? false : truethis.hintShow2 = localStorage.getItem('aliyunHintShow2') ? false : trueconst aliyunConfig = localStorage.getItem('aliyunConfig')if (aliyunConfig) {this.aliyunConfig = JSON.parse(aliyunConfig)// 初始化OSS客户端。请将以下参数替换为您自己的配置信息。this.ossClient = new OSS({region: this.aliyunConfig.endpoint.substring(0, this.aliyunConfig.endpoint.indexOf('.')), // 示例:'oss-cn-hangzhou',填写Bucket所在地域。accessKeyId: this.aliyunConfig.accessKeyId, // 确保已设置环境变量OSS_ACCESS_KEY_ID。accessKeySecret: this.aliyunConfig.secretAccessKey, // 确保已设置环境变量OSS_ACCESS_KEY_SECRET。bucket: this.aliyunConfig.bucketName, // 示例:'my-bucket-name',填写存储空间名称。});} else {this.msgError('请先配置阿里云')this.$router.push('/pictureHosting/setting')}},methods: {//换成懒加载async getReposContents(arr, path) {await this.ossClient.list({prefix: path,delimiter: (path ? '' : '/')}).then(res => {if (res && res.prefixes) {res.prefixes.forEach(item => {item = item.substring(0, item.indexOf("/"))arr.push({value: item, label: item, leaf: false})})}})},async search() {this.fileList = []let path = this.activePath.join('/') + '/'path = path.startsWith('/') ? path.substring(1) : paththis.ossClient.list({prefix: path,delimiter: '/'}).then(res => {if (res && res.objects) {res.objects.forEach(item => {if (isImgExt(item.name)) {item.path = ''this.fileList.push(item)}})}})},noDisplay(id) {localStorage.setItem(`aliyunHintShow${id}`, '1')},copy(type, file) {// type 1 cdn link  2 Markdownlet copyCont = ''copyCont = file.urlcopy(copyCont)this.msgSuccess('复制成功')},delFile(file) {this.$confirm("此操作将永久删除该文件, 是否删除?", "提示", {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning',}).then(() => {this.ossClient.delete(file.name).then(() => {this.msgSuccess('删除成功')this.search()})}).catch(() => {this.$message({type: 'info',message: '已取消删除',})})},submitUpload() {//https://github.com/ElemeFE/element/issues/12080this.uploadList = this.$refs.uploadRef.uploadFilesif (this.uploadList.length) {//触发 el-upload 中 http-request 绑定的函数this.$refs.uploadRef.submit()} else {this.msgError('请先选择文件')}},upload(data) {let fileName = data.file.nameif (this.nameType === '2') {fileName = randomUUID() + fileName.substr(fileName.lastIndexOf("."))}// upload(this.aliyunConfig.bucketName, this.realPath, fileName, data.file).then(() => {//   this.msgSuccess('上传成功')//   data.onSuccess()// })if (!this.realPath.endsWith('/')) {this.realPath += '/'}this.ossClient.put(this.realPath + fileName, data.file, {'x-oss-storage-class': 'Standard',// 指定Object的访问权限。'x-oss-object-acl': 'private',// 指定PutObject操作时是否覆盖同名目标Object。此处设置为true,表示禁止覆盖同名Object。'x-oss-forbid-overwrite': 'true',}).then(() => {this.msgSuccess('上传成功')data.onSuccess()})},},
}
</script>

2.5 测试

部署后查询,成功:

image-20240310190254090

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

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

相关文章

CVE-2019-5782:kArgumentsLengthType 设置偏小导致优化阶段可以错误的去除 CheckBound 节点

文章目录 环境搭建漏洞分析笔者初分析笔者再分析漏洞触发源码分析 漏洞利用总结 环境搭建 sudo apt install pythongit reset --hard b474b3102bd4a95eafcdb68e0e44656046132bc9 export DEPOT_TOOLS_UPDATE0 gclient sync -D// debug version tools/dev/v8gen.py x64.debug ni…

FreeRTOS操作系统学习——软件定时器

软件定时器介绍 软件定时器允许设置一段时间&#xff0c;当设置的时间到达之后就执行指定的功能函数&#xff0c;被定时器调用的这个功能函数叫做定时器的回调函数。回调函数的两次执行间隔叫做定时器的定时周期&#xff0c;简而言之&#xff0c;当定时器的定时周期到了以后就…

C语言--字符串面试题

字符串是由若干字符组成的序列。由于字符串在编程时使用的频率非常高,为了优化,很多语言都对字符串做了特殊的规定。下面分别讨论C/C字符串的特性。 C/C中每个字符串都以字符"0作为结尾,这样我们就能很方便地找到字符串的最后尾部。但由于这个特点&#xff0c;每个字符串中…

Android 15 首个开发者预览版到来

作者 / 工程副总裁 Dave Burke Android 15 的首个开发者预览版现已发布&#xff0c;以便各位开发者能与我们通力协作&#xff0c;打造更优秀的 Android 平台。 在 Android 15 中&#xff0c;我们继续致力于打造一个既能提升工作效率&#xff0c;又能提供全新功能的平台。这些新…

【Java - 框架 - Mybatis】(02) SpringBoot整合Mybatis操作Mysql - 快速上手

“SpringBoot"整合"Mybatis"操作"Mysql” - 快速上手&#xff1b; 环境 Java版本"1.8.0_202"&#xff1b;Spring Boot版本"2.5.9"&#xff1b;Windows 11 专业版_22621.2428&#xff1b;IntelliJ IDEA 2021.1.3(Ultimate Edition)&a…

2.案例、鼠标时间类型、事件对象参数

案例 注册事件 <!-- //disabled默认情况用户不能点击 --><input type"button" value"我已阅读用户协议(5)" disabled><script>// 分析&#xff1a;// 1.修改标签中的文字内容// 2.定时器// 3.修改标签的disabled属性// 4.清除定时器// …

Day15 面向对象进阶——接Day14

Day15 面向对象进阶——接Day14 文章目录 Day15 面向对象进阶——接Day14一、访问修饰符二、Object三、深入String的equals()方法四、final 一、访问修饰符 1、含义&#xff1a;修饰类、方法、属性&#xff0c;定义使用的范围 2、经验&#xff1a; 2.1.属性一般使用private修…

武汉星起航:秉承客户至上服务理念,为创业者打造坚实后盾

在跨境电商的激荡浪潮中&#xff0c;武汉星起航电子商务有限公司一直秉持着以客户为中心的发展理念&#xff0c;为跨境创业者提供了独特的支持和经验积累&#xff0c;公司通过多年的探索和实践&#xff0c;成功塑造了一个以卖家需求为导向的服务平台&#xff0c;为每一位创业者…

window python开发环境搭建- Anaconda

window python开发环境搭建- Anaconda 下载Anacnoda配置Anconda验证Anaconda是否安装成功验证 conda 是否安装成功验证 pip 是否安装成功验证 python 是否安装成功 配置镜像源conda 镜像源pip 镜像源 pip 常用命令conda 常用命令 下载Anacnoda anacoda官网地址 https://www.an…

【vue在主页中点击主页面如何弹出一个指定某个页面的窗口】

【vue在主页中点击主页面跳转到某个页面的操作完整过程】 1.首先在主页面中加入一个卡槽用于展示弹出的窗口 代码如下&#xff1a; <el-dialog :visible.sync"dialogVisible1" :close-on-click-modal"false" :title"title" class"dial…

代码随想录算法训练营第八天|344. 反转字符串

344. 反转字符串 已解答 简单 相关标签 相关企业 提示 编写一个函数&#xff0c;其作用是将输入的字符串反转过来。输入字符串以字符数组 s 的形式给出。 不要给另外的数组分配额外的空间&#xff0c;你必须原地修改输入数组、使用 O(1) 的额外空间解决这一问题。 示例 1&#…

[LeetCode][LCR 194]二叉树的最近公共祖先

题目 LCR 194. 二叉树的最近公共祖先 给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。 例如&#xff0c;给定如下二叉树: root [3,5,1,6,2,0,8,null,null,7,4] 示例 1: 输入: root [3,5,1,6,2,0,8,null,null,7,4], p 5, q 1 输出: 3 解释: 节点 5 和节点 1 的最…

#微信小程序(轮播图以及开发方法)

1.IDE&#xff1a;微信开发者工具 2.实验&#xff1a;轮播图以及正确的开发方法 &#xff08;1&#xff09;有HTML&#xff0c;CSS&#xff0c;javascript基础即可 &#xff08;2&#xff09;写界面一定要查看开发手册&#xff0c;这是微信小程序比较好的地方&#xff0c;由于…

QT----基于QT的人脸考勤系统(未完成)

目录 1 编译opencv库1.1 下载源代码1.2 qt编译opencv1.3 执行Cmake一直卡着data: Download: face_landmark_model.dat 2 编译SeetaFace2代码2.1 遇到报错By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has2.2遇到报错Model missing 3 测试…

机试:成绩排名

问题描述: 代码示例: #include <bits/stdc.h> using namespace std;int main(){cout << "样例输入" << endl; int n;int m;cin >> n;int nums[n];for(int i 0; i < n; i){cin >> nums[i];}// 排序for(int i 0; i < n; i){//…

IP地址无所遁形!试试这个3k星热门开源查询神器!

在日常开发中&#xff0c;我们经常需要查询IP地址的位置信息&#xff0c;比如&#xff1a; 网站统计&#xff1a;统计用户的来源地&#xff0c;了解访问者分布情况&#xff1b;安全防护&#xff1a;根据IP地址判断用户是否来自风险地区&#xff0c;加强安全防护措施&#xff1…

13.7 Map 接口(血干JAVA系列)

这里写目录标题 13.7.1 Map接口简介13.7.2 Map.Entry接口简介13.7.3 Map接口的常用子类1.新的子类&#xff1a;HashMap2.相关操作实例(1)实例操作1——向集合中增加和取出内容【例13.26】增加和取得内容 (2)实例操作2------------ 判断指定的key或value是否存在【例13.27】判断…

VMware16如何克隆虚拟机

目录 克隆虚拟机方式一(在Windows上复制粘贴)克隆虚拟机方式二(使用VM的克隆操作 克隆之前需要关机)修改克隆机的IP和主机名虚拟机快照虚拟机的迁移和删除 克隆虚拟机方式一(在Windows上复制粘贴) 直接拷贝一份你已经安装好的虚拟机 复制到目的主机上 然后用VM就能打开它 甚至…

全视智慧机构养老解决方案,以科技守护长者安全

2024年2月28日凌晨1时许&#xff0c;在上海浦东大道的一家养护院四楼杂物间内发生了一起火灾事故。尽管火势不大&#xff0c;过火面积仅为2平方米&#xff0c;但这场小火却造成了1人死亡和3人受伤的悲剧。这一事件再次提醒我们&#xff0c;养老院作为老年人聚集的场所&#xff…

人人站CMS后台登不进去解决方案(已解决)

公司有一个网站使用的是人人站CMS&#xff0c;最近发现后台登录不进去&#xff0c;有以下报错 发生以下错误: file get contents(http://www.rrzcms.com/Public/cms/config/config.ison): failed to open stream: HTTP reguest failed! 请求的URL导致内部服务器错误。 如果您反…