1、所需环境
- Node.js:运行环境
- pnpm:包管理器
- Git:用于克隆仓库
2、构建前端
新建文件夹打开cmd
git clone https://github.com/OpenListTeam/OpenList-Frontend.git(克隆仓库到本地)
cd OpenList-Frontend(切换到仓库目录)
pnpm install (下载需要的包)
pnpm build(构建前端)
之后会生成一个dist
3、构建后端
3、构建后端
git clone https://github.com/OpenListTeam/OpenLis.git (克隆后端到本地)
将上一步的 dist 目录复制到项目下的 public 目录下,然后执行:
appName="openlist"
builtAt="$(date +'%F %T %z')"
goVersion=$(go version | sed 's/go version //')
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
gitCommit=$(git log --pretty=format:"%h" -1)
version=$(git describe --long --tags --dirty --always)
webVersion=$(curl -s --max-time 5 "https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest" -L | grep '"tag_name":' | sed -E 's/."([^"]+)"./\1/' | sed 's/^v//')
if [ -z "$webVersion" ]; then
webVersion="0.0.0"
fi
ldflags="\
-w -s \
-X 'github.com/OpenListTeam/OpenList/v4/internal/conf.BuiltAt=$builtAt' \
-X 'github.com/OpenListTeam/OpenList/v4/internal/conf.GoVersion=$goVersion' \
-X 'github.com/OpenListTeam/OpenList/v4/internal/conf.GitAuthor=$gitAuthor' \
-X 'github.com/OpenListTeam/OpenList/v4/internal/conf.GitCommit=$gitCommit' \
-X 'github.com/OpenListTeam/OpenList/v4/internal/conf.Version=$version' \
-X 'github.com/OpenListTeam/OpenList/v4/internal/conf.WebVersion=$webVersion' \
"
go build -ldflags="$ldflags" .
就会生成一个exe可执行文件
4、启动
在有exe的文件夹里打开cmd输入
openlist server
第一次启动记得记住密码,后访问localho1st:5244就行默认账号是admin








Comments | NOTHING