bihuisong пре 1 година
родитељ
комит
86ebec5998

+ 12 - 33
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysSecretProjectController.java

@@ -1,41 +1,23 @@
 package com.ruoyi.web.controller.system;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.time.Duration;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import cn.hutool.json.JSONObject;
-import com.ruoyi.common.core.domain.R;
-import com.ruoyi.system.domain.SysProject;
-import com.ruoyi.system.domain.dto.SysSecretProjectDTO;
-import com.ruoyi.system.mapper.SysProjectMapper;
-import com.ruoyi.system.mapper.SysSecretProjectMapper;
-import com.ruoyi.system.service.ISysProjectService;
-import com.ruoyi.web.controller.sm4.SM4Utils;
-import com.ruoyi.web.utils.ClipboardUtil;
-import com.ruoyi.web.utils.JWTExample;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.system.domain.SysSecretProject;
+import com.ruoyi.system.domain.dto.SysSecretProjectDTO;
+import com.ruoyi.system.mapper.SysSecretProjectMapper;
 import com.ruoyi.system.service.ISysSecretProjectService;
-import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.web.utils.ClipboardUtil;
+import com.ruoyi.web.utils.JWTExample;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.Duration;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.List;
 
 /**
  * 项目授权管理Controller
@@ -121,9 +103,6 @@ public class SysSecretProjectController extends BaseController {
         LocalDate currentDate = LocalDate.now();
         // 获取当前日期前七天的日期
         LocalDate previousDate = currentDate.minusDays(7);
-        long milliseconds = Duration.between(LocalDateTime.now(), sysSecretProjectDTO.getOverdueDate().atStartOfDay()).toMillis();
-        String jwt = JWTExample.createJWT(sysSecretProjectDTO.getProjectName(), milliseconds);
-        sysSecretProjectDTO.setSecretKey(jwt);
         int comparisonResult = sysSecretProjectDTO.getOverdueDate().compareTo(currentDate);
         if (comparisonResult > 0) {
             sysSecretProjectDTO.setStatus(1L);

+ 10 - 1
ruoyi-ui/src/views/authority/secret/index.vue

@@ -46,6 +46,13 @@
       <el-table-column label="状态" align="center" prop="statusText"/>
       <el-table-column label="过期时间" align="center" property="date" prop="overdueDate"/>
       <el-table-column label="标识码" align="center" prop="secretKey"/>
+<!--      <el-table-column label="状态" align="center" prop="type">-->
+<!--        <el-switch-->
+<!--          v-model="form.type"-->
+<!--          active-color="#13ce66"-->
+<!--          inactive-color="#ff4949">-->
+<!--        </el-switch>-->
+<!--      </el-table-column>-->
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -160,7 +167,9 @@ export default {
       },
       options: [],
       // 表单参数
-      form: {},
+      form: {
+        type:true
+      },
       formDel: {
         inputConfirm: ''
       },