Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周健威
rs-cloud-platform
Commits
1a56b0ef
Commit
1a56b0ef
authored
Jan 15, 2021
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
92353436
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
113 additions
and
113 deletions
+113
-113
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+113
-113
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
1a56b0ef
...
@@ -802,120 +802,120 @@ public class AppPermissionService {
...
@@ -802,120 +802,120 @@ public class AppPermissionService {
}
}
/**
// /**
* 小程序注册用户
// * 小程序注册用户
*
// *
* @param username
// * @param username
* @param password
// * @param password
* @param headimgurl
// * @param headimgurl
* @param nickname
// * @param nickname
*/
// */
@Transactional
// @Transactional
public
JSONObject
applyRegister
(
String
username
,
String
password
,
String
headimgurl
,
String
nickname
,
Integer
small_id
)
{
// public JSONObject applyRegister(String username, String password, String headimgurl, String nickname, Integer small_id) {
// 判断参数
// // 判断参数
if
(
StringUtils
.
isBlank
(
username
)
||
StringUtils
.
isBlank
(
password
))
{
// if (StringUtils.isBlank(username) || StringUtils.isBlank(password)) {
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
// return JsonResultUtil.createFailedResult(ResultCode.NULL_CODE, "参数为空");
}
// if (StringUtils.isNotBlank(username)){
// return JsonResultUtil.createFailedResult(ResultCode.FAILED_CODE, "服务升级中,暂不支持注册");
// }
// }
// 是否已存在
//// if (StringUtils.isNotBlank(username)){
AppUserLogin
user
=
appUserLoginBiz
.
checkeUserLogin
(
username
);
//// return JsonResultUtil.createFailedResult(ResultCode.FAILED_CODE, "服务升级中,暂不支持注册");
if
(
null
!=
user
)
{
//// }
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
EXIST_CODE
,
"用户已存在"
);
// // 是否已存在
}
// AppUserLogin user = appUserLoginBiz.checkeUserLogin(username);
// 新增用户登录信息
// if (null != user) {
try
{
// return JsonResultUtil.createFailedResult(ResultCode.EXIST_CODE, "用户已存在");
Long
now
=
System
.
currentTimeMillis
()
/
1000
;
// }
AppUserLogin
appUserLogin
=
new
AppUserLogin
();
// // 新增用户登录信息
appUserLogin
.
setUsername
(
username
);
// try {
appUserLogin
.
setPassword
(
password
);
// Long now = System.currentTimeMillis() / 1000;
appUserLogin
.
setIsdel
(
0
);
// AppUserLogin appUserLogin = new AppUserLogin();
appUserLogin
.
setStatus
(
0
);
// appUserLogin.setUsername(username);
appUserLogin
.
setCreatetime
(
now
);
// appUserLogin.setPassword(password);
appUserLogin
.
setUpdatetime
(
now
);
// appUserLogin.setIsdel(0);
appUserLoginBiz
.
insertSelective
(
appUserLogin
);
// appUserLogin.setStatus(0);
Integer
userid
=
appUserLogin
.
getId
();
// appUserLogin.setCreatetime(now);
log
.
error
(
"注册:新增登陆用户信息: "
+
userid
);
// appUserLogin.setUpdatetime(now);
// 新增用户详情
// appUserLoginBiz.insertSelective(appUserLogin);
AppUserDetail
rsUserDetail
=
new
AppUserDetail
();
// Integer userid = appUserLogin.getId();
rsUserDetail
.
setUserid
(
userid
);
// log.error("注册:新增登陆用户信息: " + userid);
rsUserDetail
.
setNickname
(
nickname
);
// // 新增用户详情
rsUserDetail
.
setHeadimgurl
(
headimgurl
);
// 默认路径,待写
// AppUserDetail rsUserDetail = new AppUserDetail();
rsUserDetail
.
setCreatetime
(
now
);
// rsUserDetail.setUserid(userid);
rsUserDetail
.
setUpdatetime
(
now
);
// rsUserDetail.setNickname(nickname);
rsUserDetail
.
setIsdel
(
0
);
// rsUserDetail.setHeadimgurl(headimgurl); // 默认路径,待写
//生成邀请码 长度改为8 不然重复率太高
// rsUserDetail.setCreatetime(now);
rsUserDetail
.
setCode
(
ReferralCodeUtil
.
encode
(
userid
));
// rsUserDetail.setUpdatetime(now);
//设置来源
// rsUserDetail.setIsdel(0);
log
.
info
(
"register------username====="
+
username
+
"----channel===="
+
UserSourceEnum
.
APPLET
.
getCode
());
// //生成邀请码 长度改为8 不然重复率太高
rsUserDetail
.
setChannel
(-
1
);
// rsUserDetail.setCode(ReferralCodeUtil.encode(userid));
rsUserDetail
.
setCrtHost
(
getIp
());
// //设置来源
//setCreateIPInfo(rsUserDetail);
// log.info("register------username====="+username+"----channel===="+UserSourceEnum.APPLET.getCode());
rsUserDetail
.
setState
(
1
);
// rsUserDetail.setChannel(-1);
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
// rsUserDetail.setCrtHost(getIp());
log
.
error
(
"注册:新增用户详情: "
+
userid
);
// //setCreateIPInfo(rsUserDetail);
//创建钱包
// rsUserDetail.setState(1);
walletBiz
.
createWalletByUserId
(
appUserLogin
.
getId
());
// appUserDetailBiz.insertSelective(rsUserDetail);
// log.error("注册:新增用户详情: " + userid);
//上线绑定
// //创建钱包
relationBiz
.
bindByUserId
(
userid
,
small_id
);
// walletBiz.createWalletByUserId(appUserLogin.getId());
//发送短信通知用户
//
List
<
String
>
smsParams
=
new
ArrayList
<
String
>();
// //上线绑定
smsParams
.
add
(
smallName
);
// relationBiz.bindByUserId(userid, small_id);
smsParams
.
add
(
username
);
// //发送短信通知用户
smsParams
.
add
(
password
);
// List<String> smsParams = new ArrayList<String>();
thirdFeign
.
sendTemplate
(
new
SmsTemplateDTO
(){{
// smsParams.add(smallName);
setPhoneNumbers
(
username
);
// smsParams.add(username);
setType
(
SmsTemplateDTO
.
PWD
);
// smsParams.add(password);
setParams
(
smsParams
.
toArray
(
new
String
[
smsParams
.
size
()]));
// thirdFeign.sendTemplate(new SmsTemplateDTO(){{
}});
// setPhoneNumbers(username);
// setType(SmsTemplateDTO.PWD);
// 登录结果要做做统一处理
// setParams(smsParams.toArray(new String[smsParams.size()]));
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
null
,
null
,
2
);
// }});
//
if
(
data
!=
null
)
{
// // 登录结果要做做统一处理
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
// JSONObject data = autoLogin(userid, username, headimgurl, nickname,null,null,2);
}
else
{
//
return
JsonResultUtil
.
createDefaultFail
();
// if (data != null) {
}
// return JsonResultUtil.createSuccessResultWithObj(data);
}
catch
(
Exception
e
)
{
// } else {
log
.
error
(
e
.
getMessage
(),
e
);
// return JsonResultUtil.createDefaultFail();
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
EXCEPTION_CODE
,
"出现异常"
);
// }
}
// } catch (Exception e) {
}
// log.error(e.getMessage(), e);
// return JsonResultUtil.createFailedResult(ResultCode.EXCEPTION_CODE, "出现异常");
// }
/**
// }
* 通过小程序注册
*
* @param username
// /**
* @return
// * 通过小程序注册
*/
// *
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
// * @param username
public
JSONObject
appletRegistry
(
String
username
,
String
headimgurl
,
String
nickname
,
Integer
small_id
)
{
// * @return
// */
try
{
// @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
// 是否已存在
// public JSONObject appletRegistry(String username, String headimgurl, String nickname, Integer small_id) {
AppUserLogin
user
=
appUserLoginBiz
.
checkeUserLogin
(
username
);
//
JSONObject
data
=
new
JSONObject
();
// try {
if
(
null
==
user
)
{
// // 是否已存在
//随机生成密码
// AppUserLogin user = appUserLoginBiz.checkeUserLogin(username);
String
password
=
UUIDUtils
.
genCodes
(
8
);
// JSONObject data = new JSONObject();
data
=
applyRegister
(
username
,
password
,
headimgurl
,
nickname
,
small_id
);
// if (null == user) {
}
else
{
// //随机生成密码
Integer
userid
=
user
.
getId
();
// String password = UUIDUtils.genCodes(8);
//上线绑定
// data = applyRegister(username, password, headimgurl, nickname, small_id);
relationBiz
.
bindByUserId
(
userid
,
small_id
);
// } else {
//登录
// Integer userid = user.getId();
data
=
appletLoginByUserId
(
userid
);
// //上线绑定
}
// relationBiz.bindByUserId(userid, small_id);
return
data
;
// //登录
}
catch
(
Exception
e
)
{
// data = appletLoginByUserId(userid);
log
.
error
(
e
.
getMessage
(),
e
);
// }
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
EXCEPTION_CODE
,
"出现异常"
);
// return data;
}
// } catch (Exception e) {
}
// log.error(e.getMessage(), e);
// return JsonResultUtil.createFailedResult(ResultCode.EXCEPTION_CODE, "出现异常");
// }
// }
public
ImiVo
findUserInoByImiId
(
Integer
imiId
)
{
public
ImiVo
findUserInoByImiId
(
Integer
imiId
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment