....
BIN
front/favicon.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
front/icon.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
38
front/index.html
Normal file
@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ch" manifest="IGNORE.manifest">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<!--no-cache浏览器会缓存,但刷新页面或者重新打开时 会请求服务器,服务器可以响应304,如果文件有改动就会响应200-->
|
||||
<meta http-equiv="cache-control" content="max-age=0" />
|
||||
<meta http-equiv="cache-control" content="no-cache" />
|
||||
<meta http-equiv="expires" content="0" />
|
||||
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
|
||||
<meta name="apple-touch-fullscreen" content="YES" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
<meta name="viewport"
|
||||
content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,viewport-fit=cover" />
|
||||
<link rel="icon" href="favicon.ico">
|
||||
<title>
|
||||
平安业绩发布会邀请函
|
||||
</title>
|
||||
<link href="static/js/Web3Library.js" rel="prefetch"><link href="static/js/chunk-vendors.js" rel="preload" as="script"><link href="static/js/index.js" rel="preload" as="script"></head>
|
||||
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but 平安业绩发布会邀请函 doesn't work properly without JavaScript enabled.
|
||||
Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- loading -->
|
||||
<div class="loading-container" id="loadingContainer">
|
||||
<div class="loader"></div>
|
||||
</div>
|
||||
<!-- built files will be auto injected -->
|
||||
<script type="text/javascript" src="static/js/chunk-vendors.js"></script><script type="text/javascript" src="static/js/index.js"></script></body>
|
||||
|
||||
</html>
|
||||
BIN
front/other/error.png
Normal file
|
After Width: | Height: | Size: 550 B |
BIN
front/other/loading.gif
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
front/static/img/aireplane.fd48386f.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
front/static/img/aireplane_fire.70fd0ff9.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
front/static/img/airplane.bbbfd49f.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
front/static/img/airplane2.aebddb1e.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
front/static/img/collection_bg.638f78b3.jpg
Normal file
|
After Width: | Height: | Size: 274 KiB |
BIN
front/static/img/collection_box_bg.1bc13cf1.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
front/static/img/default_img.2f28fe92.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
front/static/img/envelope_back.600a6e0f.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
front/static/img/envelope_front.366d5c2a.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
front/static/img/form_bg.76066315.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
front/static/img/fungus_fire.a6ed7f7a.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
front/static/img/get_collection.1a23ddec.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
front/static/img/get_name_dialog.955f000a.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
front/static/img/invite_bg.9c3d4607.jpg
Normal file
|
After Width: | Height: | Size: 270 KiB |
BIN
front/static/img/invite_box_bg.b449fb3b.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
front/static/img/invite_box_blur_bg.7363d39c.png
Normal file
|
After Width: | Height: | Size: 219 KiB |
BIN
front/static/img/loading_icon.a2840652.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
front/static/img/loading_progress_bg.40c0c89b.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
front/static/img/loading_progress_icon.77e51b20.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
front/static/img/main_bg.ace96d99.jpg
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
front/static/img/main_box.d5e27a61.png
Normal file
|
After Width: | Height: | Size: 316 KiB |
BIN
front/static/img/show_bg.33b714fa.jpg
Normal file
|
After Width: | Height: | Size: 308 KiB |
BIN
front/static/img/spaceman.ac01e2ee.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
front/static/img/submit.5c8a8e10.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
front/static/img/sure_btn.fbd60703.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
front/static/img/title.4b29bbc4.png
Normal file
|
After Width: | Height: | Size: 134 KiB |
3346
front/static/js/Web3Library.js
Normal file
4791
front/static/js/chunk-vendors.js
Normal file
1202
front/static/js/index.js
Normal file
BIN
front/static/media/infinite.559a3b36.mp4
Normal file
4
pom.xml
@ -116,6 +116,10 @@
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -54,6 +54,7 @@ public class NFTPhotoController {
|
||||
System.out.println(jsonObject);
|
||||
//调用第三方接口
|
||||
JSONObject json = HttpClientUtils.httpPost("https://stg-nft-gallery.pingan.com.cn/PABankNewsConference/entropy", jsonObject);
|
||||
//JSONObject json = HttpClientUtils.httpPost("https://nft-gallery.pingan.com.cn/PABankNewsConference/entropy", jsonObject);
|
||||
if(!"SUCCESS".equals(json.get("code"))){
|
||||
log.error( "获取entropy失败!json:"+json);
|
||||
return R.error("获取entropy失败!");
|
||||
@ -82,10 +83,16 @@ public class NFTPhotoController {
|
||||
}
|
||||
//获取用户的手机号和图片hash值
|
||||
Map<String,Object> map = nftPhotoService.getPhoneAndHash(openid);
|
||||
String format = String.format("{'seed':'%s','walletAddr':'%s','paintingHash':'%s','message':'%s'}",map.get("phone"),walletAddr, map.get("painting_hash"),nickname);
|
||||
if(map == null ){
|
||||
return R.error("openid不存在!");
|
||||
}
|
||||
String phone = (String)map.get("phone");
|
||||
phone = encrypt(phone);
|
||||
String format = String.format("{'seed':'%s','walletAddr':'%s','paintingHash':'%s','message':'%s'}",phone,walletAddr, map.get("painting_hash"),nickname);
|
||||
System.out.println(format);
|
||||
JSONObject jsonObject = JSONObject.parseObject(format);
|
||||
JSONObject json = HttpClientUtils.httpPost("https://stg-nft-gallery.pingan.com.cn/PABankNewsConference/nfts", jsonObject);
|
||||
//JSONObject json = HttpClientUtils.httpPost("https://nft-gallery.pingan.com.cn/PABankNewsConference/nfts", jsonObject);
|
||||
//第三方备份用户和NFT图片对应关系操作成功
|
||||
if("SUCCESS".equals(json.get("code"))){
|
||||
//绑定用户昵称
|
||||
@ -95,7 +102,7 @@ public class NFTPhotoController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 领取数字藏品展示页面
|
||||
* 领取数字藏品展示页面和数字藏品详情
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getNftPhoto")
|
||||
@ -105,19 +112,26 @@ public class NFTPhotoController {
|
||||
log.error("openid为空:"+openid);
|
||||
return R.error("openid为空");
|
||||
}
|
||||
//查询数字藏品详情
|
||||
Map<String, Object> map = nftPhotoService.getNftPhotoUrl(openid);
|
||||
int status = (int)map.get("status");
|
||||
String name = (String) map.get("name");
|
||||
if(status == 1 ){
|
||||
name = String.format("https://cdn.xglpa.com/pars-nft/directional200/%s.png",name);
|
||||
}else if(status == 2){
|
||||
name = String.format("https://cdn.xglpa.com/pars-nft/scene200/%s.png",name);
|
||||
}else if(status == 3 ){
|
||||
name = String.format("https://cdn.xglpa.com/pars-nft/nonDirectional500/%s.png",name);
|
||||
if(map != null ){
|
||||
int status = (int)map.get("status");
|
||||
String url = (String) map.get("url");
|
||||
if(status == 1 ){
|
||||
url = String.format("https://cdn.xglpa.com/pars-nft/directional200/%s.png",url);
|
||||
}else if(status == 2){
|
||||
url = String.format("https://cdn.xglpa.com/pars-nft/scene200/%s.png",url);
|
||||
}else if(status == 3 ){
|
||||
url = String.format("https://cdn.xglpa.com/pars-nft/nonDirectional500/%s.png",url);
|
||||
}
|
||||
map.remove("status");
|
||||
map.put("url",url);
|
||||
//获取数字藏品数量
|
||||
int count = nftPhotoService.getNftCount();
|
||||
map.put("count",count);
|
||||
return R.ok(map);
|
||||
}
|
||||
map.remove("status");
|
||||
map.put("name",name);
|
||||
return R.ok(map);
|
||||
return R.ok("openid不存在!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -47,6 +47,12 @@ public class UserController {
|
||||
log.error("openid为空:"+openid);
|
||||
return R.error("openid为空");
|
||||
}
|
||||
|
||||
if(StringUtils.isBlank(seed)){
|
||||
log.error("手机号不能为空!");
|
||||
return R.error("手机号不能为空!");
|
||||
}
|
||||
|
||||
if(StringUtils.isBlank(code)){
|
||||
log.error("验证码不能为空!");
|
||||
return R.error("验证码不能为空!");
|
||||
@ -58,15 +64,27 @@ public class UserController {
|
||||
}
|
||||
String s = redisUtil.get(openidCode + openid).toString();
|
||||
if(s.equals(code)){
|
||||
String replace = seed.replaceAll(" ", "");
|
||||
replace = replace.replaceAll("-", "");
|
||||
replace = replace.substring(4);
|
||||
//用户绑定手机号
|
||||
userService.addPhone(seed,openid);
|
||||
R r = userService.addPhone(replace, openid);
|
||||
if("手机号已被用户绑定!".equals(r.get("msg"))){
|
||||
return r;
|
||||
}
|
||||
//用户绑定NFT图片Hash值
|
||||
nftPhotoService.addPhonePaintingHash(openid,seed,flag);
|
||||
nftPhotoService.addPhonePaintingHash(openid, replace, flag);
|
||||
//获取图片类型
|
||||
String status = nftPhotoService.getStatus(openid);
|
||||
return R.ok(status);
|
||||
}else {
|
||||
return R.error("验证码错误或者已过期!");
|
||||
}
|
||||
|
||||
return R.ok();
|
||||
// Long parseInt = Long.parseLong(seed);
|
||||
// for (int i = 0; i < 10; i++) {
|
||||
// ++ parseInt;
|
||||
// nftPhotoService.addPhonePaintingHash(openid,parseInt+"",flag);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -87,6 +105,16 @@ public class UserController {
|
||||
//手机号已绑定
|
||||
map.remove("name");
|
||||
map.put("flag",true);
|
||||
int status = (int)map.get("status");
|
||||
String url = (String) map.get("url");
|
||||
if(status == 1 ){
|
||||
url = String.format("https://cdn.xglpa.com/pars-nft/directional200/%s.png",url);
|
||||
}else if(status == 2){
|
||||
url = String.format("https://cdn.xglpa.com/pars-nft/scene200/%s.png",url);
|
||||
}else if(status == 3 ){
|
||||
url = String.format("https://cdn.xglpa.com/pars-nft/nonDirectional500/%s.png",url);
|
||||
}
|
||||
map.put("url",url);
|
||||
return R.ok(map);
|
||||
}else {
|
||||
//手机号未绑定
|
||||
|
||||
@ -45,12 +45,12 @@ public class VerificationCodeController {
|
||||
//获取验证码
|
||||
String code = Integer.toString(AliyunSmsUtils.getNewcode());
|
||||
log.info("发送的验证码为:"+code);
|
||||
try {
|
||||
//使用阿里云发送短信
|
||||
AliyunSmsUtils.sendSms(seed,code);
|
||||
} catch (ClientException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// try {
|
||||
// //使用阿里云发送短信
|
||||
// AliyunSmsUtils.sendSms(seed,code);
|
||||
// } catch (ClientException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//把验证码存入redis中
|
||||
redisUtil.set(openidCode + openid, code, 300);
|
||||
return R.ok(code);
|
||||
|
||||
@ -17,4 +17,9 @@ public interface NftPhotoMapper extends BaseMapper<NftPhotoDO> {
|
||||
Map<String,Object> getNftPhotoUrl(String openid);
|
||||
|
||||
Map<String, Object> getPhoneAndHash(String openid);
|
||||
|
||||
int getNftCount();
|
||||
|
||||
String getStatus(String openid);
|
||||
|
||||
}
|
||||
|
||||
@ -13,4 +13,8 @@ public interface NftPhotoService {
|
||||
Map<String,Object> getNftPhotoUrl(String seed);
|
||||
|
||||
Map<String, Object> getPhoneAndHash(String openid);
|
||||
|
||||
int getNftCount();
|
||||
|
||||
String getStatus(String openid);
|
||||
}
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
package com.szxgl.nft.service;
|
||||
|
||||
|
||||
|
||||
public interface UserNftPhotoService {
|
||||
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.szxgl.nft.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.szxgl.nft.entity.NftPhotoDO;
|
||||
import com.szxgl.nft.entity.UserNftPhoto;
|
||||
import com.szxgl.nft.mapper.NftPhotoMapper;
|
||||
import com.szxgl.nft.mapper.UserNftPhotoMapper;
|
||||
@ -38,7 +39,7 @@ public class NftPhotoServiceImpl implements NftPhotoService {
|
||||
//库存充裕
|
||||
if(id != null ){
|
||||
//图片绑定手机号
|
||||
nftPhotoMapper.addNftPhoto(id,seed);
|
||||
nftPhotoMapper.addNftPhoto(id, seed);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -53,4 +54,14 @@ public class NftPhotoServiceImpl implements NftPhotoService {
|
||||
return nftPhotoMapper.getPhoneAndHash(openid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNftCount() {
|
||||
return nftPhotoMapper.getNftCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatus(String openid) {
|
||||
return nftPhotoMapper.getStatus(openid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
package com.szxgl.nft.service.impl;
|
||||
|
||||
import com.szxgl.nft.service.UserNftPhotoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class UserNftPhotoServiceImpl implements UserNftPhotoService {
|
||||
|
||||
}
|
||||
@ -23,8 +23,8 @@ public class AliyunSmsUtils {
|
||||
static final String domain = "dysmsapi.aliyuncs.com";
|
||||
|
||||
// TODO 此处需要替换成开发者自己的AK(在阿里云访问控制台寻找)
|
||||
static final String accessKeyId = "LTAI4G88mJUn3YzWo2eFmxVG"; // TODO 修改成自己的
|
||||
static final String accessKeySecret = "iWNQskqvXC7Rm0au2W2u3AGNFEgYMl"; // TODO 修改成自己的
|
||||
static final String accessKeyId = "LTAI5t5pjd39ax3ALioZ3DaL"; // TODO 修改成自己的
|
||||
static final String accessKeySecret = "lHCd5tYCcF7WW8GVMxjH8v5TcuxOZi"; // TODO 修改成自己的
|
||||
|
||||
public static SendSmsResponse sendSms(String telephone, String code) throws ClientException {
|
||||
//可自助调整超时时间
|
||||
@ -39,7 +39,7 @@ public class AliyunSmsUtils {
|
||||
//必填:待发送手机号
|
||||
request.setPhoneNumbers(telephone);
|
||||
//必填:短信签名-可在短信控制台中找到
|
||||
request.setSignName("工银安盛人寿"); // TODO 修改成自己的
|
||||
request.setSignName("平安银行"); // TODO 修改成自己的
|
||||
|
||||
//国内手机正则
|
||||
String regex = "[1][3-9]\\d{9}";
|
||||
@ -47,11 +47,11 @@ public class AliyunSmsUtils {
|
||||
if(matches){
|
||||
//必填:短信模板-可在短信控制台中找到
|
||||
//国内短信模板
|
||||
request.setTemplateCode("SMS_207745889"); // TODO 修改成自己的
|
||||
request.setTemplateCode("SMS_235481516"); // TODO 修改成自己的
|
||||
}else {
|
||||
//必填:短信模板-可在短信控制台中找到
|
||||
//国际/港澳台短信模板
|
||||
request.setTemplateCode("SMS_234409577"); // TODO 修改成自己的
|
||||
request.setTemplateCode("SMS_235476609"); // TODO 修改成自己的
|
||||
}
|
||||
|
||||
//可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
|
||||
@ -108,7 +108,7 @@ public class AliyunSmsUtils {
|
||||
return newcode;
|
||||
}
|
||||
public static void setNewcode(){
|
||||
newcode = (int)(Math.random()*9999)+100; //每次调用生成一位四位数的随机数
|
||||
newcode = (int)((Math.random()*9+1)*1000); //每次调用生成一位四位数的随机数
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ public class AliyunSmsUtils {
|
||||
String code = Integer.toString(getNewcode());
|
||||
System.out.println("发送的验证码为:"+code);
|
||||
//发短信
|
||||
SendSmsResponse response =sendSms("67898745",code); // TODO 填写你需要测试的手机号码
|
||||
SendSmsResponse response =sendSms("15027052382",code); // TODO 填写你需要测试的手机号码
|
||||
System.out.println("短信接口返回的数据----------------");
|
||||
System.out.println("Code=" + response.getCode());
|
||||
System.out.println("Message=" + response.getMessage());
|
||||
|
||||
@ -58,9 +58,14 @@ public class R extends HashMap<String, Object> {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// String phone = encrypt("15023451234");
|
||||
// System.out.println(phone);
|
||||
System.out.println(AliyunSmsUtils.getNewcode());
|
||||
String phone = encrypt("15023451234");
|
||||
System.out.println(phone);
|
||||
String s = "+852- 37123594";
|
||||
String replace = s.replaceAll(" ", "");
|
||||
replace = replace.replaceAll("-", "");
|
||||
System.out.println(replace);
|
||||
System.out.println(replace.substring(4));
|
||||
|
||||
}
|
||||
|
||||
//字符串加密
|
||||
|
||||
@ -35,6 +35,7 @@ spring:
|
||||
multipart:
|
||||
max-file-size: 500MB
|
||||
max-request-size: 500MB
|
||||
|
||||
redis:
|
||||
database: 0
|
||||
host: r-wz97jov3cc4roi3b1ppd.redis.rds.aliyuncs.com
|
||||
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -7,7 +7,7 @@
|
||||
np.id
|
||||
FROM
|
||||
user_nft_photo up
|
||||
RIGHT JOIN nft_photo np ON up.nft_photo_id = np.id
|
||||
RIGHT JOIN nft_photo np ON up.nft_photo_id = np.id
|
||||
WHERE
|
||||
( LENGTH( up.phone ) = 0 OR up.phone IS NULL )
|
||||
AND np.STATUS = #{flag}
|
||||
@ -37,13 +37,16 @@
|
||||
|
||||
<select id="getNftPhotoUrl" resultType="java.util.Map">
|
||||
SELECT
|
||||
np.`name`,
|
||||
np.`name` as url,
|
||||
np.painting_hash,
|
||||
np.status,
|
||||
u.wallet_addr
|
||||
u.nickname,
|
||||
u.wallet_addr,
|
||||
u.phone
|
||||
FROM
|
||||
nft_photo np
|
||||
INNER JOIN user_nft_photo up ON np.id = up.nft_photo_id
|
||||
INNER JOIN `user` u ON up.phone = u.phone
|
||||
INNER JOIN user_nft_photo up ON np.id = up.nft_photo_id
|
||||
INNER JOIN `user` u ON up.phone = u.phone
|
||||
where u.openid = #{openid}
|
||||
</select>
|
||||
|
||||
@ -58,4 +61,24 @@
|
||||
where u.openid = #{openid}
|
||||
</select>
|
||||
|
||||
<select id="getNftCount" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count( np.id )
|
||||
FROM
|
||||
nft_photo np
|
||||
LEFT JOIN user_nft_photo unp ON np.id = unp.nft_photo_id
|
||||
WHERE
|
||||
unp.id IS NULL
|
||||
</select>
|
||||
|
||||
<select id="getStatus" resultType="java.lang.String">
|
||||
SELECT
|
||||
np.status
|
||||
FROM
|
||||
nft_photo np
|
||||
INNER JOIN user_nft_photo up ON np.id = up.nft_photo_id
|
||||
INNER JOIN `user` u ON up.phone = u.phone
|
||||
where u.openid = #{openid}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||