mirror of
http://124.126.16.154:8888/singularity/hyperf-admin.git
synced 2026-01-15 07:15:06 +08:00
docs: 完成文档
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
?> `hyperf-admin`目前尚未开源, 敬请期待.
|
||||
|
||||
## 前端
|
||||
|
||||
```shell
|
||||
# 环境依赖
|
||||
# 1. node ^v11.2.0 https://nodejs.org/zh-cn/download/
|
||||
# 2. npm ^6.4.1
|
||||
git clone https://github.com/hyperf-admin/hyperf-admin-front.git
|
||||
git clone https://github.com/hyperf-admin/hyperf-admin-frontend.git
|
||||
cd hyperf-admin-front
|
||||
npm i
|
||||
npm run dev
|
||||
@@ -24,16 +22,49 @@ npm run build:test
|
||||
|
||||
```shell
|
||||
# 环境依赖 php ^7.1 composer swoole
|
||||
# 下载demo项目
|
||||
git clone https://github.com/hyperf-admin/hyperf-admin-skeleton.git
|
||||
cd hyperf-admin-skeleton
|
||||
composer create-project hyperf/hyperf-skeleton hyperf-admin
|
||||
cd hyperf-admin
|
||||
# hyperf-admin 为分包的模式, 此处引入的是完整厂库, 实际项目请按需引入
|
||||
composer require hyperf-admin/hyperf-admin
|
||||
composer i
|
||||
# 启动
|
||||
# 启动 热重启参考 https://github.com/daodao97/hyperf-watch
|
||||
composer watch
|
||||
```
|
||||
|
||||
## nginx配置
|
||||
|
||||
```nginx
|
||||
# conf
|
||||
upstream backend {
|
||||
server 127.0.0.1:9511;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name hyperf-admin.com;
|
||||
index index.html;
|
||||
root /opt/www/rock-admin-front/dist;
|
||||
access_log /usr/local/var/log/nginx/hyperf-admin.access.log;
|
||||
error_log /usr/local/var/log/nginx/hyperf-admin.error.log;
|
||||
|
||||
location ~ /api/(.*) {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "keep-alive";
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host hyperf-admin.com;
|
||||
proxy_pass http://backend/$1$is_args$args;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /opt/www/rock-admin-front/dist/default;
|
||||
index index.html;
|
||||
}
|
||||
|
||||
location ~ /(.*) {
|
||||
set $module $1;
|
||||
if ($module ~* '^$') {
|
||||
set $module default;
|
||||
}
|
||||
try_files $uri $uri/ /$module/index.html;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
100
docs/index.html
100
docs/index.html
@@ -1,63 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>hyperf-admin</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="description" content="Description">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
|
||||
<link rel="shortcut icon" type="image/icon" href="/favicon.ico">
|
||||
<meta charset="UTF-8">
|
||||
<title>hyperf-admin</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta name="description" content="Description">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
|
||||
<link rel="shortcut icon" type="image/icon" href="/hyperf-admin/favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
<script>
|
||||
<div id="app"></div>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
name: 'hyperf-admin',
|
||||
//logo: '/logo.png',
|
||||
repo: 'https://github.com/hyperf-admin',
|
||||
//coverpage: true, // 开启封面
|
||||
loadNavbar: true,
|
||||
loadSidebar: true,
|
||||
maxLevel: 4,
|
||||
subMaxLevel: 3,
|
||||
autoHeader: true,
|
||||
search: {
|
||||
maxAge: 86400000, // 过期时间,单位毫秒,默认一天
|
||||
paths: 'auto', // or 'auto'
|
||||
placeholder: 'Type to search'
|
||||
},
|
||||
plugins: [
|
||||
function (hook, vm) {
|
||||
hook.beforeEach(function (html) {
|
||||
if (/githubusercontent\.com/.test(vm.route.file)) {
|
||||
url = vm.route.file
|
||||
.replace('raw.githubusercontent.com', 'github.com')
|
||||
.replace(/\/master/, '/blob/master')
|
||||
} else {
|
||||
url = 'https://github.com/hyperf-admin/hyperf-admin.github.io/edit/master/' + vm.route.file
|
||||
}
|
||||
var editHtml = '[:memo: 编辑文档!](' + url + ') '
|
||||
name: 'hyperf-admin',
|
||||
//logo: '/logo.png',
|
||||
repo: 'https://github.com/hyperf-admin',
|
||||
//coverpage: true, // 开启封面
|
||||
loadNavbar: true,
|
||||
loadSidebar: true,
|
||||
maxLevel: 4,
|
||||
subMaxLevel: 3,
|
||||
autoHeader: true,
|
||||
search: {
|
||||
maxAge: 86400000, // 过期时间,单位毫秒,默认一天
|
||||
paths: 'auto', // or 'auto'
|
||||
placeholder: 'Type to search'
|
||||
},
|
||||
plugins: [
|
||||
function (hook, vm) {
|
||||
hook.beforeEach(function (html) {
|
||||
if (/githubusercontent\.com/.test(vm.route.file)) {
|
||||
url = vm.route.file
|
||||
.replace('raw.githubusercontent.com', 'github.com')
|
||||
.replace(/\/master/, '/blob/master')
|
||||
} else {
|
||||
url = 'https://github.com/hyperf-admin/hyperf-admin.github.io/edit/master/' + vm.route.file
|
||||
}
|
||||
var editHtml = '[:memo: 编辑文档!](' + url + ') '
|
||||
|
||||
return html
|
||||
+ '\n\n----\n\n'
|
||||
+ editHtml
|
||||
+ '<a href="https://docsify.js.org" target="_blank" style="color: inherit; font-weight: normal; text-decoration: none;">Powered by docsify</a>'
|
||||
})
|
||||
}
|
||||
]
|
||||
return html
|
||||
+ '\n\n----\n\n'
|
||||
+ editHtml
|
||||
+ '<a href="https://docsify.js.org" target="_blank" style="color: inherit; font-weight: normal; text-decoration: none;">Powered by docsify</a>'
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
if (typeof navigator.serviceWorker !== 'undefined') {
|
||||
navigator.serviceWorker.register('https://raw.githubusercontent.com/hyperf-admin/hyperf-admin.github.io/master/ws.js')
|
||||
}
|
||||
</script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-bash.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-php.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-json.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-sql.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
|
||||
<script src="//unpkg.com/docsify-copy-code"></script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.js"></script>
|
||||
</script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-bash.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-php.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-json.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-sql.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
|
||||
<script src="//unpkg.com/docsify-copy-code"></script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user