Parcourir la source

Merge branch 'master' of http://git.izouma.com/xiongzhu/raex_back into dev-meta

sunkean il y a 3 ans
Parent
commit
b3965639d4

+ 2 - 0
src/main/java/com/izouma/nineth/config/WebMvcConfig.java

@@ -41,6 +41,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
         registry.addResourceHandler("/admin/**").addResourceLocations("classpath:/static/admin/");
         registry.addResourceHandler("/files/**").addResourceLocations("file:" + localPath);
         registry.addResourceHandler("/MP_verify*").addResourceLocations("classpath:/");
+        registry.addResourceHandler("/u951658VPf.txt").addResourceLocations("classpath:/static/");
+        registry.addResourceHandler("/u9s1658vPf.txt").addResourceLocations("classpath:/static/");
     }
 
     @Bean

+ 3 - 0
src/main/java/com/izouma/nineth/domain/Coupon.java

@@ -44,4 +44,7 @@ public class Coupon extends BaseEntity {
 
     @Transient
     private List<GeneralDTO> collections;
+
+    @Column(columnDefinition = "bigint default 1 not null")
+    private Long companyId = 1L;
 }

+ 54 - 0
src/main/java/com/izouma/nineth/domain/UserDetail.java

@@ -0,0 +1,54 @@
+package com.izouma.nineth.domain;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Entity
+public class UserDetail extends BaseEntityNoID {
+
+    @ApiModelProperty("用户id")
+    @Id
+    private Long userId;
+
+    @ApiModelProperty("生日")
+    private String birthday;
+
+    @ApiModelProperty("性别")
+    private String sex;
+
+    @ApiModelProperty("职业")
+    private String occupation;
+
+    @ApiModelProperty("血型")
+    private String blood;
+
+    @ApiModelProperty("星座")
+    private String constellation;
+
+    @ApiModelProperty("邮箱")
+    private String mail;
+
+    @ApiModelProperty("家乡")
+    private String home;
+
+    @ApiModelProperty("学校")
+    private String school;
+
+    @ApiModelProperty("公司")
+    private String company;
+
+    @ApiModelProperty("个人签名")
+    private String autograph;
+
+}

+ 2 - 1
src/main/java/com/izouma/nineth/security/WebSecurityConfig.java

@@ -165,7 +165,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/asset/topTen").permitAll()
                 .antMatchers("/metaUser/internalTest").permitAll()
                 .antMatchers("/metaShowRoomAsset/**").permitAll()
-
+                .antMatchers("/u951658VPf.txt").permitAll()
+                .antMatchers("/u9s1658vPf.txt").permitAll()
                 // all other requests need to be authenticated
                 .anyRequest().authenticated().and()
                 // make sure we use stateless session; session won't be used to

+ 28 - 0
src/main/java/com/izouma/nineth/service/UserDetailService.java

@@ -0,0 +1,28 @@
+package com.izouma.nineth.service;
+
+import com.izouma.nineth.domain.UserDetail;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.repo.AssetRepo;
+import com.izouma.nineth.utils.JpaUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+@Service
+@AllArgsConstructor
+public class UserDetailService {
+
+//    private UserDetailRepo userDetailRepo;
+//    private AssetRepo assetRepo;
+//
+//    public Page<UserDetail> all(PageQuery pageQuery) {
+//        return userDetailRepo.findAll(JpaUtils.toSpecification(pageQuery, UserDetail.class), JpaUtils.toPageRequest(pageQuery));
+//    }
+
+//    public Map<String,Long> userHoldCount(Long userId) {
+//        //查询绿洲元宇宙建筑
+//        Long count = assetRepo.findDiscount()
+//    }
+}

+ 1 - 1
src/main/java/com/izouma/nineth/service/UserService.java

@@ -166,7 +166,7 @@ public class UserService {
         }
         if (StringUtils.isNotBlank(intro)) {
             if (!intro.equals(user.getIntro())) {
-                if (!contentAuditService.auditText(nickname)) {
+                if (!contentAuditService.auditText(intro)) {
                     throw new BusinessException("简介包含非法内容");
                 }
             }

+ 1 - 1
src/main/java/com/izouma/nineth/web/AirDropController.java

@@ -23,7 +23,7 @@ public class AirDropController extends BaseController {
     private AirDropService airDropService;
     private AirDropRepo    airDropRepo;
 
-    @PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasAnyRole('ADMIN', 'SAAS')")
     @PostMapping("/save")
     public AirDrop save(@RequestBody AirDrop record) {
         return airDropService.create(record);

+ 1 - 1
src/main/java/com/izouma/nineth/web/CouponController.java

@@ -28,7 +28,7 @@ public class CouponController extends BaseController {
     private CouponRepo     couponRepo;
     private CollectionRepo collectionRepo;
 
-    @PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasAnyRole('ADMIN','SAAS')")
     @PostMapping("/save")
     public Coupon save(@RequestBody Coupon record) {
         if (record.getId() != null) {

+ 1 - 1
src/main/java/com/izouma/nineth/web/UserController.java

@@ -242,7 +242,7 @@ public class UserController extends BaseController {
         return userService.searchByPhone(phone);
     }
 
-    @PreAuthorize("hasAnyRole('ADMIN', 'OPERATOR')")
+    @PreAuthorize("hasAnyRole('ADMIN', 'OPERATOR', 'SAAS')")
     @PostMapping("/searchByPhoneAdmin")
     public Map<String, Object> searchByPhoneAdmin(@RequestParam String phone) {
         return userService.searchByPhoneAdmin(phone);

+ 75 - 0
src/main/java/com/izouma/nineth/web/UserDetailController.java

@@ -0,0 +1,75 @@
+package com.izouma.nineth.web;
+
+import com.izouma.nineth.domain.UserDetail;
+import com.izouma.nineth.service.ContentAuditService;
+import com.izouma.nineth.service.UserDetailService;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.utils.ObjUtils;
+import com.izouma.nineth.utils.SecurityUtils;
+import com.izouma.nineth.utils.excel.ExcelUtils;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
+import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.security.core.Authentication;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+@RestController
+@RequestMapping("/userDetail")
+@AllArgsConstructor
+public class UserDetailController extends BaseController {
+//    private UserDetailService userDetailService;
+//    private UserDetailRepo userDetailRepo;
+//    private ContentAuditService contentAuditService;
+//
+//    //@PreAuthorize("hasRole('ADMIN')")
+//    @PostMapping("/save")
+//    public UserDetail save(@RequestBody UserDetail record) {
+//        Long currentUserId = SecurityUtils.getAuthenticatedUser().getId();
+//        if (currentUserId != record.getUserId()) {
+//            throw new BusinessException("当前修改用户与登录用户不一致");
+//        }
+//        if (StringUtils.isNotBlank(record.getAutograph())) {
+//            if (!contentAuditService.auditText(record.getAutograph())) {
+//                throw new BusinessException("简介包含非法内容");
+//            }
+//        }
+//        if (record.getUserId() != null) {
+//            UserDetail orig = userDetailRepo.findById(record.getUserId()).orElseThrow(new BusinessException("无记录"));
+//            ObjUtils.merge(orig, record);
+//            return userDetailRepo.save(orig);
+//        }
+//        return userDetailRepo.save(record);
+//    }
+//
+//
+//    //@PreAuthorize("hasRole('ADMIN')")
+//    @PostMapping("/all")
+//    public Page<UserDetail> all(@RequestBody PageQuery pageQuery) {
+//        return userDetailService.all(pageQuery);
+//    }
+//
+//    @GetMapping("/get/{id}")
+//    public UserDetail get(@PathVariable Long id) {
+//        return userDetailRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+//    }
+//
+//    @PostMapping("/del/{id}")
+//    public void del(@PathVariable Long id) {
+//        userDetailRepo.softDelete(id);
+//    }
+//
+//    @GetMapping("/excel")
+//    @ResponseBody
+//    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+//        List<UserDetail> data = all(pageQuery).getContent();
+//        ExcelUtils.export(response, data);
+//    }
+}
+

+ 50 - 0
src/main/resources/static/pc.html

@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>RAEX绿洲</title>
+    <script src="/static/js/jquery.min.js"></script>
+    <link href="/static/css/devices.min.css" rel="stylesheet" />
+    <style>
+      body,
+      html {
+        margin: 0;
+        padding: 0;
+        background-color: #f8f9f9;
+        height: 100%;
+        width: 100%;
+        font-family: -apple-system, SF UI Text, Arial, PingFang SC,
+          Hiragino Sans GB, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;
+      }
+
+      body {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+      }
+
+      .phone {
+        width: 500px;
+        height: calc(100% - 1px);
+        margin: 0;
+        padding: 0;
+      }
+
+      .phone iframe {
+        width: 100%;
+        height: 100%;
+        border: none;
+        outline: none;
+        display: block;
+      }
+    </style>
+  </head>
+
+  <body>
+    <div class="phone">
+      <iframe src="https://www.raex.vip/9th/home" frameborder="0"></iframe>
+    </div>
+  </body>
+</html>

+ 1 - 0
src/main/resources/static/u951658VPf.txt

@@ -0,0 +1 @@
+c093b42ff5429c47b4203f2736ba05c4

+ 1 - 0
src/main/resources/static/u9s1658vPf.txt

@@ -0,0 +1 @@
+c093b42ff5429c47b4203f2736ba05c4

+ 20 - 20
src/main/vue/src/views/Admin.vue

@@ -217,26 +217,26 @@ export default {
                                 root: false,
                                 active: true
                             },
-                            {
-                                id: '3410339',
-                                name: '空投',
-                                path: '/airDropList',
-                                icon: '',
-                                sort: 43,
-                                parent: '3410316',
-                                root: false,
-                                active: true
-                            },
-                            {
-                                id: '3410345',
-                                name: '兑换券',
-                                path: '/couponList',
-                                icon: '',
-                                sort: 44,
-                                parent: '3410316',
-                                root: false,
-                                active: true
-                            },
+                            // {
+                            //     id: '3410339',
+                            //     name: '空投',
+                            //     path: '/airDropList',
+                            //     icon: '',
+                            //     sort: 43,
+                            //     parent: '3410316',
+                            //     root: false,
+                            //     active: true
+                            // },
+                            // {
+                            //     id: '3410345',
+                            //     name: '兑换券',
+                            //     path: '/couponList',
+                            //     icon: '',
+                            //     sort: 44,
+                            //     parent: '3410316',
+                            //     root: false,
+                            //     active: true
+                            // },
                             {
                                 id: '3410399',
                                 name: '铸造者',

+ 1 - 1
src/main/vue/src/views/BlindBoxEdit.vue

@@ -220,7 +220,7 @@
                         <el-radio v-model="formData.noSoldOut" :label="false">是</el-radio>
                         <el-radio v-model="formData.noSoldOut" :label="true">否</el-radio>
                     </el-form-item>
-                    <el-form-item prop="couponPayment" label="支付方式" v-if="!isCompany">
+                    <el-form-item prop="couponPayment" label="支付方式">
                         <el-radio-group v-model="formData.couponPayment">
                             <el-radio :label="true">兑换券</el-radio>
                             <el-radio :label="false">支付宝/微信</el-radio>

+ 4 - 3
src/main/vue/src/views/CollectionEdit.vue

@@ -166,7 +166,7 @@
                             </el-input-number>
                         </el-form-item>
                         <el-form-item prop="serviceCharge" label="手续费(%)">
-                            <el-input-number v-model="formData.serviceCharge" :min="0" :max="99" :disabled="!canEdit">
+                            <el-input-number v-model="formData.serviceCharge" :min="0" :max="99" :disabled="!canEdit || isCompany">
                             </el-input-number>
                         </el-form-item>
                     </div>
@@ -266,7 +266,7 @@
                         <el-radio v-model="formData.noSoldOut" :label="false">是</el-radio>
                         <el-radio v-model="formData.noSoldOut" :label="true">否</el-radio>
                     </el-form-item>
-                    <el-form-item prop="couponPayment" label="支付方式" v-if="!isCompany">
+                    <el-form-item prop="couponPayment" label="支付方式">
                         <el-radio-group v-model="formData.couponPayment">
                             <el-radio :label="true">兑换券</el-radio>
                             <el-radio :label="false">支付宝/微信</el-radio>
@@ -480,7 +480,8 @@ export default {
                 couponPayment: false,
                 chainFlag: 3,
                 vip: false,
-                messNumber: false
+                messNumber: false,
+                serviceCharge: 5
             },
             rules: {
                 name: [