H5 预览: http://h5.tinyshop.rageframe.com
uni-app发布页: https://m3w.cn/rageframewsc
后台预览: http://demo2.rageframe.com/backend
账号: demo
密码: 123456
前端开源地址: https://github.com/stavyan/TinyShop-UniApp
后端开源地址: https://github.com/jianyan74/TinyShop
一款基于 RageFrame2 的免费开源的基础销售功能的微商城
前端基于 uni-app,一端发布多端通用,目前已经适配 H5、微信小程序、QQ小程序、Ios App、Android App。目前开源的版本功能为 V1 版,更多增强功能(V2、V3)敬请期待。
RageFrame 遵循 Apache2 开源协议发布,并提供免费使用。
项目介绍:https://github.com/jianyan74/rageframe2
安装文档:https://github.com/jianyan74/rageframe2/blob/master/docs/guide-zh-CN/start-installation.md
用于管理第三方扩展包,
win环境在https://getcomposer.org/download/下载Composer-Setup.exe安装,
linux宝塔
在软件商店安装需要的php7.2版本
登陆ssh或者用面板自带的“宝塔SSH终端”
运行命令:
rm
-f /usr/bin/php
比如要改到php7.2版本的composer就要再次运行一下的命令:
ln
-sf /www/server/php/72/bin/php /usr/bin/php
默认安装的PHP是禁用了proc_open与putenv两个函数,
打开就可以愉快的composer install了!
CA证书参考:
https://blog.csdn.net/ijijni/article/details/86537234
必须先看环境搭建文档,安装完毕后务必配置站点和对应的伪静态还有常见问题文档
1、克隆
git clone https://github.com/jianyan74/rageframe2.git
2、进入目录
cd rageframe2
3、安装依赖
// 如果你只有 php 7.1 也可以忽略版本进行安装 php composer.phar install --ignore-platform-reqs
php composer.phar install
遇到问题:
Warning: putenv() has been disabled for security reasons in...
编辑php.ini文件
disable_functions = scandir,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopen
去掉putenv或者在disable_functions 添加;分号注释,
保存并重起php即可。
使用代理或者使用国内源:
解决方法,更改 Packagist 为国内镜像,不知道会不会对后续操作有影响,反正现在是可以了:
composer config -g repo.packagist composer https://packagist.phpcomposer.com
Cloning failed using an ssh key for authentication, enter your GitHub credential
s to access private repos
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+
on+%5B0x77489020%5D+ANOMALY%3A+meaningless+REX+prefix+used%0D%0AWIN7AN3+2020-04-
12+2251
to retrieve a token. It will be stored in "C:/Users/Admin/AppData/Roaming/Compos
er/auth.json" for future use by Composer.
Token (hidden):
Failed to download kartik-v/yii2-widget-datepicker from source: The 'https:/
/api.github.com/' URL could not be accessed: HTTP/1.0 400 Bad Request
Now trying to download from dist
重新获取token:
https://blog.csdn.net/weixin_34062329/article/details/86000735
- Installing swoole/ide-helper (dev-master a7bae64): Failed to update https://
github.com/swoole/ide-helper.git in cache, package installation for swoole/ide-h
elper might fail.
Cloning a7bae64317 from cache
Failed to download swoole/ide-helper from source: Failed to execute git clon
e --no-checkout "C:/Users/Admin/AppData/Local/Composer/vcs/https---github.com-sw
oole-ide-helper.git/" "E:\WebSite\PHP\www\llj\ragefram\rageframe2\vendor\swoole\
ide-helper" --dissociate --reference "C:/Users/Admin/AppData/Local/Composer/vcs/
https---github.com-swoole-ide-helper.git/" && cd /D "E:\WebSite\PHP\www\llj\rage
fram\rageframe2\vendor\swoole\ide-helper" && git remote set-url origin "https://
github.com/swoole/ide-helper.git.git" && git remote add composer "https://github
.com/swoole/ide-helper.git.git"
Cloning into 'E:\WebSite\PHP\www\llj\ragefram\rageframe2\vendor\swoole\ide-helpe
r'...
done.
fatal: repack: Expecting full hex object ID lines only from pack-objects.
fatal: cannot repack to clean up
Now trying to download from dist
- Installing swoole/ide-helper (dev-master a7bae64): Downloading (connecting..
Downloading (100%)
- Installing yiisoft/yii2-bootstrap (2.0.10): Downloading (100%)
- Installing yiisoft/yii2-debug (2.0.14): Downloading (100%)
- Installing fzaninotto/faker (v1.9.1): Downloading (100%)
- Installing yiisoft/yii2-faker (2.0.4): Downloading (100%)
- Installing phpspec/php-diff (v1.1.0): Downloading (100%)
- Installing bower-asset/typeahead.js (v0.11.1): Downloading (connecting...)
Failed to download bower-asset/typeahead.js from dist: The 'https://api.github
.com/repos/twitter/typeahead.js/zipball/588440f66559714280628a4f9799f0c4eb880a4a
' URL could not be accessed: HTTP/1.0 400 Bad Request
Now trying to download from source
- Installing bower-asset/typeahead.js (v0.11.1): Cloning 588440f665
[RuntimeException]
Failed to execute git clone --no-checkout "https://7f208908497b155a0e941435
a1c1239f5b113d26%0A%5B0x77489020%5D%20ANOMALY%3A%20meaningless%20REX%20pref
ix%20used:***@github.com/twitter/typeahead.js.git" "E:\WebSite\PHP\www\llj\
ragefram\rageframe2\vendor\bower-asset\typeahead.js" && cd /D "E:\WebSite\P
HP\www\llj\ragefram\rageframe2\vendor\bower-asset\typeahead.js" && git remo
te add composer "https://7f208908497b155a0e941435a1c1239f5b113d26%0A%5B0x77
489020%5D%20ANOMALY%3A%20meaningless%20REX%20prefix%20used:***@github.com/t
witter/typeahead.js.git" && git fetch composer && git remote set-url origin
"https://github.com/twitter/typeahead.js.git" && git remote set-url compos
er "https://github.com/twitter/typeahead.js.git"
Cloning into 'E:\WebSite\PHP\www\llj\ragefram\rageframe2\vendor\bower-asset
\typeahead.js'...
fatal:***@github.com/twitter/typeahead.js.git/': URL using bad/illegal form
at or missing URL
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-c
ustom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest
] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative]
[--apcu-autoloader] [--ignore-platform-reqs] [--] []...
4、初始化项目
php init // 然后输入0回车,再输入yes回车
5、配置数据库信息
找到 common/config/main-local.php 并配置相应的信息, 注意要先创建好数据库
6、安装数据库(Mysql5.7及以上)
php ./yii migrate/up
7、初始化账号密码,一键创建总管理员账号密码(注意保存)
php ./yii password/init
截止到这里就安装完成了,可以去配置站点了,下面(8、9步骤)的都是根据自己实际的情况去执行
8、建议更新第三方扩展包(可选)
php composer.phar update
9、Linux 下文件缓存权限授权
Linux 环境下如果是文件缓存去 backend/runtime
目录执行一下 chmod -R 777 cache
,不执行可能会造成修改了网站设置缓存不生效的情况
注意:Nginx/IIS 先要设置好伪静态,Apache 默认已配置
伪静态
目录
- Nginx
- Apache
- IIS
Nginx
推荐配置
location / { try_files $uri $uri/ /index.php$is_args$args; } location /backend { try_files $uri $uri/ /backend/index.php$is_args$args; } location /api { try_files $uri $uri/ /api/index.php$is_args$args; } location /merchant { try_files $uri $uri/ /merchant/index.php$is_args$args; } location /merapi { try_files $uri $uri/ /merapi/index.php$is_args$args; } location /html5 { try_files $uri $uri/ /html5/index.php$is_args$args; } location /oauth2 { try_files $uri $uri/ /oauth2/index.php$is_args$args; }
类似Apache的配置
location / { index index.html index.htm index.php; if (!-e $request_filename) { rewrite ^/backend(.*)$ /backend/index.php?s=$1 last; rewrite ^/merchant(.*)$ /merchant/index.php?s=$1 last; rewrite ^/merapi(.*)$ /merapi/index.php?s=$1 last; rewrite ^/api(.*)$ /api/index.php?s=$1 last; rewrite ^/html5(.*)$ /html5/index.php?s=$1 last; rewrite ^/oauth2(.*)$ /oauth2/index.php?s=$1 last; rewrite ^/(.*)$ /index.php?s=$1 last; break; } #autoindex on; }
Apache
注意系统默认自带了.htaccess,所以环境如果是apache可以不用再配置
Options +FollowSymLinks IndexIgnore */* RewriteEngine on # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward it to index.php RewriteRule . index.php
IIS...
https://github.com/jianyan74/rageframe2/blob/master/docs/guide-zh-CN/start-rewrite.md
站点指向目录为当前项目的web下
例如:
/path/to/rageframe2/web/
访问说明
应用 | Url |
---|---|
后台 | 当前域名/backend |
商户 | 当前域名/merchant |
商户接口 | 当前域名/merapi |
Html5 | 当前域名/html5 |
Api | 当前域名/api |
OAuth2 | 当前域名/oauth2 |
安装成功后如果需要微信公众号管理、商户管理等等功能,请到 系统管理->应用管理 进行安装插件
git clone https://github.com/jianyan74/TinyShop.git
2、拷贝进 RageFrame 根目录的 addons 目录下
3、RageFrame 后台进入 系统管理->应用管理->安装插件->找到在微商城进行安装
4、刷新整个后台页面后进行查看
1. HBuilderX导入
2. vue-cli命令运行
推荐使用yarn命令,使用npm/cnpm会存在报错问题。
// 安装yarn命令 npm i -g yarn // 安装依赖 yarn
3. 运行到指定平台
// 运行到H5 yarn serve // 运行至对应的小程序平台 yarn dev:PLATFORM // PLATFORM的值可以是 mp-weixin mp-alipay mp-baidu mp-toutiao mp-qq
接口配置文件:/src/api/params.js
// 主机地址
const hostUrl = "http://localhost:8080";
// 后台接口请求地址
const baseUrl = "http://b.com/api";
小程序微信登录有点问题:
Request URL: http://b.com/api/tiny-shop/v1/third-party/wechat-mp
Request Method: POST
type: "GuzzleHttp\Exception\RequestException"
file: "rageframe2\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php"
errorMessage: "cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)"
line: 201
rageframe2\addons\TinyShop\api\modules\v1\controllers\ThirdPartyController.php
68行:public function actionWechatMp(){}
https://curl.haxx.se/docs/caextract.html
下载cacert.pem
并在php.ini文件添加
curl.cainfo="D:/php72/extras/ssl/cacert.pem"
openssl.cafile="D:/php72/extras/ssl/cacert.pem"
参考:
https://blog.csdn.net/ijijni/article/details/86537234
4. 打包至线上部署
// H5打包 yarn build // 打包至对应的小程序平台 yarn build:PLATFORM // 平台信息同上 //HbuilderX 用android studio 本地打包app ************ https://blog.csdn.net/cuberk/article/details/103647190 // Android 平台 HTML5+ SDK的集成(HBuilder离线打包) ************ https://blog.csdn.net/qq_33337504/article/details/80061055 //HBuilderX生成本地打包App资源 ************* https://ask.dcloud.net.cn/question/60254 //Android离线打包(支持广告) https://ask.dcloud.net.cn/article/13141 //uni-app离线打包Android平台注意事项 https://ask.dcloud.net.cn/article/35139 //APP: //Android平台本地(离线)打包指南 - Android Studio https://ask.dcloud.net.cn/article/508 //iOS离线打包 https://ask.dcloud.net.cn/article/41 //DCloud appid 用途/作用/使用说明 https://ask.dcloud.net.cn/article/35907 //Android平台云端打包 - 公共测试证书 https://ask.dcloud.net.cn/article/36522 //iOS证书(.p12)和描述文件(.mobileprovision)申请 https://ask.dcloud.net.cn/article/152
导出本地app编译包时,遇到错误:
未检测到微信web开发者工具,即使开发App也需要此工具。如已安装,请确认路径配置是否正确(HBuilderX设置-运行配置-微信开发者工具路径),或检查是否微信工具版本过低
解决方法:
重新安装正式版微信开发工具