xiongzhu 3 years ago
parent
commit
81903f6ecf

+ 6 - 0
src/main/java/cn/licoy/encryptbody/advice/EncryptResponseBodyAdvice.java

@@ -14,6 +14,7 @@ import jodd.util.ReflectUtil;
 import lombok.SneakyThrows;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.core.MethodParameter;
 import org.springframework.core.MethodParameter;
 import org.springframework.core.annotation.Order;
 import org.springframework.core.annotation.Order;
 import org.springframework.http.MediaType;
 import org.springframework.http.MediaType;
@@ -48,6 +49,10 @@ public class EncryptResponseBodyAdvice implements ResponseBodyAdvice {
 
 
     private final EncryptBodyConfig config;
     private final EncryptBodyConfig config;
 
 
+    @Value("${encrypt.enable}")
+    private boolean enableEncrypt;
+
+
     @Autowired
     @Autowired
     public EncryptResponseBodyAdvice(ObjectMapper objectMapper, EncryptBodyConfig config) {
     public EncryptResponseBodyAdvice(ObjectMapper objectMapper, EncryptBodyConfig config) {
         this.objectMapper = objectMapper;
         this.objectMapper = objectMapper;
@@ -57,6 +62,7 @@ public class EncryptResponseBodyAdvice implements ResponseBodyAdvice {
 
 
     @Override
     @Override
     public boolean supports(MethodParameter returnType, Class converterType) {
     public boolean supports(MethodParameter returnType, Class converterType) {
+        if (!enableEncrypt) return false;
         Annotation[] annotations = returnType.getDeclaringClass().getAnnotations();
         Annotation[] annotations = returnType.getDeclaringClass().getAnnotations();
         if (annotations != null && annotations.length > 0) {
         if (annotations != null && annotations.length > 0) {
             for (Annotation annotation : annotations) {
             for (Annotation annotation : annotations) {

+ 1 - 0
src/main/java/com/izouma/jmrh/domain/OrgInfo.java

@@ -97,6 +97,7 @@ public class OrgInfo extends BaseEntity {
     private String attach;
     private String attach;
 
 
     @ApiModelProperty("用户ID")
     @ApiModelProperty("用户ID")
+    @Column(nullable = false)
     private Long userId;
     private Long userId;
 
 
     @ApiModelProperty("审核状态")
     @ApiModelProperty("审核状态")

+ 68 - 53
src/main/java/com/izouma/jmrh/service/UserService.java

@@ -50,14 +50,14 @@ public class UserService {
                 throw new BusinessException("该手机未注册");
                 throw new BusinessException("该手机未注册");
             }
             }
             user = userRepo.save(User.builder()
             user = userRepo.save(User.builder()
-                    .avatar(Constants.DEFAULT_AVATAR)
-                    .password(new BCryptPasswordEncoder().encode(password))
-                    .enabled(true)
-                    .phone(phone)
-                    .username(phone)
-                    .nickname(phone)
-                    .authorities(Collections.singleton(new Authority(Authority.NAMES.ROLE_USER.name())))
-                    .build());
+                                     .avatar(Constants.DEFAULT_AVATAR)
+                                     .password(new BCryptPasswordEncoder().encode(password))
+                                     .enabled(true)
+                                     .phone(phone)
+                                     .username(phone)
+                                     .nickname(phone)
+                                     .authorities(Collections.singleton(new Authority(Authority.NAMES.ROLE_USER.name())))
+                                     .build());
         }
         }
         return user;
         return user;
     }
     }
@@ -68,18 +68,18 @@ public class UserService {
         User user = userRepo.findByOpenId(wxMpUser.getOpenId());
         User user = userRepo.findByOpenId(wxMpUser.getOpenId());
         if (user == null) {
         if (user == null) {
             user = User.builder()
             user = User.builder()
-                    .username(UUID.randomUUID().toString())
-                    .nickname(wxMpUser.getNickname())
-                    .avatar(wxMpUser.getHeadImgUrl())
-                    .sex(wxMpUser.getSexDesc())
-                    .country(wxMpUser.getCountry())
-                    .province(wxMpUser.getProvince())
-                    .city(wxMpUser.getCity())
-                    .openId(wxMpUser.getOpenId())
-                    .language(wxMpUser.getLanguage())
-                    .enabled(true)
-                    .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
-                    .build();
+                       .username(UUID.randomUUID().toString())
+                       .nickname(wxMpUser.getNickname())
+                       .avatar(wxMpUser.getHeadImgUrl())
+                       .sex(wxMpUser.getSexDesc())
+                       .country(wxMpUser.getCountry())
+                       .province(wxMpUser.getProvince())
+                       .city(wxMpUser.getCity())
+                       .openId(wxMpUser.getOpenId())
+                       .language(wxMpUser.getLanguage())
+                       .enabled(true)
+                       .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
+                       .build();
             userRepo.save(user);
             userRepo.save(user);
         }
         }
         return user;
         return user;
@@ -95,13 +95,13 @@ public class UserService {
                 return userInfo;
                 return userInfo;
             }
             }
             userInfo = User.builder()
             userInfo = User.builder()
-                    .username(UUID.randomUUID().toString())
-                    .nickname("用户" + RandomStringUtils.randomAlphabetic(6))
-                    .openId(openId)
-                    .avatar(Constants.DEFAULT_AVATAR)
-                    .enabled(true)
-                    .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
-                    .build();
+                           .username(UUID.randomUUID().toString())
+                           .nickname("用户" + RandomStringUtils.randomAlphabetic(6))
+                           .openId(openId)
+                           .avatar(Constants.DEFAULT_AVATAR)
+                           .enabled(true)
+                           .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
+                           .build();
             userInfo = userRepo.save(userInfo);
             userInfo = userRepo.save(userInfo);
             return userInfo;
             return userInfo;
         } catch (WxErrorException e) {
         } catch (WxErrorException e) {
@@ -135,17 +135,17 @@ public class UserService {
         if (user == null) {
         if (user == null) {
 
 
             user = User.builder()
             user = User.builder()
-                    .username(UUID.randomUUID().toString())
-                    .nickname(wxUserInfo.getNickName())
-                    .openId(wxUserInfo.getOpenId())
-                    .avatar(avatarUrl)
-                    .sex(wxUserInfo.getGender())
-                    .country(wxUserInfo.getCountry())
-                    .province(wxUserInfo.getProvince())
-                    .city(wxUserInfo.getCity())
-                    .enabled(true)
-                    .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
-                    .build();
+                       .username(UUID.randomUUID().toString())
+                       .nickname(wxUserInfo.getNickName())
+                       .openId(wxUserInfo.getOpenId())
+                       .avatar(avatarUrl)
+                       .sex(wxUserInfo.getGender())
+                       .country(wxUserInfo.getCountry())
+                       .province(wxUserInfo.getProvince())
+                       .city(wxUserInfo.getCity())
+                       .enabled(true)
+                       .authorities(Collections.singleton(Authority.builder().name("ROLE_USER").build()))
+                       .build();
             user = userRepo.save(user);
             user = userRepo.save(user);
 
 
         } else {
         } else {
@@ -170,14 +170,29 @@ public class UserService {
     }
     }
 
 
     public void updateProfile(Long userId, String orgName, String occupation, String contactName,
     public void updateProfile(Long userId, String orgName, String occupation, String contactName,
-                              String contactPhone, String email, String idNo) {
+                              String contactPhone, String email, String idNo, String avatar) {
         User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
         User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
-        user.setOrgName(orgName);
-        user.setOccupation(occupation);
-        user.setContactName(contactName);
-        user.setContactPhone(contactPhone);
-        user.setEmail(email);
-        user.setIdNo(idNo);
+        if (StringUtils.isNotEmpty(orgName)) {
+            user.setOrgName(orgName);
+        }
+        if (StringUtils.isNotEmpty(occupation)) {
+            user.setOccupation(occupation);
+        }
+        if (StringUtils.isNotEmpty(contactName)) {
+            user.setContactName(contactName);
+        }
+        if (StringUtils.isNotEmpty(contactPhone)) {
+            user.setContactPhone(contactPhone);
+        }
+        if (StringUtils.isNotEmpty(email)) {
+            user.setEmail(email);
+        }
+        if (StringUtils.isNotEmpty(idNo)) {
+            user.setIdNo(idNo);
+        }
+        if (StringUtils.isNotEmpty(avatar)) {
+            user.setAvatar(avatar);
+        }
         userRepo.save(user);
         userRepo.save(user);
     }
     }
 
 
@@ -191,14 +206,14 @@ public class UserService {
             throw new BusinessException("此用户名已注册");
             throw new BusinessException("此用户名已注册");
         }
         }
         user = userRepo.save(User.builder()
         user = userRepo.save(User.builder()
-                .avatar(Constants.DEFAULT_AVATAR)
-                .password(new BCryptPasswordEncoder().encode(password))
-                .enabled(true)
-                .username(username)
-                .nickname(username)
-                .email(mail)
-                .authorities(Collections.singleton(new Authority(Authority.NAMES.ROLE_USER.name())))
-                .build());
+                                 .avatar(Constants.DEFAULT_AVATAR)
+                                 .password(new BCryptPasswordEncoder().encode(password))
+                                 .enabled(true)
+                                 .username(username)
+                                 .nickname(username)
+                                 .email(mail)
+                                 .authorities(Collections.singleton(new Authority(Authority.NAMES.ROLE_USER.name())))
+                                 .build());
         return user;
         return user;
     }
     }
 
 

+ 4 - 2
src/main/java/com/izouma/jmrh/web/DataTypeController.java

@@ -9,6 +9,7 @@ import com.izouma.jmrh.utils.ObjUtils;
 import com.izouma.jmrh.utils.excel.ExcelUtils;
 import com.izouma.jmrh.utils.excel.ExcelUtils;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
@@ -22,7 +23,7 @@ public class DataTypeController extends BaseController {
     private DataTypeService dataTypeService;
     private DataTypeService dataTypeService;
     private DataTypeRepo    dataTypeRepo;
     private DataTypeRepo    dataTypeRepo;
 
 
-    //@PreAuthorize("hasRole('ADMIN')")
+    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
     @PostMapping("/save")
     public DataType save(@RequestBody DataType record) {
     public DataType save(@RequestBody DataType record) {
         if (record.getId() != null) {
         if (record.getId() != null) {
@@ -45,7 +46,8 @@ public class DataTypeController extends BaseController {
         return dataTypeRepo.findById(id).orElseThrow(new BusinessException("无记录"));
         return dataTypeRepo.findById(id).orElseThrow(new BusinessException("无记录"));
     }
     }
 
 
-    @GetMapping("/del/{id}")
+    @PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/del/{id}")
     public void del(@PathVariable Long id) {
     public void del(@PathVariable Long id) {
         dataTypeRepo.deleteById(id);
         dataTypeRepo.deleteById(id);
     }
     }

+ 14 - 14
src/main/java/com/izouma/jmrh/web/UserController.java

@@ -51,14 +51,14 @@ public class UserController extends BaseController {
                          @RequestParam String code*/) /*throws SmsService.SmsVerifyException */ {
                          @RequestParam String code*/) /*throws SmsService.SmsVerifyException */ {
         /*        smsService.verify(phone, code);*/
         /*        smsService.verify(phone, code);*/
         User user = User.builder()
         User user = User.builder()
-                .username(username)
-                .nickname(username)
-                .avatar(Constants.DEFAULT_AVATAR)
-                .password(new BCryptPasswordEncoder().encode(password))
-                .enabled(true)
-                /*      .phone(phone)*/
-                .authorities(Collections.singleton(new Authority(Authority.NAMES.ROLE_USER.name())))
-                .build();
+                        .username(username)
+                        .nickname(username)
+                        .avatar(Constants.DEFAULT_AVATAR)
+                        .password(new BCryptPasswordEncoder().encode(password))
+                        .enabled(true)
+                        /*      .phone(phone)*/
+                        .authorities(Collections.singleton(new Authority(Authority.NAMES.ROLE_USER.name())))
+                        .build();
         return userRepo.save(user);
         return userRepo.save(user);
     }
     }
 
 
@@ -140,7 +140,7 @@ public class UserController extends BaseController {
     @GetMapping("/my")
     @GetMapping("/my")
     public User my() {
     public User my() {
         return userRepo.findById(SecurityUtils.getAuthenticatedUser().getId())
         return userRepo.findById(SecurityUtils.getAuthenticatedUser().getId())
-                .orElseThrow(new BusinessException("用户不存在"));
+                       .orElseThrow(new BusinessException("用户不存在"));
     }
     }
 
 
     @PreAuthorize("hasRole('ADMIN')")
     @PreAuthorize("hasRole('ADMIN')")
@@ -183,15 +183,15 @@ public class UserController extends BaseController {
     @GetMapping("/getToken/{userId}")
     @GetMapping("/getToken/{userId}")
     public String getToken(@PathVariable Long userId) {
     public String getToken(@PathVariable Long userId) {
         return jwtTokenUtil.generateToken(JwtUserFactory.create(userRepo.findById(userId)
         return jwtTokenUtil.generateToken(JwtUserFactory.create(userRepo.findById(userId)
-                .orElseThrow(new BusinessException("用户不存在"))));
+                                                                        .orElseThrow(new BusinessException("用户不存在"))));
     }
     }
 
 
     @PostMapping("/updateProfile")
     @PostMapping("/updateProfile")
-    public void updateProfile(@RequestParam String orgName, @RequestParam String occupation,
-                              @RequestParam String contactName, @RequestParam String contactPhone,
-                              @RequestParam String email, @RequestParam String idNo) {
+    public void updateProfile(String orgName, String occupation,
+                              String contactName, String contactPhone,
+                              String email, String idNo, String avatar) {
         userService.updateProfile(SecurityUtils.getAuthenticatedUser().getId(), orgName, occupation, contactName,
         userService.updateProfile(SecurityUtils.getAuthenticatedUser().getId(), orgName, occupation, contactName,
-                contactPhone, email, idNo);
+                contactPhone, email, idNo, avatar);
     }
     }
 
 
     @PostMapping("/changePassword")
     @PostMapping("/changePassword")

+ 3 - 0
src/main/jmrh/src/components/AutoInput.vue

@@ -42,6 +42,9 @@ export default {
         }
         }
     },
     },
     watch: {
     watch: {
+        value(val) {
+            this.inputValue = val;
+        },
         inputValue(val) {
         inputValue(val) {
             this.$emit('input', val);
             this.$emit('input', val);
         }
         }

+ 26 - 3
src/main/jmrh/src/views/mine/editInfo.vue

@@ -12,11 +12,14 @@
                 :show-file-list="false"
                 :show-file-list="false"
                 :on-success="handleAvatarSuccess"
                 :on-success="handleAvatarSuccess"
                 :before-upload="beforeAvatarUpload"
                 :before-upload="beforeAvatarUpload"
+                :on-error="handleAvatarError"
+                accept="image/*"
+                v-loading="avatarUploading"
             >
             >
                 <img v-if="avatar" :src="avatar" />
                 <img v-if="avatar" :src="avatar" />
                 <i v-else class="avatar"></i>
                 <i v-else class="avatar"></i>
+                <div class="edit_avatar">点击头像修改</div>
             </el-upload>
             </el-upload>
-            <div class="edit_avatar">点击头像修改</div>
         </div>
         </div>
         <el-form ref="form" :model="form" label-width="150px" :rules="rules" style="max-width: 600px;" size="small">
         <el-form ref="form" :model="form" label-width="150px" :rules="rules" style="max-width: 600px;" size="small">
             <el-form-item label="企业名称" prop="orgName">
             <el-form-item label="企业名称" prop="orgName">
@@ -153,7 +156,8 @@ export default {
             areas: [],
             areas: [],
             shen: '',
             shen: '',
             shi: '',
             shi: '',
-            qv: ''
+            qv: '',
+            avatarUploading: false
         };
         };
     },
     },
     methods: {
     methods: {
@@ -182,8 +186,27 @@ export default {
         },
         },
         handleAvatarSuccess(res, file) {
         handleAvatarSuccess(res, file) {
             this.avatar = URL.createObjectURL(file.raw);
             this.avatar = URL.createObjectURL(file.raw);
+            this.avatarUploading = false;
+            this.$http.post('/user/updateProfile', { avatar: res }).then(res => {
+                this.$message.success('修改成功');
+                this.$http.get('/user/my').then(res => {
+                    this.$store.commit('updateUserInfo', res);
+                });
+            });
+        },
+        beforeAvatarUpload(file) {
+            if (file.size / 1024 / 1024 > 1) {
+                this.$message.error('图片大小不能超过1MB!');
+                this.avatarUploading = false;
+                return false;
+            }
+            this.avatarUploading = true;
+            return true;
+        },
+        handleAvatarError(err, file, fileList) {
+            this.avatarUploading = false;
+            this.$message.error('上传失败');
         },
         },
-        beforeAvatarUpload(file) {},
         Toshen() {
         Toshen() {
             this.cities = [];
             this.cities = [];
             this.areas = [];
             this.areas = [];

+ 146 - 81
src/main/jmrh/src/views/mine/release.vue

@@ -12,7 +12,7 @@
             </div>
             </div>
         </el-row>
         </el-row>
         <!-- 供应信息列表 -->
         <!-- 供应信息列表 -->
-        <div class="tab1" v-if="tab === 0">
+        <div class="tab1" v-if="tab === 0" key="tab1">
             <el-row>
             <el-row>
                 <div class="classify">
                 <div class="classify">
                     <span
                     <span
@@ -27,45 +27,63 @@
             </el-row>
             </el-row>
             <!-- 产品 -->
             <!-- 产品 -->
             <el-row>
             <el-row>
-                <div class="card_list" v-if="current == 0">
-                    <div class="card" v-for="n in tableData" :key="n.id">
-                        <img :src="n.images[0]" />
-                        <h5>{{ n.name }}</h5>
-                        <p>{{ n.description }}</p>
-                        <div class="btn">
-                            <div class="edit" @click="toShow(n)">
-                                编辑
+                <template v-if="current == 0">
+                    <div class="card_list">
+                        <div class="card" v-for="n in tableData" :key="n.id">
+                            <el-image class="cover" :src="n.images[0]">
+                                <div slot="error" class="image-slot">
+                                    <i class="el-icon-picture-outline"></i>
+                                </div>
+                            </el-image>
+                            <h5>{{ n.name }}</h5>
+                            <p>{{ n.description }}</p>
+                            <div class="btn">
+                                <div class="edit" @click="toShow(n)">
+                                    编辑
+                                </div>
+                                <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                             </div>
                             </div>
-                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                         </div>
                         </div>
                     </div>
                     </div>
-                </div>
-                <div class="card_list" v-if="current == 1">
-                    <div class="card" v-for="n in tableData" :key="n.id">
-                        <img :src="n.images[0]" />
-                        <h5>{{ n.name }}</h5>
-                        <p>{{ n.description }}</p>
-                        <div class="btn">
-                            <div class="edit" @click="toShow(n)">
-                                编辑
+                </template>
+                <template v-if="current == 1">
+                    <div class="card_list" v-if="current == 1">
+                        <div class="card" v-for="n in tableData" :key="n.id">
+                            <el-image class="cover" :src="n.images[0]">
+                                <div slot="error" class="image-slot">
+                                    <i class="el-icon-picture-outline"></i>
+                                </div>
+                            </el-image>
+                            <h5>{{ n.name }}</h5>
+                            <p>{{ n.description }}</p>
+                            <div class="btn">
+                                <div class="edit" @click="toShow(n)">
+                                    编辑
+                                </div>
+                                <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                             </div>
                             </div>
-                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                         </div>
                         </div>
                     </div>
                     </div>
-                </div>
-                <div class="card_list" v-if="current == 2">
-                    <div class="card" v-for="n in tableData" :key="n.id">
-                        <img :src="n.images[0]" />
-                        <h5>{{ n.name }}</h5>
-                        <p>{{ n.description }}</p>
-                        <div class="btn">
-                            <div class="edit" @click="toShow(n)">
-                                编辑
+                </template>
+                <template v-if="current == 2">
+                    <div class="card_list">
+                        <div class="card" v-for="n in tableData" :key="n.id">
+                            <el-image class="cover" :src="n.images[0]">
+                                <div slot="error" class="image-slot">
+                                    <i class="el-icon-picture-outline"></i>
+                                </div>
+                            </el-image>
+                            <h5>{{ n.name }}</h5>
+                            <p>{{ n.description }}</p>
+                            <div class="btn">
+                                <div class="edit" @click="toShow(n)">
+                                    编辑
+                                </div>
+                                <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                             </div>
                             </div>
-                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
                         </div>
                         </div>
                     </div>
                     </div>
-                </div>
+                </template>
             </el-row>
             </el-row>
             <el-row>
             <el-row>
                 <el-pagination
                 <el-pagination
@@ -81,7 +99,7 @@
             </el-row>
             </el-row>
         </div>
         </div>
         <!--需求信息列表  -->
         <!--需求信息列表  -->
-        <div class="tab1" v-else>
+        <div class="tab1" v-else key="tab2">
             <el-row>
             <el-row>
                 <div class="classify">
                 <div class="classify">
                     <span
                     <span
@@ -97,62 +115,80 @@
             <!-- 产品需求,技术需求 -->
             <!-- 产品需求,技术需求 -->
             <el-row>
             <el-row>
                 <!-- <div v-for="n in tableData" :key="n.id" class="neens_div"> -->
                 <!-- <div v-for="n in tableData" :key="n.id" class="neens_div"> -->
-                <div v-for="n in tableData" :key="n.id" class="neens_div">
-                    <div class="needs_card" v-if="current == 0">
-                        <img :src="n.images[0]" />
-                        <div class="info">
-                            <div class="title">{{ n.name }}</div>
-                            <p>
-                                {{ n.description }}
-                            </p>
-                            <div class="time">{{ n.createdAt }}</div>
-                        </div>
-                        <div class="btn">
-                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
-                            <div class="edit" @click="toNeedShow(n)">编辑</div>
+                <template v-if="current == 0">
+                    <div v-for="n in tableData" :key="n.id" class="neens_div">
+                        <div class="needs_card">
+                            <el-image class="cover" :src="n.images[0]">
+                                <div slot="error" class="image-slot">
+                                    <i class="el-icon-picture-outline"></i>
+                                </div>
+                            </el-image>
+                            <div class="info">
+                                <div class="title">{{ n.name }}</div>
+                                <p>
+                                    {{ n.description }}
+                                </p>
+                                <div class="time">{{ n.createdAt }}</div>
+                            </div>
+                            <div class="btn">
+                                <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
+                                <div class="edit" @click="toNeedShow(n)">编辑</div>
+                            </div>
                         </div>
                         </div>
                     </div>
                     </div>
-                </div>
-                <div v-for="n in tableData" :key="n.id" class="neens_div">
-                    <div class="needs_card" v-if="current == 1">
-                        <img :src="n.images[0]" />
-                        <div class="info">
-                            <div class="title">{{ n.name }}</div>
-                            <p>
-                                {{ n.description }}
-                            </p>
-                            <div class="time">{{ n.createdAt }}</div>
-                        </div>
-                        <div class="btn">
-                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
-                            <div class="edit" @click="toNeedShow(n)">编辑</div>
+                </template>
+                <template v-if="current == 1">
+                    <div v-for="n in tableData" :key="n.id" class="neens_div">
+                        <div class="needs_card">
+                            <el-image class="cover" :src="n.images[0]">
+                                <div slot="error" class="image-slot">
+                                    <i class="el-icon-picture-outline"></i>
+                                </div>
+                            </el-image>
+                            <div class="info">
+                                <div class="title">{{ n.name }}</div>
+                                <p>
+                                    {{ n.description }}
+                                </p>
+                                <div class="time">{{ n.createdAt }}</div>
+                            </div>
+                            <div class="btn">
+                                <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
+                                <div class="edit" @click="toNeedShow(n)">编辑</div>
+                            </div>
                         </div>
                         </div>
                     </div>
                     </div>
-                </div>
-                <div v-for="n in tableData" :key="n.id" class="neens_div">
-                    <div class="needs_card" v-if="current == 2">
-                        <img :src="n.images[0]" />
-                        <div class="info">
-                            <div class="title">{{ n.name }}</div>
-                            <div class="con_info">
-                                <div class="con_info_item">
-                                    <i>计划融资</i><span>{{ n.resSnDPropertyList[0].value }}</span>
-                                </div>
-                                <div class="con_info_item">
-                                    <i>融资阶段</i><span>{{ n.resSnDPropertyList[1].value }}</span>
+                </template>
+                <template v-if="current == 2">
+                    <div v-for="n in tableData" :key="n.id" class="neens_div">
+                        <div class="needs_card">
+                            <el-image class="cover" :src="n.images[0]">
+                                <div slot="error" class="image-slot">
+                                    <i class="el-icon-picture-outline"></i>
                                 </div>
                                 </div>
-                                <div class="con_info_item">
-                                    <i>行业类型</i><span>{{ n.resSnDPropertyList[2].value }}</span>
+                            </el-image>
+                            <div class="info">
+                                <div class="title">{{ n.name }}</div>
+                                <div class="con_info">
+                                    <div class="con_info_item">
+                                        <i>计划融资</i><span>{{ n.resSnDPropertyList[0].value }}</span>
+                                    </div>
+                                    <div class="con_info_item">
+                                        <i>融资阶段</i><span>{{ n.resSnDPropertyList[1].value }}</span>
+                                    </div>
+                                    <div class="con_info_item">
+                                        <i>行业类型</i><span>{{ n.resSnDPropertyList[2].value }}</span>
+                                    </div>
                                 </div>
                                 </div>
+                                <div class="time">{{ n.createdAt }}</div>
+                            </div>
+                            <div class="btn">
+                                <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
+                                <div class="edit" @click="toNeedShow(n)">编辑</div>
                             </div>
                             </div>
-                            <div class="time">{{ n.createdAt }}</div>
-                        </div>
-                        <div class="btn">
-                            <div class="red">当前对接&nbsp;{{ n.count ? n.count : 0 }}</div>
-                            <div class="edit" @click="toNeedShow(n)">编辑</div>
                         </div>
                         </div>
                     </div>
                     </div>
-                </div>
+                </template>
             </el-row>
             </el-row>
             <el-row>
             <el-row>
                 <el-pagination
                 <el-pagination
@@ -197,6 +233,7 @@ export default {
     },
     },
     methods: {
     methods: {
         getTabData(index) {
         getTabData(index) {
+            this.tableData = [];
             this.tab = index;
             this.tab = index;
             if (this.tab === 1) {
             if (this.tab === 1) {
                 this.getIndexNeed(this.current);
                 this.getIndexNeed(this.current);
@@ -206,6 +243,7 @@ export default {
         },
         },
         // 供应信息
         // 供应信息
         getIndex(index) {
         getIndex(index) {
+            this.tableData = [];
             this.current = index;
             this.current = index;
             if (this.current === 0) {
             if (this.current === 0) {
                 // this.query = { types:PRODUCT_SUPPLY' };
                 // this.query = { types:PRODUCT_SUPPLY' };
@@ -222,6 +260,7 @@ export default {
         },
         },
         // 需求信息
         // 需求信息
         getIndexNeed(index) {
         getIndexNeed(index) {
+            this.tableData = [];
             this.current = index;
             this.current = index;
             if (this.current === 0) {
             if (this.current === 0) {
                 this.types = 'TECH_DEMAND';
                 this.types = 'TECH_DEMAND';
@@ -362,9 +401,22 @@ export default {
     margin-bottom: 30px;
     margin-bottom: 30px;
     float: left;
     float: left;
 
 
-    img {
+    .cover {
         width: 223px;
         width: 223px;
         height: 223px;
         height: 223px;
+        ::v-deep .image-slot {
+            width: 100%;
+            height: 100%;
+            background: #f5f7fa;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            color: #909399;
+            font-size: 14px;
+            i {
+                font-size: 30px;
+            }
+        }
     }
     }
     h5 {
     h5 {
         width: 223px;
         width: 223px;
@@ -426,10 +478,23 @@ export default {
     // + .needs_card {
     // + .needs_card {
 
 
     // }
     // }
-    img {
+    .cover {
         width: 100px;
         width: 100px;
         height: 100px;
         height: 100px;
         margin-right: 16px;
         margin-right: 16px;
+        ::v-deep .image-slot {
+            width: 100%;
+            height: 100%;
+            background: #f5f7fa;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            color: #909399;
+            font-size: 14px;
+            i {
+                font-size: 30px;
+            }
+        }
     }
     }
     .info {
     .info {
         width: 600px;
         width: 600px;

+ 36 - 3
src/main/jmrh/src/views/mine/releaseSupply.vue

@@ -115,9 +115,42 @@ export default {
                 type: [{ required: true, message: '请选择供应类别', trigger: 'change' }],
                 type: [{ required: true, message: '请选择供应类别', trigger: 'change' }],
                 name: [{ required: true, message: '请输入标题', trigger: 'blur' }],
                 name: [{ required: true, message: '请输入标题', trigger: 'blur' }],
                 description: [{ required: true, message: '请输入简介', trigger: 'blur' }],
                 description: [{ required: true, message: '请输入简介', trigger: 'blur' }],
-                dataType: [{ required: true, message: '请选择设备类型', trigger: 'blur' }],
-                techType: [{ required: true, message: '请选择技术类型', trigger: 'blur' }],
-                applicationField: [{ required: true, message: '请选择应用领域', trigger: 'blur' }],
+                dataType: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (!this.dataTypeId) {
+                                callback(new Error('请选择设备类型'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
+                techType: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (!this.techTypeId) {
+                                callback(new Error('请选择技术类型'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
+                applicationField: [
+                    {
+                        validator: (rule, value, callback) => {
+                            if (!this.applicationFieldId) {
+                                callback(new Error('请选择应用领域'));
+                            } else {
+                                callback();
+                            }
+                        },
+                        trigger: 'blur'
+                    }
+                ],
                 expireTime: [{ required: true, message: '请选择有效时间', trigger: 'blur' }],
                 expireTime: [{ required: true, message: '请选择有效时间', trigger: 'blur' }],
                 contact: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
                 contact: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
                 phone: [{ required: true, message: '请输入联系方式', trigger: 'blur' }]
                 phone: [{ required: true, message: '请输入联系方式', trigger: 'blur' }]

+ 12 - 3
src/main/resources/application.yaml

@@ -99,7 +99,10 @@ spring:
 storage:
 storage:
   provider: local
   provider: local
   local_path: /var/www/upload/
   local_path: /var/www/upload/
-
+encrypt:
+  body:
+    aes-key: gmMRQzojuaSVGg3weNe6J5BCjDyH5BML
+  enable: true
 ---
 ---
 
 
 spring:
 spring:
@@ -111,7 +114,10 @@ spring:
 storage:
 storage:
   provider: local
   provider: local
   local_path: /var/www/upload/
   local_path: /var/www/upload/
-
+encrypt:
+  body:
+    aes-key: gmMRQzojuaSVGg3weNe6J5BCjDyH5BML
+  enable: true
 ---
 ---
 
 
 spring:
 spring:
@@ -123,7 +129,10 @@ spring:
 storage:
 storage:
   provider: local
   provider: local
   local_path: /var/www/upload/
   local_path: /var/www/upload/
-
+encrypt:
+  body:
+    aes-key: gmMRQzojuaSVGg3weNe6J5BCjDyH5BML
+  enable: true
 ---
 ---
 
 
 spring:
 spring:

+ 16 - 2
src/main/vue/src/views/DataTypeList.vue

@@ -2,7 +2,7 @@
     <div class="list-view">
     <div class="list-view">
         <div class="filters-container">
         <div class="filters-container">
             <el-input placeholder="输入关键字" v-model="search" clearable class="filter-item"></el-input>
             <el-input placeholder="输入关键字" v-model="search" clearable class="filter-item"></el-input>
-            <el-select v-model="query.keyType" @change="toTypeList">
+            <el-select v-model="query.keyType" @change="toTypeList" class="filter-item">
                 <el-option
                 <el-option
                     v-for="item in dataTypeList"
                     v-for="item in dataTypeList"
                     :key="item.query.keyType"
                     :key="item.query.keyType"
@@ -91,6 +91,11 @@ export default {
             return this.$refs.table.selection.map(i => i.id);
             return this.$refs.table.selection.map(i => i.id);
         }
         }
     },
     },
+    created() {
+        if (this.$route.query.keyType) {
+            this.query.keyType = this.$route.query.keyType;
+        }
+    },
     methods: {
     methods: {
         toTypeList() {
         toTypeList() {
             this.getData();
             this.getData();
@@ -160,7 +165,7 @@ export default {
         deleteRow(row) {
         deleteRow(row) {
             this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
             this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
                 .then(() => {
                 .then(() => {
-                    return this.$http.post(`/articleType/del/${row.id}`);
+                    return this.$http.post(`/dataType/del/${row.id}`);
                 })
                 })
                 .then(() => {
                 .then(() => {
                     this.$message.success('删除成功');
                     this.$message.success('删除成功');
@@ -172,6 +177,15 @@ export default {
                     }
                     }
                 });
                 });
         }
         }
+    },
+    watch: {
+        'query.keyType'(val) {
+            this.$router
+                .replace({
+                    query: { keyType: val }
+                })
+                .catch(() => {});
+        }
     }
     }
 };
 };
 </script>
 </script>

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

@@ -7,7 +7,7 @@
                 </el-option>
                 </el-option>
             </el-select>
             </el-select>
             <el-button @click="getData" type="primary" icon="el-icon-search" class="filter-item">搜索 </el-button>
             <el-button @click="getData" type="primary" icon="el-icon-search" class="filter-item">搜索 </el-button>
-            <el-button @click="addRow" type="primary" icon="el-icon-plus" class="filter-item">添加 </el-button>
+            <!-- <el-button @click="addRow" type="primary" icon="el-icon-plus" class="filter-item">添加 </el-button> -->
             <el-button
             <el-button
                 @click="download"
                 @click="download"
                 type="primary"
                 type="primary"