| | |
| | | * ææ¡£æ¡æ¶ knife4j ç¾åæ¥å£ææ¡£ |
| | | * 代ç çæå¨ ä¸é®çæåå端代ç |
| | | |
| | | ## åèææ¡£ |
| | | [åèææ¡£ Wiki](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/wikis/pages) |
| | | |
| | | ## ä¿®æ¹RuoYiåè½ |
| | | |
| | | ### ä¾èµæ¹å¨ |
| | |
| | | * 项ç®ä¿®æ¹ä¸º mavenå¤ç¯å¢é
ç½® |
| | | * 项ç®é
置修æ¹ä¸º application.yml ç»ä¸ç®¡ç |
| | | * æ°æ®æéä¿®æ¹ä¸º éé
æ¯æå表ãå¤è¡¨ |
| | | * ä½¿ç¨ redisson å®ç° spring-cache æ´å |
| | | * å¢å mybatis-plus äºçº§ç¼å redis åå¨ |
| | | |
| | | ### å
¶ä» |
| | | |
| | |
| | | ä½è
为å
¼èå弿º,å¹³æ¶è¿éè¦å·¥ä½,妿叮å°äºæ¨å¯ä»¥è¯·ä½è
å个çé¥ |
| | | <img src="https://images.gitee.com/uploads/images/2021/0525/101654_451e4523_1766278.jpeg" width="300px" height="450px" /> |
| | | <img src="https://images.gitee.com/uploads/images/2021/0525/101713_3d18b119_1766278.jpeg" width="300px" height="450px" /> |
| | | |
| | | ## éç¹æ³¨æäºé¡¹ |
| | | |
| | | è¥ä¾ææ¡£å¯¹äºå¡æ³¨è§£çæè¿° [å
³äºäºå¡](https://doc.ruoyi.vip/ruoyi/document/htsc.html#%E4%BA%8B%E5%8A%A1%E7%AE%A1%E7%90%86) 以ä¸å¯¹å¤æ°æ®æºäºå¡åè¡¥å
: |
| | | * åä¸ä¸ªäºå¡ä¸æ¯æ æ³åæ¢æ°æ®æºç |
| | | * ç¦æ¢ ç¶æ¹æ³ä½¿ç¨ @Transactional å建äºå¡ åæ¹æ³ä½¿ç¨ @DataSource åæ¢æ°æ®æº |
| | | * æ£ç¡®ç¨æ³: åæ¹æ³åç¬å建äºå¡ æ ç¶æ¹æ³ä½¿ç¨ @Transactional(propagation = Propagation.REQUIRES_NEW) 为ææåæ¹æ³å建æ°äºå¡ |
| | | |
| | | å
³äºå¦ä½ä½¿ç¨Tomcat |
| | | * æ¥çruoyi-framework模åçpom.xmlæä»¶,æ ¹æ®æ³¨éæ´æ¹ä¾èµ |
| | | * æ¥çruoyi-admin模åä¸çapplication.ymlæä»¶,æ ¹æ®æ³¨éæ´æ¹é
ç½® |
| | | |
| | | å
³äºå¦ä½åå»ºæ°æ¨¡å |
| | | * åèruoyi-demo模å |
| | | * éè¦æ¹å¨: ç¶pom ä¸ admin模åpom |
| | | |
| | | å
³äºæ è¡¨çæ |
| | | * ç´æ¥å¨mysqlè¡¨ä¸ æ·»å parentId orderNum çåæ®µ(æ ¹æ®éè¦åè TreeEntityç±») |
| | | * 代ç çæéæ©æ 表çæå³å¯ |
| | | |
| | | å
³äºæ°æ®æé |
| | | * å建表 éé¢ç dept_id åæ®µ å¦éç¨æ·æé è¿éé¢ç user_id åæ®µ |
| | | * æ¯æ Mybatis-Plus æ¹å¼æ³¨å
¥ åè demo 模åç¨æ³(é导å
¥ test.sql æä»¶) |
| | | * æ¯æ XML æ¹å¼æ³¨å
¥ åè system 模åç¨æ³ |
| | | |
| | | å
³äºvueä¸bootæ´åé¨ç½² |
| | | * [å端éæèµæºå¦ä½æ´åå°å端访é®](https://doc.ruoyi.vip/ruoyi-vue/other/faq.html#å端éæèµæºå¦ä½æ´åå°å端访é®) |
| | | |
| | | å
³äºä¿®æ¹å
å |
| | | * 尿件夹å
¨é¨ä¿®æ¹ä¸º com.xxx |
| | | * 使ç¨IDEAå
¨å±æ¿æ¢ com.ruoyi æ¿æ¢ä¸º com.xxx |
| | | * ä¸¥ç¦æå¨ä¿®æ¹ |
| | | |
| | | ## å
ç½®åè½ |
| | | |
| | |
| | | <description>RuoYi-Vue-Plusåå°ç®¡çç³»ç»</description> |
| | | |
| | | <properties> |
| | | <ruoyi-vue-plus.version>2.3.1</ruoyi-vue-plus.version> |
| | | <ruoyi-vue-plus.version>2.3.2</ruoyi-vue-plus.version> |
| | | <spring-boot.version>2.3.11.RELEASE</spring-boot.version> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | |
| | | <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> |
| | | <druid.version>1.2.6</druid.version> |
| | | <knife4j.version>3.0.2</knife4j.version> |
| | | <swagger-annotations.version>1.5.22</swagger-annotations.version> |
| | | <fastjson.version>1.2.76</fastjson.version> |
| | | <poi.version>4.1.2</poi.version> |
| | | <velocity.version>1.7</velocity.version> |
| | |
| | | <scope>import</scope> |
| | | </dependency> |
| | | |
| | | <!--é¿éæ°æ®åºè¿æ¥æ± --> |
| | | <!-- é¿éæ°æ®åºè¿æ¥æ± --> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>knife4j-spring-boot-starter</artifactId> |
| | | <version>${knife4j.version}</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>swagger-annotations</artifactId> |
| | | <groupId>io.swagger</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>io.swagger</groupId> |
| | | <artifactId>swagger-annotations</artifactId> |
| | | <version>${swagger-annotations.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- excelå·¥å
· --> |
| | |
| | | <version>${poi.version}</version> |
| | | </dependency> |
| | | |
| | | <!--velocity代ç çæä½¿ç¨æ¨¡æ¿ --> |
| | | <!-- velocity代ç çæä½¿ç¨æ¨¡æ¿ --> |
| | | <dependency> |
| | | <groupId>org.apache.velocity</groupId> |
| | | <artifactId>velocity</artifactId> |
| | |
| | | <version>${fastjson.version}</version> |
| | | </dependency> |
| | | |
| | | <!--Tokençæä¸è§£æ--> |
| | | <!-- Tokençæä¸è§£æ--> |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt</artifactId> |
| | |
| | | <version>${spring-boot-admin.version}</version> |
| | | </dependency> |
| | | |
| | | <!--redisson--> |
| | | <dependency> |
| | | <groupId>org.redisson</groupId> |
| | | <artifactId>redisson-spring-boot-starter</artifactId> |
| | | <version>${redisson.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 宿¶ä»»å¡--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-demo</artifactId> |
| | | <version>${ruoyi-vue-plus.version}</version> |
| | | </dependency> |
| | | |
| | | <!--redisson--> |
| | | <dependency> |
| | | <groupId>org.redisson</groupId> |
| | | <artifactId>redisson-spring-boot-starter</artifactId> |
| | | <version>${redisson.version}</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | |
| | | url: http://localhost:${server.port}${spring.boot.admin.context-path} |
| | | instance: |
| | | prefer-ip: true # 注åå®ä¾æ¶ï¼ä¼å
ä½¿ç¨ IP |
| | | # username: ruoyi |
| | | # password: 123456 |
| | | # Spring Boot Admin Server æå¡ç«¯çç¸å
³é
ç½® |
| | | context-path: /admin # é
ç½® Spring |
| | | |
| | |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>io.swagger</groupId> |
| | | <artifactId>swagger-annotations</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | |
| | | |
| | | /** |
| | | * è§è²è¡¨ sys_role |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | |
| | |
| | | @NotBlank(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º") |
| | | private String roleSort; |
| | | |
| | | /** æ°æ®èå´ï¼1ï¼æææ°æ®æéï¼2ï¼èªå®ä¹æ°æ®æéï¼3ï¼æ¬é¨é¨æ°æ®æéï¼4ï¼æ¬é¨é¨å以䏿°æ®æéï¼ */ |
| | | @Excel(name = "æ°æ®èå´", readConverterExp = "1=æææ°æ®æé,2=èªå®ä¹æ°æ®æé,3=æ¬é¨é¨æ°æ®æé,4=æ¬é¨é¨å以䏿°æ®æé") |
| | | /** æ°æ®èå´ï¼1ï¼æææ°æ®æéï¼2ï¼èªå®ä¹æ°æ®æéï¼3ï¼æ¬é¨é¨æ°æ®æéï¼4ï¼æ¬é¨é¨å以䏿°æ®æéï¼5ï¼ä»
æ¬äººæ°æ®æéï¼ */ |
| | | @Excel(name = "æ°æ®èå´", readConverterExp = "1=æææ°æ®æé,2=èªå®ä¹æ°æ®æé,3=æ¬é¨é¨æ°æ®æé,4=æ¬é¨é¨å以䏿°æ®æé,5=ä»
æ¬äººæ°æ®æé") |
| | | private String dataScope; |
| | | |
| | | /** èåæ éæ©é¡¹æ¯å¦å
³èæ¾ç¤ºï¼ 0ï¼ç¶åä¸äºç¸å
³èæ¾ç¤º 1ï¼ç¶åäºç¸å
³èæ¾ç¤ºï¼ */ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.mybatisplus; |
| | | |
| | | import cn.hutool.extra.spring.SpringUtil; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.cache.Cache; |
| | | import org.springframework.data.redis.connection.RedisServerCommands; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.concurrent.locks.ReadWriteLock; |
| | | import java.util.concurrent.locks.ReentrantReadWriteLock; |
| | | |
| | | /** |
| | | * mybatis-redis äºçº§ç¼å |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @Slf4j |
| | | public class MybatisPlusRedisCache implements Cache { |
| | | |
| | | private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(true); |
| | | |
| | | private RedisCache redisCache; |
| | | |
| | | private String id; |
| | | |
| | | public MybatisPlusRedisCache(final String id) { |
| | | if (id == null) { |
| | | throw new IllegalArgumentException("Cache instances require an ID"); |
| | | } |
| | | this.id = id; |
| | | } |
| | | |
| | | @Override |
| | | public String getId() { |
| | | return this.id; |
| | | } |
| | | |
| | | @Override |
| | | public void putObject(Object key, Object value) { |
| | | if (redisCache == null) { |
| | | redisCache = SpringUtil.getBean(RedisCache.class); |
| | | } |
| | | if (value != null) { |
| | | redisCache.setCacheObject(key.toString(), value); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Object getObject(Object key) { |
| | | if (redisCache == null) { |
| | | //ç±äºå¯å¨æé´æ³¨å
¥å¤±è´¥ï¼åªè½è¿è¡æé´æ³¨å
¥ï¼è¿æ®µä»£ç å¯ä»¥å é¤ |
| | | redisCache = SpringUtil.getBean(RedisCache.class); |
| | | } |
| | | try { |
| | | if (key != null) { |
| | | return redisCache.getCacheObject(key.toString()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("ç¼ååºé"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Object removeObject(Object key) { |
| | | if (redisCache == null) { |
| | | redisCache = SpringUtil.getBean(RedisCache.class); |
| | | } |
| | | if (key != null) { |
| | | redisCache.deleteObject(key.toString()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void clear() { |
| | | log.debug("æ¸
空ç¼å"); |
| | | if (redisCache == null) { |
| | | redisCache = SpringUtil.getBean(RedisCache.class); |
| | | } |
| | | Collection<String> keys = redisCache.keys("*:" + this.id + "*"); |
| | | if (!CollectionUtils.isEmpty(keys)) { |
| | | redisCache.deleteObject(keys); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public int getSize() { |
| | | RedisTemplate<String, Object> redisTemplate = SpringUtil.getBean("redisTemplate"); |
| | | Long size = redisTemplate.execute(RedisServerCommands::dbSize); |
| | | return size.intValue(); |
| | | } |
| | | |
| | | @Override |
| | | public ReadWriteLock getReadWriteLock() { |
| | | return this.readWriteLock; |
| | | } |
| | | } |
| | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å页 Page å¢å¼ºå¯¹è±¡ |
| | | * |
| | | * @param <T> æ°æ®åºå®ä½ |
| | | * @param <K> voå®ä½ |
| | | * @author Lion Li |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class PagePlus<T,K> implements IPage<T> { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.redis; |
| | | |
| | | import cn.hutool.core.lang.Assert; |
| | | import cn.hutool.core.lang.Validator; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import org.redisson.api.RCountDownLatch; |
| | | import org.redisson.api.RLock; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * redis é管çç±» |
| | | * |
| | | * @author shenxinquan |
| | | */ |
| | | @Component |
| | | public class RedisLockManager { |
| | | |
| | | @Autowired |
| | | private RedissonClient redissonClient; |
| | | |
| | | /** |
| | | * éç¨é |
| | | */ |
| | | private final static Integer BASE_LOCK = 1; |
| | | |
| | | /** |
| | | * å
¬å¹³é |
| | | */ |
| | | private final static Integer FAIR_LOCK = 2; |
| | | |
| | | /** |
| | | * åæ¾å½å线ç¨è·åéçç±»å |
| | | */ |
| | | private final ThreadLocal<Integer> threadLocal = new ThreadLocal<>(); |
| | | |
| | | /** |
| | | * è·åé |
| | | */ |
| | | private RLock getLock(String key, Integer lockType) { |
| | | Assert.isTrue(StrUtil.isNotBlank(key), "keyä¸è½ä¸ºç©º"); |
| | | threadLocal.set(lockType); |
| | | RLock lock; |
| | | if (BASE_LOCK.equals(lockType)) { |
| | | lock = redissonClient.getLock(key); |
| | | } else if (FAIR_LOCK.equals(lockType)) { |
| | | lock = redissonClient.getFairLock(key); |
| | | } else { |
| | | throw new RuntimeException("éä¸åå¨!"); |
| | | } |
| | | return lock; |
| | | } |
| | | |
| | | /** |
| | | * è·åéï¼ä¸ç¨è®¾ç½®è¶
æ¶æ¶é´ï¼ä¸ç´çå¾
ï¼ |
| | | */ |
| | | public boolean getLock(String key) { |
| | | RLock lock = getLock(key, BASE_LOCK); |
| | | return lock.tryLock(); |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®è¿ææ¶é´ |
| | | * |
| | | * @param key |
| | | * @param time è¿ææ¶é´ |
| | | * @param expireUnit æ¶é´åä½ |
| | | */ |
| | | public boolean getLock(String key, long time, TimeUnit expireUnit) { |
| | | Assert.isTrue(time > 0, "è¿ææ¶é´å¿
须大äº0"); |
| | | Assert.isTrue(Validator.isNotEmpty(expireUnit), "æ¶é´åä½ä¸è½ä¸ºç©º"); |
| | | RLock lock = getLock(key, BASE_LOCK); |
| | | try { |
| | | return lock.tryLock(time, expireUnit); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®è¿ææ¶é´ |
| | | * |
| | | * @param key |
| | | * @param waitTime è·åéçå¾
æ¶é´ |
| | | * @param leaseTime ä¿çéçæ¶é´ |
| | | * @param expireUnit æ¶é´åä½ |
| | | */ |
| | | public boolean getLock(String key, long waitTime, long leaseTime, TimeUnit expireUnit) { |
| | | Assert.isTrue(waitTime > 0, "è·åéçå¾
æ¶é´å¿
须大äº0"); |
| | | Assert.isTrue(leaseTime > 0, "ä¿çéçæ¶é´å¿
须大äº0"); |
| | | Assert.isTrue(Validator.isNotEmpty(expireUnit), "æ¶é´åä½ä¸è½ä¸ºç©º"); |
| | | RLock lock = getLock(key, BASE_LOCK); |
| | | try { |
| | | return lock.tryLock(waitTime, leaseTime, expireUnit); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·å计æ°å¨é |
| | | * |
| | | * @param key |
| | | * @param count countDownLatch çæ°é |
| | | */ |
| | | public RCountDownLatch getCountDownLatch(String key, long count) { |
| | | Assert.isTrue(count >= 0, "countæ°éå¿
须大äºçäº0"); |
| | | RCountDownLatch rCountDownLatch = redissonClient.getCountDownLatch(key); |
| | | rCountDownLatch.trySetCount(count); |
| | | return rCountDownLatch; |
| | | } |
| | | |
| | | /** |
| | | * è·åå
¬å¹³é |
| | | * |
| | | * @param key |
| | | * @param waitTime è·åéçå¾
æ¶é´ |
| | | * @param leaseTime ææéçæ¶é´ |
| | | * @param expireUnit æ¶é´åä½ |
| | | * @return |
| | | * @throws InterruptedException |
| | | */ |
| | | public boolean getFairLock(String key, long waitTime, long leaseTime, TimeUnit expireUnit) { |
| | | Assert.isTrue(waitTime > 0, "è·åéçå¾
æ¶é´å¿
须大äº0"); |
| | | Assert.isTrue(leaseTime > 0, "ä¿çéçæ¶é´å¿
须大äº0"); |
| | | Assert.isTrue(Validator.isNotEmpty(expireUnit), "æ¶é´åä½ä¸è½ä¸ºç©º"); |
| | | RLock lock = getLock(key, FAIR_LOCK); |
| | | try { |
| | | return lock.tryLock(waitTime, leaseTime, expireUnit); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åå
¬å¹³é |
| | | * |
| | | * @param key |
| | | * @param leaseTime ææéçæ¶é´ |
| | | * @param expireUnit æ¶é´åä½ |
| | | */ |
| | | public boolean getFairLock(String key, long leaseTime, TimeUnit expireUnit) { |
| | | Assert.isTrue(leaseTime > 0, "ä¿çéçæ¶é´å¿
须大äº0"); |
| | | Assert.isTrue(Validator.isNotEmpty(expireUnit), "æ¶é´åä½ä¸è½ä¸ºç©º"); |
| | | RLock lock = getLock(key, FAIR_LOCK); |
| | | try { |
| | | return lock.tryLock(leaseTime, expireUnit); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éæ¾é(ç»ä¸éæ¾) |
| | | */ |
| | | public void unLock(String key) { |
| | | Integer lockType = threadLocal.get(); |
| | | RLock lock = getLock(key, lockType); |
| | | lock.unlock(); |
| | | threadLocal.remove(); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.annotation.RedisLock; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.redis.RedisLockManager; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | |
| | | /** |
| | |
| | | * |
| | | * @author shenxinquan |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/demo/redisLock") |
| | | public class RedisLockController { |
| | | |
| | | @Autowired |
| | | private RedisLockManager redisLockManager; |
| | | |
| | | /** |
| | | * #p0 æ è¯å第ä¸ä¸ªåæ°ä¸ºrediséçkey |
| | | */ |
| | | @GetMapping("/getLock") |
| | | @GetMapping("/testLock1") |
| | | @RedisLock(expireTime = 10, key = "#p0") |
| | | public AjaxResult<String> getLock(String key, String value) { |
| | | public AjaxResult<String> testLock1(String key, String value) { |
| | | try { |
| | | // åæ¶è¯·æ±æé |
| | | // Thread.sleep(5000); |
| | |
| | | } |
| | | return AjaxResult.success("æä½æå",value); |
| | | } |
| | | |
| | | /** |
| | | * æµè¯éå·¥å
·ç±» |
| | | */ |
| | | @GetMapping("/testLock2") |
| | | public AjaxResult<Void> testLock(String key, Long time) { |
| | | try { |
| | | boolean flag = redisLockManager.getLock(key, time, TimeUnit.SECONDS); |
| | | if (flag) { |
| | | log.info("è·åéæå: " + key); |
| | | Thread.sleep(3000); |
| | | redisLockManager.unLock(key); |
| | | log.info("éæ¾éæå: " + key); |
| | | } else { |
| | | log.error("è·åé失败: " + key); |
| | | } |
| | | } catch (InterruptedException e) { |
| | | log.error(e.getMessage()); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * æµè¯spring-cache注解 |
| | | */ |
| | | @Cacheable(value = "test", key = "#key") |
| | | @GetMapping("/testCache") |
| | | public AjaxResult<String> testCache(String key) { |
| | | return AjaxResult.success("æä½æå", key); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.demo.mapper; |
| | | |
| | | import com.ruoyi.demo.domain.TestDemo; |
| | | import com.ruoyi.common.core.mybatisplus.MybatisPlusRedisCache; |
| | | import com.ruoyi.common.core.page.BaseMapperPlus; |
| | | import com.ruoyi.demo.domain.TestDemo; |
| | | import org.apache.ibatis.annotations.CacheNamespace; |
| | | |
| | | /** |
| | | * æµè¯å表Mapperæ¥å£ |
| | |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class) |
| | | public interface TestDemoMapper extends BaseMapperPlus<TestDemo> { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.demo.mapper; |
| | | |
| | | import com.ruoyi.demo.domain.TestTree; |
| | | import com.ruoyi.common.core.mybatisplus.MybatisPlusRedisCache; |
| | | import com.ruoyi.common.core.page.BaseMapperPlus; |
| | | import com.ruoyi.demo.domain.TestTree; |
| | | import org.apache.ibatis.annotations.CacheNamespace; |
| | | |
| | | /** |
| | | * æµè¯æ 表Mapperæ¥å£ |
| | |
| | | * @author Lion Li |
| | | * @date 2021-05-30 |
| | | */ |
| | | @CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class) |
| | | public interface TestTreeMapper extends BaseMapperPlus<TestTree> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.annotation.RedisLock; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.redis.RedisLockManager; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | |
| | | public class RedisLockAspect { |
| | | |
| | | @Autowired |
| | | private RedissonClient redissonClient; |
| | | private RedisLockManager redisLockManager; |
| | | |
| | | @Pointcut("@annotation(com.ruoyi.common.annotation.RedisLock)") |
| | | public void annotationPointcut() { |
| | |
| | | key = Constants.REDIS_LOCK_KEY + key; |
| | | Object res; |
| | | try { |
| | | if (acquire(key, expireTime, TimeUnit.SECONDS)) { |
| | | if (redisLockManager.getLock(key, expireTime, TimeUnit.SECONDS)) { |
| | | log.info("lock => key : " + key + " , ThreadName : " + Thread.currentThread().getName()); |
| | | try { |
| | | res = joinPoint.proceed(); |
| | | return res; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } finally { |
| | | release(key); |
| | | redisLockManager.unLock(key); |
| | | log.info("unlock => key : " + key + " , ThreadName : " + Thread.currentThread().getName()); |
| | | } |
| | | } else { |
| | | throw new RuntimeException("redisåå¸å¼éæ³¨è§£åæ°å¼å¸¸"); |
| | |
| | | } |
| | | } |
| | | return listPar; |
| | | } |
| | | |
| | | /** |
| | | * å éï¼RLockï¼å¸¦è¶
æ¶æ¶é´ç |
| | | */ |
| | | private boolean acquire(String key, long expire, TimeUnit expireUnit) { |
| | | try { |
| | | //è·åé对象 |
| | | RLock mylock = redissonClient.getLock(key); |
| | | //å éï¼å¹¶ä¸è®¾ç½®éè¿ææ¶é´ï¼é²æ¢æ»éç产ç |
| | | mylock.tryLock(expire, expire, expireUnit); |
| | | } catch (InterruptedException e) { |
| | | return false; |
| | | } |
| | | log.info("lock => key : " + key + " , ThreadName : " + Thread.currentThread().getName()); |
| | | //å éæå |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * éçéæ¾ |
| | | */ |
| | | private void release(String lockName) { |
| | | //è·åæå¯¹è±¡ |
| | | RLock mylock = redissonClient.getLock(lockName); |
| | | //éæ¾éï¼è§£éï¼ |
| | | mylock.unlock(); |
| | | log.info("unlock => key : " + lockName + " , ThreadName : " + Thread.currentThread().getName()); |
| | | } |
| | | |
| | | } |
| | |
| | | import java.util.concurrent.Executor; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | /** |
| | | * 弿¥é
ç½® |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @EnableAsync |
| | | @Configuration |
| | | public class AsyncConfig extends AsyncConfigurerSupport { |
| | |
| | | import org.redisson.api.RedissonClient; |
| | | import org.redisson.codec.JsonJacksonCodec; |
| | | import org.redisson.config.Config; |
| | | import org.redisson.spring.cache.CacheConfig; |
| | | import org.redisson.spring.cache.RedissonSpringCacheManager; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
| | | import org.springframework.boot.autoconfigure.data.redis.RedisProperties; |
| | | import org.springframework.cache.CacheManager; |
| | | import org.springframework.cache.annotation.CachingConfigurerSupport; |
| | | import org.springframework.cache.annotation.EnableCaching; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * redisé
ç½® |
| | |
| | | .setDnsMonitoringInterval(singleServerConfig.getDnsMonitoringInterval()); |
| | | return Redisson.create(config); |
| | | } |
| | | |
| | | /** |
| | | * æ´åspring-cache |
| | | */ |
| | | @Bean |
| | | public CacheManager cacheManager(RedissonClient redissonClient) { |
| | | Map<String, CacheConfig> config = new HashMap<>(); |
| | | config.put("redissonCacheMap", new CacheConfig(30*60*1000, 10*60*1000)); |
| | | return new RedissonSpringCacheManager(redissonClient, config, JsonJacksonCodec.INSTANCE); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * éç¨é
ç½® |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Configuration |
| | |
| | | registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + RuoYiConfig.getProfile() + "/"); |
| | | |
| | | /** swaggeré
ç½® */ |
| | | registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); |
| | | registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/"); |
| | | } |
| | | |
| | | /** |
| | |
| | | source.registerCorsConfiguration("/**", config); |
| | | return new CorsFilter(source); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; |
| | | import com.ruoyi.framework.config.properties.SwaggerProperties; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spi.service.contexts.SecurityContext; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Swagger2çæ¥å£é
ç½® |
| | | * Swagger ææ¡£é
ç½® |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @Configuration |
| | | @EnableSwagger2 |
| | | @EnableKnife4j |
| | | public class SwaggerConfig { |
| | | |
| | |
| | | */ |
| | | @Bean |
| | | public Docket createRestApi() { |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | return new Docket(DocumentationType.OAS_30) |
| | | .enable(swaggerProperties.getEnabled()) |
| | | // ç¨æ¥å建该APIçåºæ¬ä¿¡æ¯ï¼å±ç¤ºå¨ææ¡£ç页é¢ä¸ï¼èªå®ä¹å±ç¤ºçä¿¡æ¯ï¼ |
| | | .apiInfo(apiInfo()) |
| | |
| | | */ |
| | | private List<SecurityScheme> securitySchemes() { |
| | | List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>(); |
| | | apiKeyList.add(new ApiKey("Authorization", "Authorization", "header")); |
| | | apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue())); |
| | | return apiKeyList; |
| | | } |
| | | |
| | |
| | | securityContexts.add( |
| | | SecurityContext.builder() |
| | | .securityReferences(defaultAuth()) |
| | | .forPaths(PathSelectors.regex("^(?!auth).*$")) |
| | | .operationSelector(o -> o.requestMappingPattern().matches("/.*")) |
| | | .build()); |
| | | return securityContexts; |
| | | } |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * éªè¯ç é
ç½®å±æ§ |
| | | * swagger é
ç½®å±æ§ |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * éªè¯ç é
ç½®å±æ§ |
| | | * çº¿ç¨æ± é
ç½®å±æ§ |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * token é
ç½®å±æ§ |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @Data |
| | | @Component |
| | | @ConfigurationProperties(prefix = "token") |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * éªè¯ç é
ç½®å±æ§ |
| | | * xssè¿æ»¤ é
ç½®å±æ§ |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | |
| | | |
| | | /** |
| | | * ${functionName}Controller |
| | | * |
| | | * |
| | | * @author ${author} |
| | | * @date ${datetime} |
| | | */ |
| | |
| | | @ApiOperation("æ°å¢${functionName}") |
| | | @PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')") |
| | | @Log(title = "${functionName}", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit |
| | | @PostMapping() |
| | | public AjaxResult<Void> add(@Validated @RequestBody ${ClassName}AddBo bo) { |
| | | return toAjax(i${ClassName}Service.insertByAddBo(bo) ? 1 : 0); |
| | |
| | | @ApiOperation("ä¿®æ¹${functionName}") |
| | | @PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')") |
| | | @Log(title = "${functionName}", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit |
| | | @PutMapping() |
| | | public AjaxResult<Void> edit(@Validated @RequestBody ${ClassName}EditBo bo) { |
| | | return toAjax(i${ClassName}Service.updateByEditBo(bo) ? 1 : 0); |
| | |
| | | |
| | | import ${packageName}.domain.${ClassName}; |
| | | import com.ruoyi.common.core.page.BaseMapperPlus; |
| | | import com.ruoyi.common.core.mybatisplus.MybatisPlusRedisCache; |
| | | import org.apache.ibatis.annotations.CacheNamespace; |
| | | |
| | | /** |
| | | * ${functionName}Mapperæ¥å£ |
| | |
| | | * @author ${author} |
| | | * @date ${datetime} |
| | | */ |
| | | @CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class) |
| | | public interface ${ClassName}Mapper extends BaseMapperPlus<${ClassName}> { |
| | | |
| | | } |
| | |
| | | this.loading = false;
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | })
|
| | | }).catch(() => {});
|
| | | }
|
| | | }
|
| | | };
|
| | |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | #if($table.sub) |
| | | /** ${subTable.functionName}åºå· */ |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | |
| | | { |
| | | "name": "ruoyi-vue-plus", |
| | | "version": "2.3.1", |
| | | "version": "2.3.2", |
| | | "description": "RuoYi-Vue-Plusåå°ç®¡çç³»ç»", |
| | | "author": "LionLi", |
| | | "license": "MIT", |
| | |
| | | [{ color: [] }, { background: [] }], // åä½é¢è²ãåä½èæ¯é¢è² |
| | | [{ align: [] }], // 坹齿¹å¼ |
| | | ["clean"], // æ¸
é¤ææ¬æ ¼å¼ |
| | | ["link", "image"] // 龿¥ãå¾ç |
| | | ["link", "image", "video"] // 龿¥ãå¾çãè§é¢ |
| | | ], |
| | | }, |
| | | placeholder: "请è¾å
¥å
容", |
| | |
| | | <div class="right-menu"> |
| | | <template v-if="device!=='mobile'"> |
| | | <search id="header-search" class="right-menu-item" /> |
| | | |
| | | |
| | | <el-tooltip content="æºç å°å" effect="dark" placement="bottom"> |
| | | <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" /> |
| | | </el-tooltip> |
| | |
| | | this.$store.dispatch('LogOut').then(() => { |
| | | location.href = '/index'; |
| | | }) |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | } |
| | |
| | | store.dispatch('LogOut').then(() => { |
| | | location.href = '/index'; |
| | | }) |
| | | }) |
| | | }).catch(() => {}); |
| | | } else if (code === 500) { |
| | | Message({ |
| | | message: msg, |
| | |
| | | <span>æ´æ°æ¥å¿</span> |
| | | </div> |
| | | <el-collapse accordion> |
| | | <el-collapse-item title="v2.3.2 - 2021-6-11"> |
| | | <ol> |
| | | <li>add rediséå·¥å
·ç±»ç¼å</li> |
| | | <li>update spring-cache æ´å redisson</li> |
| | | <li>update MybatisPlusæ´åRedisäºçº§ç¼å</li> |
| | | <li>update swagger å级为 3.0.0 ä½¿ç¨ OAS_30 åè®®</li> |
| | | <li>update ä¼å 代ç çæå¨ å¢å 表åé²é注解</li> |
| | | <li>update ä¼å éåé¢ä»£ç keyå°å¸¸éç±»</li> |
| | | <li>fix ä¿®å¤ç¸å¯¹è·¯å¾ä¸ä¼ å¼å¸¸é®é¢</li> |
| | | </ol> |
| | | </el-collapse-item> |
| | | <el-collapse-item title="v2.3.1 - 2021-6-4"> |
| | | <ol> |
| | | <li>add å¢å redisson åå¸å¼é 注解ä¸demoæ¡ä¾</li> |
| | |
| | | return runJob(row.jobId, row.jobGroup); |
| | | }).then(() => { |
| | | this.msgSuccess("æ§è¡æå"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** ä»»å¡è¯¦ç»ä¿¡æ¯ */ |
| | | handleView(row) { |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** æ¸
空æé®æä½ */ |
| | | handleClean() { |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("æ¸
空æå"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** æ¸
空æé®æä½ */ |
| | | handleClean() { |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("æ¸
空æå"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("强éæå"); |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** æ¸
空æé®æä½ */ |
| | | handleClean() { |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("æ¸
空æå"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å·æ°ç¼åæé®æä½ */ |
| | | handleRefreshCache() { |
| | |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:dept:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-plus" |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-plus" |
| | | @click="handleAdd(scope.row)" |
| | | v-hasPermi="['system:dept:add']" |
| | | >æ°å¢</el-button> |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | </script> |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å·æ°ç¼åæé®æä½ */ |
| | | handleRefreshCache() { |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item v-if="form.menuType != 'M'" label="æéæ è¯"> |
| | | <el-input v-model="form.perms" placeholder="请æéæ è¯" maxlength="100" /> |
| | | <el-input v-model="form.perms" placeholder="请è¾å
¥æéæ è¯" maxlength="100" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | |
| | | }).then(response => { |
| | | this.download(response.msg); |
| | | this.exportLoading = false; |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** 导å
¥æé®æä½ */ |
| | | handleImport() { |
| | |
| | | return synchDb(tableName); |
| | | }).then(() => { |
| | | this.msgSuccess("忥æå"); |
| | | }) |
| | | }).catch(() => {}); |
| | | }, |
| | | /** æå¼å¯¼å
¥è¡¨å¼¹çª */ |
| | | openImportTable() { |
| | |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |