Browse Source

Merge branch 'dev'

xiongzhu 4 years ago
parent
commit
d6115238d2

+ 2 - 2
src/main/comos/.env.development

@@ -1,6 +1,6 @@
-VUE_APP_BASE_URL=https://nft.9space.vip/
+VUE_APP_BASE_URL=https://nfttest.9space.vip/
 NODE_ENV=development
 NODE_ENV=development
-PUBLIC_PATH=/
+VUE_APP_PUBLIC_PATH=/
 ASSETS_PATH=raex
 ASSETS_PATH=raex
 TITLE=Cosmos Art
 TITLE=Cosmos Art
 VUE_APP_PAGE_TYPE=raex
 VUE_APP_PAGE_TYPE=raex

+ 1 - 1
src/main/comos/.env.production

@@ -1,6 +1,6 @@
 VUE_APP_BASE_URL=/
 VUE_APP_BASE_URL=/
 NODE_ENV=production
 NODE_ENV=production
-PUBLIC_PATH=/cosmos/
+VUE_APP_PUBLIC_PATH=/cosmos/
 ASSETS_PATH=raex
 ASSETS_PATH=raex
 TITLE=Cosmos Art
 TITLE=Cosmos Art
 VUE_APP_PAGE_TYPE=raex
 VUE_APP_PAGE_TYPE=raex

+ 2 - 0
src/main/comos/package.json

@@ -12,6 +12,7 @@
         "@better-scroll/core": "^2.4.2",
         "@better-scroll/core": "^2.4.2",
         "@chenfengyuan/vue-qrcode": "^2.0.0-rc.1",
         "@chenfengyuan/vue-qrcode": "^2.0.0-rc.1",
         "@vant/area-data": "^1.1.3",
         "@vant/area-data": "^1.1.3",
+        "ali-oss": "^6.17.1",
         "axios": "^0.21.4",
         "axios": "^0.21.4",
         "better-scroll": "^2.4.2",
         "better-scroll": "^2.4.2",
         "clipboard": "^2.0.8",
         "clipboard": "^2.0.8",
@@ -27,6 +28,7 @@
         "mitt": "^3.0.0",
         "mitt": "^3.0.0",
         "qrcode": "^1.4.4",
         "qrcode": "^1.4.4",
         "query-string": "^7.0.1",
         "query-string": "^7.0.1",
+        "queue": "^6.0.2",
         "register-service-worker": "^1.7.1",
         "register-service-worker": "^1.7.1",
         "swiper": "^6.8.1",
         "swiper": "^6.8.1",
         "three": "^0.136.0",
         "three": "^0.136.0",

BIN
src/main/comos/src/assets/share2.jpg


BIN
src/main/comos/src/assets/share2.png


+ 4 - 1
src/main/comos/src/router/index.js

@@ -498,7 +498,10 @@ const routes = [
 ];
 ];
 
 
 const router = createRouter({
 const router = createRouter({
-    history: process.env.VUE_APP_CORDOVA === 'true' ? createWebHashHistory() : createWebHistory(process.env.BASE_URL),
+    history:
+        process.env.VUE_APP_CORDOVA === 'true'
+            ? createWebHashHistory()
+            : createWebHistory(process.env.VUE_APP_PUBLIC_PATH),
     routes,
     routes,
     scrollBehavior(to, from, savedPosition) {
     scrollBehavior(to, from, savedPosition) {
         return { x: 0, y: 0 };
         return { x: 0, y: 0 };

+ 2 - 1
src/main/comos/src/styles/app.less

@@ -208,5 +208,6 @@ input:-webkit-autofill {
 }
 }
 
 
 .page-detail img {
 .page-detail img {
-    width: 100%;
+    width: 100% !important;
+    height: auto !important;
 }
 }

+ 1 - 1
src/main/comos/src/views/account/Register.vue

@@ -173,7 +173,7 @@ export default {
                 .then(() => {
                 .then(() => {
                     this.$toast.success('注册成功');
                     this.$toast.success('注册成功');
                     setTimeout(() => {
                     setTimeout(() => {
-                        this.$router.back();
+                        this.$router.replace('/home');
                     }, 1500);
                     }, 1500);
                 })
                 })
                 .catch(e => {
                 .catch(e => {

+ 32 - 9
src/main/comos/src/views/user/Share.vue

@@ -38,19 +38,19 @@
         </div>
         </div>
 
 
         <div class="tips">
         <div class="tips">
-            活动规则<br />
-            1.邀请5位好友可获得平台空投稀有数字藏品<br />
-            2.在活动期间,参与活动的用户(以下称用“用户”“您”) 每邀请一位新用户(“新用户”系指从未注册过“第九空
-            间”的用户,是否为新用户以平台判断为准),在注册当 日绑定您的邀请码,在三个工作日后您可获得平台空投。
+            活动规则:<br />
+            1、活动期间内,成功邀请10名注册Cosmos
+            Art平台并且完成实名认证即有机会获得《30w就这?纪念徽章-铜卡》数字藏品卡1张,限量1921份,送完即止;<br />
+            2、活动期间内,累计邀请20名新用户注册并且完成实名认证将有机会获得“莫斯马克米奇”数字藏品空投一张(奖励于“莫斯马克米奇”首次发售后5个小时内空投至用户藏品室),限量500份,送完即止;<br />
+            3、活动期间累计邀请注册且完成实名认证的用户数量排名前十的收藏师将额外获得惊喜奖励。<br />
         </div>
         </div>
 
 
         <van-overlay :show="show" @click="show = false">
         <van-overlay :show="show" @click="show = false">
             <div class="wrapper">
             <div class="wrapper">
                 <img :src="img" class="wrapper-img" v-if="img" alt="" />
                 <img :src="img" class="wrapper-img" v-if="img" alt="" />
                 <div class="wrapper-box" v-else ref="post" @click.stop>
                 <div class="wrapper-box" v-else ref="post" @click.stop>
-                    <img class="share2" src="../../assets/share2.jpg" alt="" />
+                    <img class="share2" :src="shareBg" alt="" />
                     <vue-qrcode :value="url" :options="{ width: 70, margin: 3 }" class="share-code"></vue-qrcode>
                     <vue-qrcode :value="url" :options="{ width: 70, margin: 3 }" class="share-code"></vue-qrcode>
-                    <div class="title">国内领先的泛文娱数字藏品集换平台</div>
                 </div>
                 </div>
 
 
                 <img src="../../assets/close.png" alt="" class="close" />
                 <img src="../../assets/close.png" alt="" class="close" />
@@ -77,9 +77,13 @@ export default {
     data() {
     data() {
         return {
         return {
             show: false,
             show: false,
-            img: ''
+            img: '',
+            shareBg: ''
         };
         };
     },
     },
+    mounted() {
+        this.getImgBase64(require('../../assets/share2.png'), 'shareBg');
+    },
     methods: {
     methods: {
         share() {
         share() {
             this.show = true;
             this.show = true;
@@ -103,6 +107,25 @@ export default {
                 this.$toast.clear();
                 this.$toast.clear();
                 this.img = canvas.toDataURL('image/png');
                 this.img = canvas.toDataURL('image/png');
             });
             });
+        },
+        getImgBase64(img2, key) {
+            let img = new Image();
+            img.crossOrigin = 'anonymous';
+            let _this = this;
+            img.onload = function () {
+                let src = _this.image2Base64(img);
+                _this[key] = src;
+            };
+            img.src = img2;
+        },
+        image2Base64(img) {
+            let canvas = document.createElement('canvas');
+            canvas.width = img.width;
+            canvas.height = img.height;
+            let ctx = canvas.getContext('2d');
+            ctx.drawImage(img, 0, 0, img.width, img.height);
+            let dataURL = canvas.toDataURL('image/png');
+            return dataURL;
         }
         }
     }
     }
 };
 };
@@ -223,12 +246,12 @@ export default {
 }
 }
 .share2 {
 .share2 {
     width: 300px;
     width: 300px;
-    height: 364px;
+    height: auto;
     display: block;
     display: block;
 }
 }
 .share-code {
 .share-code {
     position: absolute;
     position: absolute;
-    bottom: 52px;
+    bottom: 8px;
     right: 7px;
     right: 7px;
     border-radius: 6px;
     border-radius: 6px;
 }
 }

+ 46 - 0
src/main/comos/upload.js

@@ -0,0 +1,46 @@
+const OSS = require('ali-oss');
+const queue = require('queue');
+const fs = require('fs');
+const path = require('path');
+
+let client = new OSS({
+    region: 'oss-cn-shenzhen',
+    accessKeyId: 'LTAI5tCtRs8DXBLBsn49qRZX',
+    accessKeySecret: '86uC18LZsfB9JU04BK7ImVXfOytEkG',
+    bucket: '9space-2021'
+});
+
+class UploadCDNPlugin {
+    constructor(basePath) {
+        this.basePath = basePath + '/';
+    }
+    // Define `apply` as its prototype method which is supplied with compiler as its argument
+    apply(compiler) {
+        compiler.hooks.done.tapAsync('UploadPlugin', (stats, callback) => {
+            let basePath = this.basePath;
+            const q = queue({ results: [], concurrency: 16 });
+            function uploadDir(dir) {
+                fs.readdirSync(dir).forEach(child => {
+                    if (/^\./.test(child)) return;
+                    let file = path.resolve(dir, child);
+                    let stat = fs.statSync(file);
+                    if (stat.isDirectory()) {
+                        uploadDir(file);
+                    } else {
+                        q.push(async cb => {
+                            let relpath = path.relative(path.resolve(__dirname, 'dist'), file);
+                            const result = await client.put(path.normalize(basePath + relpath), file);
+                            console.log(result);
+                            cb();
+                        });
+                    }
+                });
+            }
+            uploadDir(path.resolve(__dirname, 'dist'));
+            q.start(() => {
+                callback();
+            });
+        });
+    }
+}
+module.exports = UploadCDNPlugin;

+ 18 - 1
src/main/comos/vue.config.js

@@ -1,6 +1,20 @@
 const path = require('path');
 const path = require('path');
+const fs = require('fs');
+const UploadPlugin = require('./upload');
+let publicPath;
+switch (process.env.NODE_ENV) {
+    case 'development':
+        publicPath = '/';
+        break;
+    case 'production':
+        publicPath = `https://cosmoscdn.9space.vip/www/` + new Date().getTime();
+        break;
+    case 'test':
+        publicPath = `https://cosmoscdn.9space.vip/www_test/` + new Date().getTime();
+        break;
+}
 module.exports = {
 module.exports = {
-    publicPath: process.env.PUBLIC_PATH || '/',
+    publicPath: publicPath,
     devServer: {
     devServer: {
         port: 8081,
         port: 8081,
         disableHostCheck: true
         disableHostCheck: true
@@ -12,6 +26,9 @@ module.exports = {
         }
         }
     },
     },
     chainWebpack: config => {
     chainWebpack: config => {
+        if (process.env.NODE_ENV === 'production') {
+            config.plugin('upload').use(new UploadPlugin(publicPath.replace('https://cosmoscdn.9space.vip/', '')));
+        }
         config.output.filename('[name].[hash].js').end();
         config.output.filename('[name].[hash].js').end();
         config.resolve.alias.set('@assets', path.resolve(__dirname, 'src', 'assets'));
         config.resolve.alias.set('@assets', path.resolve(__dirname, 'src', 'assets'));
         config.plugin('html').tap(args => {
         config.plugin('html').tap(args => {

File diff suppressed because it is too large
+ 487 - 19
src/main/comos/yarn.lock


+ 3 - 0
src/main/java/com/izouma/nineth/repo/AssetRepo.java

@@ -72,4 +72,7 @@ public interface AssetRepo extends JpaRepository<Asset, Long>, JpaSpecificationE
     int updateCDN(Long id, String pic, String model3d, String minterAvatar,
     int updateCDN(Long id, String pic, String model3d, String minterAvatar,
                   String ownerAvatar, String detail);
                   String ownerAvatar, String detail);
 
 
+    List<Asset> findByStatusIn(Iterable<AssetStatus> statuses);
+
+    List<Asset> findByFromAssetId(Long id);
 }
 }

+ 2 - 0
src/main/java/com/izouma/nineth/repo/GiftOrderRepo.java

@@ -20,4 +20,6 @@ public interface GiftOrderRepo extends JpaRepository<GiftOrder, Long>, JpaSpecif
     void softDelete(Long id);
     void softDelete(Long id);
 
 
     GiftOrder findByTransactionId(String txId);
     GiftOrder findByTransactionId(String txId);
+
+    List<GiftOrder> findByAssetIdAndStatusIn(Long assetId, Iterable<OrderStatus> statuses);
 }
 }

+ 2 - 0
src/main/java/com/izouma/nineth/repo/OrderRepo.java

@@ -35,4 +35,6 @@ public interface OrderRepo extends JpaRepository<Order, Long>, JpaSpecificationE
     long countSales(Long userId);
     long countSales(Long userId);
 
 
     Order findByTransactionId(String txId);
     Order findByTransactionId(String txId);
+
+    List<Order> findByAssetIdAndStatusIn(Long assetId, Iterable<OrderStatus> statuses);
 }
 }

+ 25 - 13
src/main/java/com/izouma/nineth/service/AdapayMerchantService.java

@@ -12,6 +12,8 @@ import com.izouma.nineth.config.GeneralProperties;
 import com.izouma.nineth.domain.AdapayMerchant;
 import com.izouma.nineth.domain.AdapayMerchant;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.adapay.MemberInfo;
 import com.izouma.nineth.dto.adapay.MemberInfo;
+import com.izouma.nineth.dto.adapay.PaymentItem;
+import com.izouma.nineth.dto.adapay.PaymentList;
 import com.izouma.nineth.dto.adapay.SettleAccountsItem;
 import com.izouma.nineth.dto.adapay.SettleAccountsItem;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.repo.AdapayMerchantRepo;
 import com.izouma.nineth.repo.AdapayMerchantRepo;
@@ -249,24 +251,34 @@ public class AdapayMerchantService {
 
 
     public Object query(Long merchantId, String id) throws BaseAdaPayException {
     public Object query(Long merchantId, String id) throws BaseAdaPayException {
         AdapayMerchant merchant = adapayMerchantRepo.findById(merchantId).orElseThrow(new BusinessException("商户不存在"));
         AdapayMerchant merchant = adapayMerchantRepo.findById(merchantId).orElseThrow(new BusinessException("商户不存在"));
-        Map<String, Object> map = Payment.query(id, merchant.getName());
-        log.info(JSON.toJSONString(map, SerializerFeature.PrettyFormat));
-        return map;
+        Map<String, Object> paymentParams = new HashMap<>();
+        paymentParams.put("app_id", merchant.getAppId());
+        paymentParams.put("payment_id", id);
+        Map<String, Object> paymentList = Payment.queryList(paymentParams, merchant.getName());
+        log.info(JSON.toJSONString(paymentList, SerializerFeature.PrettyFormat));
+        return paymentList;
     }
     }
 
 
     public Object refund(Long merchantId, String id) throws BaseAdaPayException {
     public Object refund(Long merchantId, String id) throws BaseAdaPayException {
         AdapayMerchant merchant = adapayMerchantRepo.findById(merchantId).orElseThrow(new BusinessException("商户不存在"));
         AdapayMerchant merchant = adapayMerchantRepo.findById(merchantId).orElseThrow(new BusinessException("商户不存在"));
-        Map<String, Object> map = Payment.query(id, merchant.getName());
-        if (!"succeeded".equals(MapUtils.getString(map, "status"))) {
-            return map;
+
+        Map<String, Object> paymentParams = new HashMap<>();
+        paymentParams.put("app_id", merchant.getAppId());
+        paymentParams.put("payment_id", id);
+        Map<String, Object> res = Payment.queryList(paymentParams, merchant.getName());
+        log.info(JSON.toJSONString(res, SerializerFeature.PrettyFormat));
+        PaymentList paymentList = JSON.parseObject(JSON.toJSONString(res), PaymentList.class);
+
+        if (paymentList.getPayments() != null && paymentList.getPayments().size() == 1) {
+            PaymentItem paymentItem = paymentList.getPayments().get(0);
+            Map<String, Object> refundParams = new HashMap<>();
+            refundParams.put("refund_amt", paymentItem.getPayAmt());
+            refundParams.put("refund_order_no", new SnowflakeIdWorker(0, 0).nextId() + "");
+            Map<String, Object> response = Refund.create(id, refundParams, merchant.getName());
+            log.info(JSON.toJSONString(response, SerializerFeature.PrettyFormat));
+            return response;
         }
         }
-        String amt = MapUtils.getString(map, "pay_amt");
-        Map<String, Object> refundParams = new HashMap<>();
-        refundParams.put("refund_amt", amt);
-        refundParams.put("refund_order_no", new SnowflakeIdWorker(0, 0).nextId() + "");
-        Map<String, Object> response = Refund.create(id, refundParams, merchant.getName());
-        log.info(JSON.toJSONString(response, SerializerFeature.PrettyFormat));
-        return response;
+        return res;
     }
     }
 
 
     public static void checkSuccess(Map<String, Object> map) {
     public static void checkSuccess(Map<String, Object> map) {

+ 17 - 0
src/main/java/com/izouma/nineth/service/IdentityAuthService.java

@@ -1,5 +1,7 @@
 package com.izouma.nineth.service;
 package com.izouma.nineth.service;
 
 
+import com.alibaba.fastjson.JSONObject;
+import com.github.kevinsawicki.http.HttpRequest;
 import com.izouma.nineth.domain.AirDrop;
 import com.izouma.nineth.domain.AirDrop;
 import com.izouma.nineth.domain.IdentityAuth;
 import com.izouma.nineth.domain.IdentityAuth;
 import com.izouma.nineth.domain.User;
 import com.izouma.nineth.domain.User;
@@ -81,4 +83,19 @@ public class IdentityAuthService {
         auth.setStatus(status);
         auth.setStatus(status);
         identityAuthRepo.save(auth);
         identityAuthRepo.save(auth);
     }
     }
+
+    public void validate(String name, String phone, String idno) {
+        String body = HttpRequest.post("https://jubrige.market.alicloudapi.com/mobile/3-validate-transfer")
+                .header("Authorization", "APPCODE b48bc8f6759345a79ae20a951f03dabe")
+                .contentType(HttpRequest.CONTENT_TYPE_FORM)
+                .form("idCardNo", idno)
+                .form("mobile", phone)
+                .form("name", name)
+                .body();
+        JSONObject jsonObject = JSONObject.parseObject(body);
+        if (jsonObject.getInteger("code") != 200) {
+            String msg = jsonObject.getString("msg");
+            throw new BusinessException(msg);
+        }
+    }
 }
 }

+ 1 - 1
src/main/nine-space/.env.app

@@ -1,6 +1,6 @@
 VUE_APP_BASE_URL=https://nft.9space.vip
 VUE_APP_BASE_URL=https://nft.9space.vip
 NODE_ENV=production
 NODE_ENV=production
-PUBLIC_PATH=./
+VUE_APP_PUBLIC_PATH=./
 ASSETS_PATH=9th
 ASSETS_PATH=9th
 TITLE=第九空间
 TITLE=第九空间
 VUE_APP_CORDOVA=true
 VUE_APP_CORDOVA=true

+ 1 - 1
src/main/nine-space/.env.development

@@ -1,6 +1,6 @@
 VUE_APP_BASE_URL=https://nfttest.9space.vip/
 VUE_APP_BASE_URL=https://nfttest.9space.vip/
 NODE_ENV=development
 NODE_ENV=development
-PUBLIC_PATH=/
+VUE_APP_PUBLIC_PATH=/
 ASSETS_PATH=9th
 ASSETS_PATH=9th
 TITLE=第九空间
 TITLE=第九空间
 VUE_APP_PAGE_TYPE=9th
 VUE_APP_PAGE_TYPE=9th

+ 1 - 1
src/main/nine-space/.env.production

@@ -1,6 +1,6 @@
 VUE_APP_BASE_URL=/
 VUE_APP_BASE_URL=/
 NODE_ENV=production
 NODE_ENV=production
-PUBLIC_PATH=/9th/
+VUE_APP_PUBLIC_PATH=/9th/
 ASSETS_PATH=9th
 ASSETS_PATH=9th
 TITLE=第九空间
 TITLE=第九空间
 VUE_APP_PAGE_TYPE=9th
 VUE_APP_PAGE_TYPE=9th

+ 2 - 0
src/main/nine-space/package.json

@@ -12,6 +12,7 @@
         "@better-scroll/core": "^2.4.2",
         "@better-scroll/core": "^2.4.2",
         "@chenfengyuan/vue-qrcode": "^2.0.0-rc.1",
         "@chenfengyuan/vue-qrcode": "^2.0.0-rc.1",
         "@vant/area-data": "^1.1.3",
         "@vant/area-data": "^1.1.3",
+        "ali-oss": "^6.17.1",
         "axios": "^0.21.4",
         "axios": "^0.21.4",
         "better-scroll": "^2.4.2",
         "better-scroll": "^2.4.2",
         "clipboard": "^2.0.8",
         "clipboard": "^2.0.8",
@@ -25,6 +26,7 @@
         "mathjs": "^9.5.1",
         "mathjs": "^9.5.1",
         "qrcode": "^1.4.4",
         "qrcode": "^1.4.4",
         "query-string": "^7.0.1",
         "query-string": "^7.0.1",
+        "queue": "^6.0.2",
         "register-service-worker": "^1.7.1",
         "register-service-worker": "^1.7.1",
         "swiper": "^6.8.1",
         "swiper": "^6.8.1",
         "three": "^0.135.0",
         "three": "^0.135.0",

+ 4 - 1
src/main/nine-space/src/router/index.js

@@ -463,7 +463,10 @@ const routes = [
 ];
 ];
 
 
 const router = createRouter({
 const router = createRouter({
-    history: process.env.VUE_APP_CORDOVA === 'true' ? createWebHashHistory() : createWebHistory(process.env.BASE_URL),
+    history:
+        process.env.VUE_APP_CORDOVA === 'true'
+            ? createWebHashHistory()
+            : createWebHistory(process.env.VUE_APP_PUBLIC_PATH),
     routes,
     routes,
     scrollBehavior(to, from, savedPosition) {
     scrollBehavior(to, from, savedPosition) {
         return { x: 0, y: 0 };
         return { x: 0, y: 0 };

+ 46 - 0
src/main/nine-space/upload.js

@@ -0,0 +1,46 @@
+const OSS = require('ali-oss');
+const queue = require('queue');
+const fs = require('fs');
+const path = require('path');
+
+let client = new OSS({
+    region: 'oss-cn-shenzhen',
+    accessKeyId: 'LTAI5tCtRs8DXBLBsn49qRZX',
+    accessKeySecret: '86uC18LZsfB9JU04BK7ImVXfOytEkG',
+    bucket: '9space-2021'
+});
+
+class UploadCDNPlugin {
+    constructor(basePath) {
+        this.basePath = basePath + '/';
+    }
+    // Define `apply` as its prototype method which is supplied with compiler as its argument
+    apply(compiler) {
+        compiler.hooks.done.tapAsync('UploadPlugin', (stats, callback) => {
+            let basePath = this.basePath;
+            const q = queue({ results: [], concurrency: 16 });
+            function uploadDir(dir) {
+                fs.readdirSync(dir).forEach(child => {
+                    if (/^\./.test(child)) return;
+                    let file = path.resolve(dir, child);
+                    let stat = fs.statSync(file);
+                    if (stat.isDirectory()) {
+                        uploadDir(file);
+                    } else {
+                        q.push(async cb => {
+                            let relpath = path.relative(path.resolve(__dirname, 'dist'), file);
+                            const result = await client.put(path.normalize(basePath + relpath), file);
+                            console.log(result);
+                            cb();
+                        });
+                    }
+                });
+            }
+            uploadDir(path.resolve(__dirname, 'dist'));
+            q.start(() => {
+                callback();
+            });
+        });
+    }
+}
+module.exports = UploadCDNPlugin;

+ 18 - 1
src/main/nine-space/vue.config.js

@@ -1,6 +1,20 @@
 const path = require('path');
 const path = require('path');
+const fs = require('fs');
+const UploadPlugin = require('./upload');
+let publicPath;
+switch (process.env.NODE_ENV) {
+    case 'development':
+        publicPath = '/';
+        break;
+    case 'production':
+        publicPath = `https://cosmoscdn.9space.vip/www/` + new Date().getTime();
+        break;
+    case 'test':
+        publicPath = `https://cosmoscdn.9space.vip/www_test/` + new Date().getTime();
+        break;
+}
 module.exports = {
 module.exports = {
-    publicPath: process.env.PUBLIC_PATH || '/',
+    publicPath: publicPath,
     devServer: {
     devServer: {
         port: 8081,
         port: 8081,
         disableHostCheck: true
         disableHostCheck: true
@@ -12,6 +26,9 @@ module.exports = {
         }
         }
     },
     },
     chainWebpack: config => {
     chainWebpack: config => {
+        if (process.env.NODE_ENV === 'production') {
+            config.plugin('upload').use(new UploadPlugin(publicPath.replace('https://cosmoscdn.9space.vip/', '')));
+        }
         config.output.filename('[name].[hash].js').end();
         config.output.filename('[name].[hash].js').end();
         config.resolve.alias.set('@assets', path.resolve(__dirname, 'src', 'assets', process.env.ASSETS_PATH || '9th'));
         config.resolve.alias.set('@assets', path.resolve(__dirname, 'src', 'assets', process.env.ASSETS_PATH || '9th'));
         config.plugin('html').tap(args => {
         config.plugin('html').tap(args => {

File diff suppressed because it is too large
+ 487 - 19
src/main/nine-space/yarn.lock


+ 15 - 1
src/main/vue/src/views/UserList.vue

@@ -83,6 +83,7 @@
                 <el-table-column prop="nickname" label="昵称"></el-table-column>
                 <el-table-column prop="nickname" label="昵称"></el-table-column>
                 <el-table-column prop="phone" label="手机"></el-table-column>
                 <el-table-column prop="phone" label="手机"></el-table-column>
                 <el-table-column prop="createdAt" label="注册时间"></el-table-column>
                 <el-table-column prop="createdAt" label="注册时间"></el-table-column>
+                <el-table-column prop="authStatus" label="实名审核状态" :formatter="statusFormatter"></el-table-column>
             </el-table>
             </el-table>
         </el-dialog>
         </el-dialog>
     </div>
     </div>
@@ -103,7 +104,13 @@ export default {
             createdAt: '',
             createdAt: '',
             showDialog: false,
             showDialog: false,
             dialogLoading: false,
             dialogLoading: false,
-            list: []
+            list: [],
+            statusOptions: [
+                { label: '未认证', value: 'NOT_AUTH' },
+                { label: '认证中', value: 'PENDING' },
+                { label: '已认证', value: 'SUCCESS' },
+                { label: '失败', value: 'FAIL' }
+            ]
         };
         };
     },
     },
     computed: {
     computed: {
@@ -113,6 +120,13 @@ export default {
         }
         }
     },
     },
     methods: {
     methods: {
+        statusFormatter(row, column, cellValue, index) {
+            let selectedOption = this.statusOptions.find(i => i.value === cellValue);
+            if (selectedOption) {
+                return selectedOption.label;
+            }
+            return '';
+        },
         beforeGetData() {
         beforeGetData() {
             return { search: this.search, query: { createdAt: this.createdAt } };
             return { search: this.search, query: { createdAt: this.createdAt } };
         },
         },

+ 14 - 0
src/test/java/com/izouma/nineth/CommonTest.java

@@ -1,5 +1,6 @@
 package com.izouma.nineth;
 package com.izouma.nineth;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.github.kevinsawicki.http.HttpRequest;
 import com.github.kevinsawicki.http.HttpRequest;
 import com.izouma.nineth.config.Constants;
 import com.izouma.nineth.config.Constants;
 import com.izouma.nineth.domain.BaseEntity;
 import com.izouma.nineth.domain.BaseEntity;
@@ -373,6 +374,19 @@ public class CommonTest {
         if (matcher.matches()) {
         if (matcher.matches()) {
             System.out.println(matcher.group(2));
             System.out.println(matcher.group(2));
         }
         }
+    }
 
 
+    @Test
+    public void testValidate() {
+        String body = HttpRequest.post("http://jubrige.market.alicloudapi.com/mobile/3-validate-transfer")
+                .header("Authorization", "APPCODE b48bc8f6759345a79ae20a951f03dabe")
+                .contentType(HttpRequest.CONTENT_TYPE_FORM)
+                .form("idCardNo", "321002199408304614")
+                .form("mobile", "15077886171")
+                .form("name", "熊竹")
+                .body();
+
+        JSONObject jsonObject = JSONObject.parseObject(body);
+        System.out.println(jsonObject);
     }
     }
 }
 }

+ 48 - 0
src/test/java/com/izouma/nineth/service/AssetServiceTest.java

@@ -2,12 +2,15 @@ package com.izouma.nineth.service;
 
 
 import com.izouma.nineth.ApplicationTests;
 import com.izouma.nineth.ApplicationTests;
 import com.izouma.nineth.domain.*;
 import com.izouma.nineth.domain.*;
+import com.izouma.nineth.enums.AssetStatus;
+import com.izouma.nineth.enums.OrderStatus;
 import com.izouma.nineth.repo.*;
 import com.izouma.nineth.repo.*;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.util.Arrays;
 import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 class AssetServiceTest extends ApplicationTests {
 class AssetServiceTest extends ApplicationTests {
@@ -27,6 +30,8 @@ class AssetServiceTest extends ApplicationTests {
     private AssetMintService  assetMintService;
     private AssetMintService  assetMintService;
     @Autowired
     @Autowired
     private AssetRepo         assetRepo;
     private AssetRepo         assetRepo;
+    @Autowired
+    private GiftOrderRepo     giftOrderRepo;
 
 
     @Test
     @Test
     void createAsset() {
     void createAsset() {
@@ -88,4 +93,47 @@ class AssetServiceTest extends ApplicationTests {
 
 
     }
     }
 
 
+    @Test
+    public void fixstatus() {
+        List<Asset> assets = assetRepo.findByStatusIn(Arrays.asList(AssetStatus.GIFTING, AssetStatus.TRADING));
+        System.out.println(assets.size());
+        for (Asset asset : assets) {
+            if (asset.getCreatedAt().isAfter(LocalDateTime.of(2022, 3, 6, 0, 0, 0))) continue;
+            if (assetRepo.findByFromAssetId(asset.getId()).isEmpty()) {
+                if (asset.getStatus() == AssetStatus.GIFTING) {
+                    List<GiftOrder> list = giftOrderRepo.findByAssetIdAndStatusIn(asset.getId(), Arrays.asList(OrderStatus.PROCESSING, OrderStatus.FINISH));
+                    if (list.size() == 1) {
+                        System.out.println(asset.getId() + "," + list.get(0).getId());
+                        User user = userRepo.findById(list.get(0).getToUserId()).get();
+                        assetService.transfer(asset, asset.getPrice(), user, "转赠", null);
+                        try {
+                            Thread.sleep(500);
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
+                    } else {
+                        System.out.println("@" + asset.getId());
+                    }
+                } else {
+                    List<Order> list = orderRepo.findByAssetIdAndStatusIn(asset.getId(), Arrays.asList(OrderStatus.PROCESSING, OrderStatus.FINISH));
+                    if (list.size() == 1) {
+                        System.out.println(asset.getId() + "," + list.get(0).getId());
+                        Order order = list.get(0);
+                        User user = userRepo.findById(list.get(0).getUserId()).get();
+                        assetService.transfer(asset, order.getPrice(), user, "转让", order.getId());
+                        try {
+                            Thread.sleep(500);
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();
+                        }
+                    } else {
+                        System.out.println("#" + asset.getId());
+                    }
+                }
+            } else {
+                System.out.println("*" + asset.getId());
+            }
+        }
+    }
+
 }
 }

Some files were not shown because too many files changed in this diff