windows安装openclaw龙虾以及使用

需要安装 git python 3.12 否则闪退哦
首先进行NVM安装
https://github.com/coreybutler/nvm-windows/releases

nvm下载加速:https://bgithub.xyz/coreybutler/nvm-windows/releases

安装(此处安装版本更具最新的版本来可能是22.22.2 下面使用的版本必须相同)

nvm install 22 

# 使用指令

nvm use 22.22.1

Powershell,右击管理员方式打开 执行

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

选择Y

设置国内node源

npm config set registry https://registry.npmmirror.com

在执行安装命令

iwr -useb https://openclaw.ai/install.ps1 | iex

安装好就进入设置,如果关闭必须重新设置,下面是设置的代码。

openclaw onboard --flow quickstart

地址::http://127.0.0.1:18789/

安装插件

openclaw plugins install @m1heng-clawd/feishu

可能失败但是对策

应对闪退,没有信息跳出请使用:

iwr -useb https://openclaw.ai/install.ps1 -OutFile "$env:Desktop\install.ps1"

#然后执行

& "$env:Desktop\install.ps1"

#查看具体闪退信息

配置:切换大模型【Qwen家目前不要钱】

openclaw config

安装SKILL 【ZIP安装 记得安装pip包】

安装Clawhub.ai 首先

npm i -g clawhub

在Clawhub上找到需要的SKILL然后执行下载

clawhub install 名称

比如下面的WPS的skill https://clawhub.ai/lilei0311/wps-office 名称就是最后的wps-office

clawhub install wps-office

该命令用于清楚缓存

clawhub clear cache

使用ZIP安装 下载zip 解压保存在skill文件夹

在你的SKILL中有个workspace里面有 有些需要安装其他有的服务pip可能不显示

重启网关

openclaw gateway restart

python下pip使用阿里云的节点

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

使用openclaw方法

使用akshare-stock 分析601138近期股价及财务数据 ,并更具你分析的信息推测未来一周内的股价,及其概率
# 必须在对话里面明确调用的SKILL名称才能使用

通讯飞书

插件plugins 安装方法如下
openclaw plugins install @m1heng-clawd/feishu
目前已经集成飞书

使用openclaw config 重新配置即可

选择channels

open.feishu.cn 登入 创建应用》添加应用能力【机器人】

在权限中”批量导入权限“导入下面的JSON

{
  "scopes": {
    "tenant": [
      "aily:file:read",
      "aily:file:write",
      "application:application.app_message_stats.overview:readonly",
      "application:application:self_manage",
      "application:bot.menu:write",
      "cardkit:card:write",
      "contact:user.employee_id:readonly",
      "corehr:file:download",
      "docs:document.content:read",
      "event:ip_list",
      "im:chat",
      "im:chat.access_event.bot_p2p_chat:read",
      "im:chat.members:bot_access",
      "im:message",
      "im:message.group_at_msg:readonly",
      "im:message.group_msg",
      "im:message.p2p_msg:readonly",
      "im:message:readonly",
      "im:message:send_as_bot",
      "im:resource",
      "sheets:spreadsheet",
      "wiki:wiki:readonly"
    ],
    "user": [
      "aily:file:read",
      "aily:file:write",
      "im:chat.access_event.bot_p2p_chat:read"
    ]
  }
}

上面的图片中 顶部的 ”创建版本“ 发布即可

然后需要在openclaw中设置id和key

在openclaw里面配置后,飞书事件配置

选择

已添加事件消息与群组
已添加事件身份验证
已添加事件 – 通讯录

全选

需要重启网关

openclaw config set channels.feishu.dmPolicy open

openclaw gateway restart

openclaw restart
重启全部服务

发表在 None | 留下评论

PKG安装

homebrew node.js python

需要修改node.js的权限

# 将 /usr/local/lib/node_modules 的所有者改为当前用户 (may)
sudo chown -R $(whoami) /usr/local/lib/node_modules

# 同时也修复一下 bin 目录的权限,防止将来命令执行报错
sudo chown -R $(whoami) /usr/local/bin

#设置国内源
npm config set registry https://registry.npmmirror.com
发表在 None | 留下评论

安装openclaw

node.js可以pkg安装 需要还源

https://nodejs.org/zh-cn/download


npm config set registry https://registry.npmmirror.com

直接打开官网openclaw.ai 里面有个一键安装命令,帮你搞定brew node python openclaw

mac /linux

curl -sSL https://openclaw.ai/install.sh | bash

windows(powershell)

& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -Tag beta

然后就是等就好了

MAC特殊福利app【已经编译完成】但是还是需要安装CLI版本

https://github.com/openclaw/openclaw/releases/tag/v2026.3.7

发表在 None | 留下评论

ThinkCMF 产品开发小结 路由route 模板 nginx ssl 数据库

1 路由重点,默认是混合模式 pathinfo开启 需要使用$this->request->param(“传参”)

2.data目录下config中route.php 是最核心路由 可以存放return配置,应用路由即在当天目录下创建app.php

3.当前网址 {$Request.scheme}://{$Request.host}/

data/config/route.php 【一般产品前端采用强制模式(前端模板必须使用url函数产生链接)】

<?php
use think\facade\Route;

return [
    // 关闭自动路由(核心:禁止通过 模块/控制器/方法 直接访问)
    'auto_route'          => false,
    // 关闭控制器后缀(可选,根据你的代码规范调整)
    'controller_suffix'   => false,
    // 关闭URL路由匹配的大小写转换(可选,增强严格性)
    'url_convert'         => false,
    // 关闭默认的路由延迟解析(确保路由规则优先生效)
    'delay_route'         => false,
];

data/config/app.php 可以存放前端模板中的路由【可以防止出问题】

<?php
use think\facade\Route;


Route::get('/func/set', 'demo/user/get_show');
Route::get('/func/gp', 'demo/user/list');

#配置
Route::get('/func/save', 'myapp/user/show_done');
Route::get('/func/del', 'myapp/user/del');
Route::get('/func/add', 'myapp/user/add_gupiao');

Route::get('/login', 'user/login/index');
Route::get('/register', 'user/register/index');
Route::get('/password', 'user/login/findPassword');
Route::get('/logout', 'user/index/logout');



Route::get('/repassword', 'user/profile/password');
Route::get('/edit', 'user/profile/edit');
Route::get('/avatar', 'user/profile/avatar');




Route::get('/rss', 'myapp/gu/index');
Route::get('/weather', 'myapp/gu/weather');

#上面路由模式
#下面路由 指定主页 创建短链

Route::rule('/', 'demo/index/index', 'GET')->name('home');
Route::rule('s/:short', 'myapp/gu/short', 'GET')->pattern(['short' => '\w+']);

后台路由没有关系 ,后台用于编辑,可以使用后台加密,双密码,相对好一点,或者直接不用后台,使用另一个网址应用连接数据库实现隔离。

模板

 <include file=”public@head” /> 在模板里面可以引入多个HTML上面的是在应用目录的public/head.html文件,比如你的应用是demo(default/demo/下面),那么这个就是在 default/public/head.html 非应用下的public(不是 default/demo/public)

Nginx SSL

使用lnmp ssl add添加SSL 用自动签注的SSL需要修改nginx的conf

原来的Nginx添加(其中root /home/wwwroot/xxx.com; 不是thinkphp的public 切记)

location ^~ /.well-known/acme-challenge/ {
	    allow all;
	    default_type text/plain;
	    root /home/wwwroot/xxx.com;
	}

然后再:
lnmp restart
lnmp ssl add

然后完成后SSL后请设置,SSL的端口(其中root /home/wwwroot/xxx.com; 请修改成thinkphp的root /home/wwwroot/xxx.com/public; 不然ssl无法访问)

server
    {
        listen 443 ssl http2;
        #listen [::]:443 ssl http2;
        server_name acg.wang ;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/xxx.com/public;

最后 lnmp restart

数据库

数据库关联单条数据超过3000 条数据 可能会触发PHP memory错误直接502 默认PHP是128MB,如果实在有多个3000条数据关联排序请调整到256MB或者512MB,但是还是请不要关联超过3000条数据再排序。如下面的代码是有问题的:

    public function codehistroy(){
         return $this->hasOne(HistroyModel::class,"code",'code')->order('create_time','desc');
     }
#此处模型 关联排序会极大消耗PHP内存

在功能Model,即非创建关联表的模型(内部调用表的模型)直接初始化!
class Xaa{ 无需 class Xaa extends Model{

发表在 None | 留下评论

路由路由thinkcmf下route设置

php.ini里面需要把path_info打开(800行左右)
cgi.fix_pathinfo = 1

TAG:
$this->request->param(‘short’) 才能/demo/gu/short/short/xx (或/demo/gu/short?short=xx)获取信息
$this->request->get(‘short’) 只能/demo/gu/short?short=xx 获取信息

在/data/route/route.php 是全局路由

<?php
use think\facade\Route;


Route::rule('s/:short', 'demo/gu/short', 'GET')->pattern(['short' => '\w+']);

#此处将/s/xx 转到/demo/gu/short/short/xx (或/demo/gu/short?short=xx)

return [
    // 是否开启路由延迟解析
    'url_lazy_route'        => true,
    
    // 默认的路由变量规则
    'default_route_pattern' => '[\w\.]+',
    
    // 是否开启强制路由
    'url_route_must'        => false,
    
    // 合并路由规则
    'route_rule_merge'      => false,
    
    // 路由是否完全匹配
    'route_complete_match'  => false,
    
    // 去除斜杠
    'remove_slash'          => false,
];

发表在 None | 留下评论