在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答
胭脂淚 回答

google 了一晚上,終于找到了比較滿意的方法,下面是整個的 RedisCacheConfig 文件

@Configuration
public class RedisCacheConfig {

    @Bean
    public KeyGenerator simpleKeyGenerator() {
        return (o, method, objects) -> {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append(o.getClass().getSimpleName());
            stringBuilder.append(".");
            stringBuilder.append(method.getName());
            stringBuilder.append("[");
            for (Object obj : objects) {
                stringBuilder.append(obj.toString());
            }
            stringBuilder.append("]");

            return stringBuilder.toString();
        };
    }

    @Bean
    public CacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) {
        return new RedisCacheManager(
            RedisCacheWriter.nonLockingRedisCacheWriter(redisConnectionFactory),
            this.getRedisCacheConfigurationWithTtl(600), // 默認策略,未配置的 key 會使用這個
            this.getRedisCacheConfigurationMap() // 指定 key 策略
        );
    }

    private Map<String, RedisCacheConfiguration> getRedisCacheConfigurationMap() {
        Map<String, RedisCacheConfiguration> redisCacheConfigurationMap = new HashMap<>();
        redisCacheConfigurationMap.put("UserInfoList", this.getRedisCacheConfigurationWithTtl(3000));
        redisCacheConfigurationMap.put("UserInfoListAnother", this.getRedisCacheConfigurationWithTtl(18000));

        return redisCacheConfigurationMap;
    }

    private RedisCacheConfiguration getRedisCacheConfigurationWithTtl(Integer seconds) {
        Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
        ObjectMapper om = new ObjectMapper();
        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
        jackson2JsonRedisSerializer.setObjectMapper(om);

        RedisCacheConfiguration redisCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig();
        redisCacheConfiguration = redisCacheConfiguration.serializeValuesWith(
            RedisSerializationContext
                .SerializationPair
                .fromSerializer(jackson2JsonRedisSerializer)
        ).entryTtl(Duration.ofSeconds(seconds));

        return redisCacheConfiguration;
    }
}

要指定 key 的過期時間,只要在getRedisCacheConfigurationMap方法中添加就可以。
然后只需要 @Cacheable 就可以把數(shù)據(jù)存入 redis

    @Cacheable(value = "UserInfoList", keyGenerator = "simpleKeyGenerator") // 3000秒
    @Cacheable(value = "UserInfoListAnother", keyGenerator = "simpleKeyGenerator") // 18000秒
    @Cacheable(value = "DefaultKeyTest", keyGenerator = "simpleKeyGenerator") // 600秒,未指定的key,使用默認策略
    
淚染裳 回答

router 是否使用 vue-router 的模式,啟用該模式會在激活導航時以 index 作為 path 進行路由跳轉(zhuǎn)

把這個屬性設置成true

element官網(wǎng)

薔薇花 回答

其實直接

print(p1);

就可以

哚蕾咪 回答

你代碼中的外部變量是,大寫的 Vue 和 Router

胭脂淚 回答

我在 stack overflow 找到了前人問題程答案:
https://stackoverflow.com/que...

"When an 'r' or 'R' prefix is present, a character following a backslash is included in the string without change, and all backslashes are left in the string. ......."
上面錯誤已刪
已作修改:
所以我想,可能因為在r''中,反斜杠后面的 ' 被當作字符保留了而且是一般字符,因而是失去了功能。
又或者是因為,例如r"abc" , 先生成"abc" 字符串,然後才加上r再處理, 如果r"反斜杠"就出現(xiàn)生成字符串失敗。

Doc. Python 里面建意r"反斜杠""

抱歉,反斜杠不見了,希望你
https://docs.python.org/2.0/r...
Doc.python 有陳述

有你在 回答

已解決。

@Configuration
@EnableResourceServer
public class ResourceServerConfiguration
        extends ResourceServerConfigurerAdapter {
    @Override
    public void configure(HttpSecurity http) throws Exception {
        http
            .requestMatchers()
                .antMatchers("/api/**")
                .and()
                .authorizeRequests()
                .antMatchers("/api/**")
                .authenticated();
    }
}
陌如玉 回答

使用Promise進行對APP.js內(nèi)的進行l(wèi)ogin的方法進行一次封裝后,在index.js內(nèi)調(diào)用app內(nèi)封裝的那個方法后拿到所需值然后對全局的那個globalData進行賦值,如果還有不明白的 明天到公司 我給你上代碼。

掛念你 回答

批量插入啊, 一次1000條

executemany

孤慣 回答

Object.prototype.__proto__,事實證明可以使用

function ClassA(name) {
      this.name = name
    }

    ClassA.prototype.sayName = function () {
      alert(this.name)
    }

    function ClassB(name, age) {
      ClassA.call(this, name)
      this.age = age
    }

    ClassB.prototype.__proto__ = ClassA.prototype

    ClassB.prototype.sayAge = function () {
      alert(this.age)
    }

    let instance = new ClassB('小明', 11)
    instance.sayName(); //小明
    instance.sayAge();  //11
熊出沒 回答
  1. css里加個class,就比如叫.stop-click吧。樣式:

    .stop-click {
        pointer-events: none;
    }
  2. 用的時候,給body套上這個class,不用了以后去掉就好。
  3. 確實有點像節(jié)流場景,考慮下
墨小白 回答

<view wx:for='{{logs.src}}'>

  <image src="https://yffice.com{{logs.src[index]}}" class="slide-image" />
</view>
這樣寫就可以了
忘了我 回答
  1. 這樣看,a聲明了,但沒有定義

    var a;
    console.log(a); // undefined
    console.log(b); // b 沒有聲明
    b = 10;
    a = 20;
  2. b沒有定義,直接是掛載在window下面的
扯機薄 回答

func()?哪來的func()?能不能把你的代碼補充完整,包括你在哪里用了this,并且把你期望這個this指向哪個對象也補上。我猜你可能用了箭頭函數(shù),箭頭函數(shù)沒有this關(guān)鍵字哦。

我試了一下以下代碼(手機上只有node,node的原型是__proto__。瀏覽器上跑不方便)

function Graph() {}

var Graph = new Graph();

Graph.__proto__.foo = function() {
  console.log('old foo', this);
  return this;
}

Graph.__proto__.fun = function() {
  console.log('old fun', this);
  return this;
}

Graph.__proto__.foo = function() {
  console.log('new foo', this);
  function subfoo() {
    console.log('subfoo', this);
    this.fun();
    return this;
  }
  subfoo.call(this);
  return this;
}

Graph.foo();

結(jié)果是

new foo Graph {}
subfoo Graph {}
old fun Graph {}
Graph {}

非常的正常,不知道你有沒有漏了什么信息沒有提供的,當然也有可能是瀏覽器和node的差別。另外你在什么瀏覽器上測試的?我中午或下午可以在瀏覽器上測試一下。

九年囚 回答

比如

document.body.innerHTML='<img />&lt;img /&gt;'

一個被作為img元素 一個作為字符串顯示

青檸 回答

你就把相關(guān)的容器直接start不就好了嗎。

瘋浪 回答

rxjs唄,你需要哪個導哪個

孤影 回答

(function(){

var foo = "x";
(function(a){
    a="y";
})(foo);
return foo;

})();
你那個等價于這個 這樣應該易懂一點吧

舊酒館 回答

你看一下這兩個文件差異不就知道了嗎。

<link rel="stylesheet"  integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> 
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">