<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
>
<channel>
<title><![CDATA[柚子云博客]]></title> 
<atom:link href="https://511cloud.cn/rss.php" rel="self" type="application/rss+xml" />
<description><![CDATA[柚子云/poetize/yooz]]></description>
<link>https://511cloud.cn/</link>
<language>zh-cn</language>

<item>
    <title>nvm进行node版本管理</title>
    <link>https://511cloud.cn/?post=4</link>
    <description><![CDATA[<p>*<em>查看已经安装的node版本(带</em>号的是当前使用版本)**</p>
<pre><code>nvm list</code></pre>
<p><strong>安装最新的长期支持版 (LTS):</strong></p>
<pre><code>nvm install lts</code></pre>
<p><strong>安装指定版本 (例如 18.20.2):</strong></p>
<pre><code>nvm install 18.20.2</code></pre>
<p><strong>切换到已安装的版本:</strong></p>
<pre><code>nvm use 18.20.2</code></pre>
<p><strong>删除不需要的版本 </strong></p>
<pre><code>nvm uninstall 16.20.2</code></pre>
<p><strong>设置默认版本</strong></p>
<pre><code>nvm alias default 18.20.2</code></pre>
<p><strong>如果安装失败，就刷新nvm缓存再进行安装</strong></p>
<pre><code>nvm list available</code></pre>]]></description>
    <pubDate>Fri, 10 Jul 2026 15:02:24 +0800</pubDate>
    <dc:creator>poetize</dc:creator>
    <guid>https://511cloud.cn/?post=4</guid>
</item>
<item>
    <title>windows中安装虚拟机跑AI大模型</title>
    <link>https://511cloud.cn/?post=3</link>
    <description><![CDATA[<p>安装官方原生虚拟平台</p>
<pre><code>wsl --install</code></pre>
<p>安装完成后重启电脑，设置虚拟机账号密码</p>
<pre><code>账号：xxxx
密码：xxxx</code></pre>
<h3><strong>更新系统并配置国内镜像源</strong></h3>
<pre><code class="language-bash"># 替换 Ubuntu 官方源为阿里云源
sudo sed -i 's/http:\/\/archive.ubuntu.com/https:\/\/mirrors.aliyun.com/g' /etc/apt/sources.list
sudo sed -i 's/http:\/\/security.ubuntu.com/https:\/\/mirrors.aliyun.com/g' /etc/apt/sources.list

# 更新系统软件列表
sudo apt update &amp;&amp; sudo apt upgrade -y</code></pre>
<h3><strong>第二步：安装基础开发工具与 Python 环境</strong></h3>
<pre><code class="language-bash"># 安装 pip、python3-venv 等基础工具
sudo apt install -y python3-pip python3-venv build-essential git</code></pre>
<h3><strong>第三步：创建并激活 Python 虚拟环境</strong></h3>
<pre><code class="language-bash"># 在用户目录下创建一个名为 vllm-env 的虚拟环境
python3 -m venv ~/vllm-env

# 激活虚拟环境（激活后，命令行前面会出现 (vllm-env) 提示）
source ~/vllm-env/bin/activate

# 升级 pip 到最新版本
pip install --upgrade pip</code></pre>
<h3><strong>第四步：配置 pip 国内镜像并安装 vLLM</strong></h3>
<pre><code class="language-bash"># 配置 pip 使用阿里云镜像
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

# 安装 vLLM（推荐使用 uv 安装，速度更快，如果没有 uv 也可以直接用 pip install vllm）
pip install uv
uv pip install vllm</code></pre>
<h3><strong>第五步：下载大模型文件</strong></h3>
<pre><code class="language-bash"># 安装魔搭社区命令行工具
pip install modelscope

# 创建存放模型的目录（建议放在 /mnt/d/ 等 Windows 盘符下，方便管理且不易撑爆 C 盘）
mkdir -p /mnt/d/LLM_Models

# 下载 Qwen2.5-7B-Instruct 模型到 D 盘
modelscope download --model qwen/Qwen2.5-7B-Instruct --local_dir /mnt/d/LLM_Models/Qwen2.5-7B

modelscope download --model Qwen/Qwen3.6-35B-A3B-FP8 --local_dir /ai-models/qwen3-35b-fp8</code></pre>
<h3><strong>第六步：启动 vLLM 推理服务</strong></h3>
<pre><code>python -m vllm.entrypoints.openai.api_server \
    --model /mnt/d/LLM_Models/Qwen2.5-7B \
    --served-model-name qwen2.5-7b \
    --host 0.0.0.0 \
    --port 8000 \
    --gpu-memory-utilization 0.85 \
    --dtype float16 \
    --max-model-len 8192</code></pre>
<h3><strong>第七步：验证服务是否成功</strong></h3>
<pre><code>curl http://localhost:8000/v1/chat/completions \
    -H "Content-Type: application/json" \
    -d '{
        "model": "qwen2.5-7b",
        "messages": [
            {"role": "user", "content": "你好，请简单介绍一下你自己"}
        ]
    }'</code></pre>
<p>当终端打印出 <code>Uvicorn running on http://0.0.0.0:8000</code> 时，说明服务已经启动</p>]]></description>
    <pubDate>Fri, 10 Jul 2026 15:00:29 +0800</pubDate>
    <dc:creator>poetize</dc:creator>
    <guid>https://511cloud.cn/?post=3</guid>
</item>
<item>
    <title>记录一下如何使用若依框架之（将若依分离版合并打包到jar包中）</title>
    <link>https://511cloud.cn/?post=2</link>
    <description><![CDATA[<p>以下是为您重新整理的若依（RuoYi）前后端分离版改造为单体部署版的操作指南：</p>
<h1>若依前后端分离版改造为单体部署指南</h1>
<h2>前言</h2>
<p>本项目基于若依前后端分离版开发，现需将其改造为不分离版本，即将前端打包产物整合进后端 JAR 包中统一运行。以下是详细的改造步骤。</p>
<hr />
<h2>一、 修改前端项目配置</h2>
<h3>1. 修改生产环境配置</h3>
<p>编辑 <code>ruoyi-ui/.env.production</code> 文件，配置 API 基础路径（二选一）：</p>
<pre><code class="language-properties"># 方式一：本机地址访问（推荐）
VUE_APP_BASE_API = '/'

# 方式二：指定任意地址访问
# VUE_APP_BASE_API = 'http://xxx.xxx.xxx.xxx:8080'</code></pre>
<h3>2. 修改路由模式</h3>
<p>编辑 <code>ruoyi-ui/src/router/index.js</code>，将路由模式设置为 <code>hash</code>：</p>
<pre><code class="language-javascript">export default new Router({
  mode: 'hash', // 必须改为 hash 模式
  scrollBehavior: () =&gt; ({ y: 0 }),
  routes: constantRoutes
})</code></pre>
<h3>3. 修改注销跳转逻辑</h3>
<p>编辑 <code>ruoyi-ui/src/layout/components/Navbar.vue</code> 中的 <code>logout</code> 方法，防止重定向错误：</p>
<pre><code class="language-javascript">async logout() {
  this.$confirm('确定注销并退出系统吗？', '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning'
  }).then(() =&gt; {
    this.$store.dispatch('LogOut').then(() =&gt; {
      // 注意：跳转 index 前加 /#/ 防止定向错误
      location.href = '/#/index';
    })
  }).catch(() =&gt; {});
}</code></pre>
<h3>4. 执行前端打包</h3>
<p>在前端项目根目录运行以下命令生成 dist 文件：</p>
<pre><code class="language-bash">npm run build:prod</code></pre>
<hr />
<h2>二、 修改后端项目配置</h2>
<h3>1. 添加 Thymeleaf 模板引擎配置</h3>
<p>编辑 <code>ruoyi-admin/src/main/resources/application.yml</code>：</p>
<pre><code class="language-yaml">spring:
  # 模板引擎配置
  thymeleaf:
    mode: HTML
    encoding: utf-8
    cache: false</code></pre>
<h3>2. 添加 Thymeleaf 依赖</h3>
<p>编辑 <code>ruoyi-admin/pom.xml</code>，引入模板引擎依赖：</p>
<pre><code class="language-xml">&lt;!-- spring-boot-thymeleaf --&gt;
&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
&lt;/dependency&gt;</code></pre>
<h3>3. 配置静态资源映射</h3>
<p>编辑 <code>ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java</code>，在 <code>addResourceHandlers</code> 方法中添加：</p>
<pre><code class="language-java">/** 前端静态资源配置 */
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");</code></pre>
<h3>4. 放行静态资源访问权限</h3>
<p>编辑 <code>ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java</code>，在 <code>configure</code> 方法中添加匿名访问规则：</p>
<pre><code class="language-java">// 静态资源可匿名访问，主要添加 "/static/**", "/index", "/*.ico"
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**", "/static/**", "/index", "/*.ico").permitAll()</code></pre>
<h3>5. 设置首页访问控制器</h3>
<p>编辑 <code>SysIndexController.java</code>，配置根路径返回页面：</p>
<pre><code class="language-java">@RequestMapping("/")
public ModelAndView index() {
    return new ModelAndView("index.html");
}</code></pre>
<h3>6. 整合前端静态资源</h3>
<p>将前端打包生成的 <code>dist</code> 目录内容复制到后端项目中：</p>
<ul>
<li><strong>HTML 文件</strong>：放入 <code>ruoyi-admin/src/main/resources/templates/</code> 目录</li>
<li><strong>JS/CSS/图片等静态文件</strong>：放入 <code>ruoyi-admin/src/main/resources/static/</code> 目录</li>
</ul>
<blockquote>
<p><strong>注意</strong>：如果 <code>templates</code> 或 <code>static</code> 目录不存在，请手动新建。</p>
</blockquote>
<hr />
<h2>三、 启动验证</h2>
<p>启动后端服务，访问测试地址（例如：<code>http://192.168.164.134:8080/</code>）。</p>
<p>✅ <strong>成功标志</strong>：页面正常显示首页并加载出验证码，即表示改造完成。</p>]]></description>
    <pubDate>Fri, 10 Jul 2026 13:23:43 +0800</pubDate>
    <dc:creator>poetize</dc:creator>
    <guid>https://511cloud.cn/?post=2</guid>
</item>
</channel>
</rss>