From d2ff854e251215ee37d07c9d5dd73b4b9f8cbe45 Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Wed, 8 Jan 2020 21:32:24 +0800 Subject: [PATCH 1/5] =?UTF-8?q?chore[litemall-db]:=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=84=9A=E6=9C=AC=E8=AE=BE=E7=BD=AE=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E4=BB=BB=E6=84=8Fip=E8=AE=BF=E9=97=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- litemall-db/sql/litemall_schema.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litemall-db/sql/litemall_schema.sql b/litemall-db/sql/litemall_schema.sql index dae8ead5..e4c9457e 100644 --- a/litemall-db/sql/litemall_schema.sql +++ b/litemall-db/sql/litemall_schema.sql @@ -1,8 +1,8 @@ drop database if exists litemall; -drop user if exists 'litemall'@'localhost'; +drop user if exists 'litemall'@'%'; -- 支持emoji:需要mysql数据库参数: character_set_server=utf8mb4 create database litemall default character set utf8mb4 collate utf8mb4_unicode_ci; use litemall; -create user 'litemall'@'localhost' identified by 'litemall123456'; -grant all privileges on litemall.* to 'litemall'@'localhost'; +create user 'litemall'@'%' identified by 'litemall123456'; +grant all privileges on litemall.* to 'litemall'@'%'; flush privileges; \ No newline at end of file From 3822787797b852bd435dd5c9770d330302e4fc3a Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Wed, 8 Jan 2020 21:33:05 +0800 Subject: [PATCH 2/5] =?UTF-8?q?docker=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/bin/deploy.sh | 7 +++++++ docker/bin/reset.sh | 36 ++++++++++++++++++++++++++++++++++++ docker/litemall/Dockerfile | 4 ++-- docker/util/lazy.sh | 14 +++++++------- 4 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 docker/bin/deploy.sh create mode 100644 docker/bin/reset.sh diff --git a/docker/bin/deploy.sh b/docker/bin/deploy.sh new file mode 100644 index 00000000..9182a2b5 --- /dev/null +++ b/docker/bin/deploy.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +cd /home/ubuntu/docker +sudo docker-compose down +sudo docker-compose build +sudo docker image prune -f +sudo docker-compose up -d diff --git a/docker/bin/reset.sh b/docker/bin/reset.sh new file mode 100644 index 00000000..e9cfaa01 --- /dev/null +++ b/docker/bin/reset.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# 本脚本的作用是重置部署环境 +# 1.重置数据库 +# 2.删除storage文件夹内文件 +# 3.调用deploy.sh启动服务 +# 注意:由于1和2的原因,请仅在开发测试阶段使用本脚本! + +# 重置数据库 +# i. 请在`XXXXXX`处设置相应的root密码 +# ii. 同时请注意root密码放在脚本是非常危险的,因此这里仅仅是用于开发测试阶段。 +ROOT=root +PASSWORD=litemall123456 + +if test -z "$PASSWORD" +then + echo "请设置云服务器MySQL的root账号密码" + exit 1 +fi + +# 删除storage文件夹内文件 +cd /home/ubuntu/docker/litemall/storage || exit 2 +sudo rm -f ./** + +cd /home/ubuntu/docker || exit 3 +sudo docker-compose down +sudo docker-compose build +sudo docker image prune -f + +# 删除db/data文件夹内文件重置数据 +# 这样docker启动时会自动运行db/init-sql脚本,导入新的数据 +cd /home/ubuntu/docker/db/data || exit 1 +sudo rm -rf ./** + +cd /home/ubuntu/docker || exit 3 +sudo docker-compose up -d diff --git a/docker/litemall/Dockerfile b/docker/litemall/Dockerfile index 44a0c65f..a882824e 100644 --- a/docker/litemall/Dockerfile +++ b/docker/litemall/Dockerfile @@ -1,4 +1,4 @@ FROM openjdk:8-jre -COPY application.yml /litemall/application.yml -COPY litemall.jar /litemall/litemall.jar +COPY application.yml application.yml +COPY litemall.jar litemall.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","litemall.jar"] \ No newline at end of file diff --git a/docker/util/lazy.sh b/docker/util/lazy.sh index 1d5e93d7..570642de 100644 --- a/docker/util/lazy.sh +++ b/docker/util/lazy.sh @@ -7,10 +7,10 @@ # 请设置云服务器的IP地址和账户 # 例如 ubuntu@122.51.199.160 -REMOTE= +REMOTE=ubuntu@122.51.199.160 # 请设置本地SSH私钥文件id_rsa路径 # 例如 /home/litemall/id_rsa -ID_RSA= +ID_RSA=/d/00/cloud/litemall.txt if test -z "$REMOTE" then @@ -38,8 +38,8 @@ cd $LITEMALL_HOME || exit 2 scp -i $ID_RSA -r ./docker $REMOTE:/home/ubuntu/ # 远程登录云服务器并执行reset脚本 -#ssh $REMOTE -i $ID_RSA << eeooff -#cd /home/ubuntu -#sudo ./docker/bin/reset.sh -#exit -#eeooff \ No newline at end of file +ssh $REMOTE -i $ID_RSA << eeooff +cd /home/ubuntu +sudo ./docker/bin/reset.sh +exit +eeooff \ No newline at end of file From 7df32f31c8890d79666fa2c08e0e4bd493f633bf Mon Sep 17 00:00:00 2001 From: linlinjava Date: Wed, 8 Jan 2020 22:08:19 +0800 Subject: [PATCH 3/5] #311 * Add register function. * Add register function. Co-authored-by: Longbao Ye --- litemall-vue/src/api/api.js | 7 ++ litemall-vue/src/router/login.js | 3 +- .../views/login/register-getCode/index.vue | 17 +++- .../src/views/login/register-status/index.vue | 72 +++++++++++------ .../src/views/login/register-submit/index.vue | 81 ++++++++++++++++--- .../litemall/wx/web/WxAuthController.java | 3 +- 6 files changed, 142 insertions(+), 41 deletions(-) diff --git a/litemall-vue/src/api/api.js b/litemall-vue/src/api/api.js index b07840d0..469b7f4b 100644 --- a/litemall-vue/src/api/api.js +++ b/litemall-vue/src/api/api.js @@ -59,6 +59,13 @@ export function authProfile(data) { }) } const AuthRegister='wx/auth/register'; //账号注册 +export function authRegister(data) { + return request({ + url: AuthRegister, + method: 'post', + data + }); +} const AuthReset='wx/auth/reset'; //账号密码重置 export function authReset(data) { return request({ diff --git a/litemall-vue/src/router/login.js b/litemall-vue/src/router/login.js index e3e5b0c7..afb9ef8a 100644 --- a/litemall-vue/src/router/login.js +++ b/litemall-vue/src/router/login.js @@ -10,8 +10,9 @@ export default [ component: () => import('@/views/login/register-getCode') }, { - path: '/login/registerSubmit', + path: '/login/registerSubmit/:phone', name: 'registerSubmit', + props: true, component: () => import('@/views/login/register-submit') }, { diff --git a/litemall-vue/src/views/login/register-getCode/index.vue b/litemall-vue/src/views/login/register-getCode/index.vue index 3bac02b9..71acfeb6 100755 --- a/litemall-vue/src/views/login/register-getCode/index.vue +++ b/litemall-vue/src/views/login/register-getCode/index.vue @@ -20,6 +20,7 @@ diff --git a/litemall-vue/src/views/login/register-submit/index.vue b/litemall-vue/src/views/login/register-submit/index.vue index 7089b89e..b4b541ff 100755 --- a/litemall-vue/src/views/login/register-submit/index.vue +++ b/litemall-vue/src/views/login/register-submit/index.vue @@ -2,12 +2,13 @@
- + 获取验证码
+ @@ -20,29 +21,83 @@