三级菜单缓存的Redisson分布式锁方案+Spring Cache

This commit is contained in:
Kirk Lin 2021-06-24 16:50:42 +08:00
parent 4450485901
commit edcbf45be2
12 changed files with 546 additions and 195 deletions

View file

@ -47,6 +47,17 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!-- Redisson分布式锁-->
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>3.12.5</version>
</dependency>
<!-- Spring-Cache-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>

View file

@ -0,0 +1,57 @@
package name.lkk.kkmall.product.config;
import org.springframework.boot.autoconfigure.cache.CacheProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializationContext;
import org.springframework.data.redis.serializer.StringRedisSerializer;
/**
* @author: kirklin
* @date: 2021/6/24 3:32 下午
* @description:Spring Cache配置
*/
@Configuration
@EnableCaching
@EnableConfigurationProperties(CacheProperties.class)
public class MallCacheConfig {
/**
* 配置文件中 TTL设置没用上
*
* 原来:
* @ConfigurationProperties(prefix = "spring.cache")
* public class CacheProperties
*
* 现在要让这个配置文件生效 : @EnableConfigurationProperties(CacheProperties.class)
*
*/
@Bean
RedisCacheConfiguration redisCacheConfiguration(CacheProperties cacheProperties){
RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig();
// 设置kv的序列化机制
config = config.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()));
config = config.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer()));
CacheProperties.Redis redisProperties = cacheProperties.getRedis();
// 设置配置
if(redisProperties.getTimeToLive() != null){
config = config.entryTtl(redisProperties.getTimeToLive());
}
if(redisProperties.getKeyPrefix() != null){
config = config.prefixCacheNameWith(redisProperties.getKeyPrefix());
}
if(!redisProperties.isCacheNullValues()){
config = config.disableCachingNullValues();
}
if(!redisProperties.isUseKeyPrefix()){
config = config.disableKeyPrefix();
}
return config;
}
}

View file

@ -0,0 +1,29 @@
package name.lkk.kkmall.product.config;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author: kirklin
* @date: 2021/6/23 8:43 下午
* @description:
*/
@Configuration
public class MallRedissonConfig {
@Value("${spring.redis.host}")
private String redisHost;
@Value("${spring.redis.port}")
private String redisPort;
@Bean(destroyMethod = "shutdown")
public RedissonClient redisson() {
Config config = new Config();
config.useSingleServer().setAddress("redis://"+redisHost+":"+redisPort);
return Redisson.create(config);
}
}

View file

@ -14,7 +14,11 @@ import name.lkk.kkmall.product.service.CategoryBrandRelationService;
import name.lkk.kkmall.product.service.CategoryService;
import name.lkk.kkmall.product.vo.Catalog3Vo;
import name.lkk.kkmall.product.vo.Catelog2Vo;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.data.redis.core.script.DefaultRedisScript;
@ -36,6 +40,9 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
@Autowired
private StringRedisTemplate stringRedisTemplate;
@Autowired
private RedissonClient redissonClient;
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<CategoryEntity> page = this.page(
@ -83,7 +90,9 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
// TODO 检查当前节点是否被别的地方引用
baseMapper.deleteBatchIds(asList);
}
/**
* 找到catalogId 完整路径
*/
@Override
public Long[] findCateLogPath(Long catelogId) {
List<Long> paths = new ArrayList<>();
@ -92,7 +101,37 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
Collections.reverse(paths);
return paths.toArray(new Long[paths.size()]);
}
/**
* 递归收集所有节点
*/
private List<Long> findParentPath(Long catlogId, List<Long> paths) {
// 1收集当前节点id
paths.add(catlogId);
CategoryEntity byId = this.getById(catlogId);
if (byId.getParentCid() != 0) {
findParentPath(byId.getParentCid(), paths);
}
return paths;
}
/**
* 级联更新所有数据 [分区名默认是就是缓存的前缀] SpringCache: 不加锁
*
* @CacheEvict: 缓存失效模式 --- 页面一修改 然后就清除这两个缓存
* key = "'getLevel1Categorys'" : 记得加单引号 [子解析字符串]
*
* @Caching: 同时进行多种缓存操作
*
* @CacheEvict(value = {"category"}, allEntries = true) : 删除这个分区所有数据
*
* @CachePut: 这次查询操作写入缓存
*/
// @Caching(evict = {
// @CacheEvict(value = {"category"}, key = "'getLevel1Categorys'"),
// @CacheEvict(value = {"category"}, key = "'getCatelogJson'")
// })
@CacheEvict(value = {"category"}, allEntries = true)
// @CachePut
@Transactional
@Override
public void updateCascade(CategoryEntity category) {
@ -100,6 +139,21 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
categoryBrandRelationService.updateCategory(category.getCatId(), category.getName());
}
/**
* @Cacheable: 当前方法的结果需要缓存 并指定缓存名字
* 缓存的value值 默认使用jdk序列化
* 默认ttl时间 -1
* key: 里面默认会解析表达式 字符串用 ''
*
* 自定义:
* 1.指定生成缓存使用的key
* 2.指定缓存数据存活时间 [配置文件中修改]
* 3.将数据保存为json格式
*
* sync = true: --- 开启同步锁非分布式锁
*
*/
@Cacheable(value = {"category"}, key = "#root.method.name", sync = true)
@Override
public List<CategoryEntity> getLevel1Categories() {
return baseMapper.selectList(new QueryWrapper<CategoryEntity>().eq("cat_level", 1));
@ -113,12 +167,43 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
return entityList.stream().filter(item -> item.getParentCid().equals(parentCid)).collect(Collectors.toList());
}
/**
* 从缓存中查询CatelogJson
* @return
*/
@Cacheable(value = {"category"}, key = "#root.methodName")
@Override
public Map<String, List<Catelog2Vo>> getCatelogJson() {
List<CategoryEntity> entityList = baseMapper.selectList(null);
// 查询所有一级分类
List<CategoryEntity> level1 = getCategoryEntities(entityList, 0L);
Map<String, List<Catelog2Vo>> parent_cid = level1.stream().collect(Collectors.toMap(k -> k.getCatId().toString(), v -> {
// 拿到每一个一级分类 然后查询他们的二级分类
List<CategoryEntity> entities = getCategoryEntities(entityList, v.getCatId());
List<Catelog2Vo> catelog2Vos = null;
if (entities != null) {
catelog2Vos = entities.stream().map(l2 -> {
Catelog2Vo catelog2Vo = new Catelog2Vo(v.getCatId().toString(), l2.getName(), l2.getCatId().toString(), null);
// 找当前二级分类的三级分类
List<CategoryEntity> level3 = getCategoryEntities(entityList, l2.getCatId());
// 三级分类有数据的情况下
if (level3 != null) {
List<Catalog3Vo> catalog3Vos = level3.stream().map(l3 -> new Catalog3Vo(l3.getCatId().toString(), l3.getName(), l2.getCatId().toString())).collect(Collectors.toList());
catelog2Vo.setCatalog3List(catalog3Vos);
}
return catelog2Vo;
}).collect(Collectors.toList());
}
return catelog2Vos;
}));
return parent_cid;
}
/**
* 自定义实现从缓存中查询CatelogJson
* @return
*/
// @Override
public Map<String, List<Catelog2Vo>> getCatelogJsonManual() {
/**
* 1.空结果缓存 解决缓存穿透
@ -140,6 +225,27 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
return catelogJson;
}
/**
* redisson 微服务集群锁
* 缓存中的数据如何与数据库保持一致
* 1双写2设置过期
*/
public Map<String, List<Catelog2Vo>> getCatelogJsonFromDBWithRedissonLock() {
// 这里只要锁的名字一样那锁就是一样的
// 关于锁的粒度 具体缓存的是某个数据 例如: 11-号商品 product-11-lock
RLock lock = redissonClient.getLock("CatelogJson-lock");
lock.lock();
Map<String, List<Catelog2Vo>> data;
try {
data = getCatelogJsonFormDB();
} finally {
lock.unlock();
}
return data;
}
/**
* 分布式锁
*
@ -262,16 +368,5 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
}
}
/**
* 递归收集所有节点
*/
private List<Long> findParentPath(Long catlogId, List<Long> paths) {
// 1收集当前节点id
paths.add(catlogId);
CategoryEntity byId = this.getById(catlogId);
if (byId.getParentCid() != 0) {
findParentPath(byId.getParentCid(), paths);
}
return paths;
}
}

View file

@ -3,15 +3,19 @@ package name.lkk.kkmall.product.web;
import name.lkk.kkmall.product.entity.CategoryEntity;
import name.lkk.kkmall.product.service.CategoryService;
import name.lkk.kkmall.product.vo.Catelog2Vo;
import org.redisson.api.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* @author: kirklin
@ -24,12 +28,24 @@ public class IndexController {
@Autowired
private CategoryService categoryService;
@RequestMapping("/hello")
@ResponseBody
public String hello(){
return "Hello";
}
@Autowired
private RedissonClient redissonClient;
@Autowired
private StringRedisTemplate stringRedisTemplate;
// @RequestMapping("/hello")
// @ResponseBody
// public String hello(){
// return "Hello";
// }
/**
* 首页转发
* @param model
* @return
*/
@RequestMapping({"/", "index", "/index.html"})
public String indexPage(Model model) {
// 获取一级分类所有缓存
@ -49,4 +65,122 @@ public class IndexController {
Map<String, List<Catelog2Vo>> map = categoryService.getCatelogJson();
return map;
}
/**
* RLock锁有看门狗机制 会自动帮我们续期默认三秒自动过期
* lock.lock(10,TimeUnit.SECONDS);
* 锁的时间一定要大于业务的时间 否则会出现死锁的情况
*
* 如果我们传递了锁的超时时间就给redis发送超时脚本 默认超时时间就是我们指定的
* 如果我们未指定就使用 30 * 1000 [LockWatchdogTimeout]
* 只要占锁成功 就会启动一个定时任务 任务就是重新给锁设置过期时间
* 这个时间还是 [LockWatchdogTimeout] 的时间 1/3 看门狗的时间续期一次 续成满时间
*/
@ResponseBody
@RequestMapping("/index/hello")
public String hello() {
RLock lock = redissonClient.getLock("my-lock");
// 阻塞式等待
lock.lock();
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
lock.unlock();
}
return "hello";
}
//============================================信号量=========================================
/**
* 尝试获取车位 [信号量]
* 信号量:也可以用作限流
*/
@ResponseBody
@GetMapping("/index/park")
public String park() {
RSemaphore park = redissonClient.getSemaphore("park");
boolean acquire = park.tryAcquire();
return "获取车位 =>" + acquire;
}
/**
* 尝试获取车位
*/
@ResponseBody
@GetMapping("/index/go/park")
public String goPark() {
RSemaphore park = redissonClient.getSemaphore("park");
park.release();
return "ok => 车位+1";
}
//============================================读写锁=========================================
/**
* 读写锁-读锁
*/
@GetMapping("/index/read")
@ResponseBody
public String readValue() {
RReadWriteLock lock = redissonClient.getReadWriteLock("rw-lock");
RLock rLock = lock.readLock();
String s = "";
rLock.lock();
try {
s = stringRedisTemplate.opsForValue().get("writeValue");
} catch (Exception e) {
e.printStackTrace();
} finally {
rLock.unlock();
}
return s;
}
/**
* 读写锁-写锁
*/
@GetMapping("/index/write")
@ResponseBody
public String writeValue() {
RReadWriteLock lock = redissonClient.getReadWriteLock("rw-lock");
RLock rLock = lock.writeLock();
String s = "";
try {
rLock.lock();
s = UUID.randomUUID().toString();
Thread.sleep(3000);
stringRedisTemplate.opsForValue().set("writeValue", s);
} catch (Exception e) {
e.printStackTrace();
} finally {
rLock.unlock();
}
return s;
}
//============================================闭锁=========================================
/**
* 闭锁 只有设定的人全通过才关门
*/
@ResponseBody
@GetMapping("/index/lockDoor")
public String lockDoor() throws InterruptedException {
RCountDownLatch door = redissonClient.getCountDownLatch("door");
// 设置这里有5个人
door.trySetCount(5);
door.await();
return "5个人全部通过了...";
}
@ResponseBody
@GetMapping("/index/go/{id}")
public String go(@PathVariable("id") Long id) throws InterruptedException {
RCountDownLatch door = redissonClient.getCountDownLatch("door");
// 每访问一次相当于出去一个人
door.countDown();
return id + "走了";
}
}

View file

@ -1,8 +1,9 @@
ipAddr: localhost
spring:
datasource:
#MySQL配置
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/kkmall_pms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
url: jdbc:mysql://${ipAddr}:3306/kkmall_pms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: 66CcFf!!
cloud:
@ -18,11 +19,26 @@ spring:
static-path-pattern: /static/**
thymeleaf:
cache: true
suffix: .html
prefix: classpath:/templates/
redis:
host: localhost
host: ${ipAddr}
port: 6379
password: linkekun
# 设置缓存类型
cache:
type: redis
# 设置存活时间
redis:
time-to-live: 3600000
# 如果指定了前缀就用我们指定的 如果没有就用缓存的名字作为前缀
# key-prefix: CACHE_
# 是否缓存空值,解决缓存穿透问题
cache-null-values: true
# cache-names:
mybatis-plus:
mapper-locations: classpath:/mapper/**/*.xml
global-config:

View file

@ -93,20 +93,20 @@
<ul>
<li th:if="${session.loginUser} !=null">
<a>欢迎,[[${session.loginUser.username}]]</a>
<!-- <a th:href="'http://member.glmall.com/user/' + ${session.loginUser.id}+ '.html'">你好,[[${session.loginUser.username}]]</a>-->
<!-- <a th:href="'http://member.kkmall.com/user/' + ${session.loginUser.id}+ '.html'">你好,[[${session.loginUser.username}]]</a>-->
</li>
<li th:if="${session.loginUser} !=null">
<a href="http://auth.glmall.com/oauth2.0/logout">退出登录</a>
<a href="http://auth.kkmall.com/oauth2.0/logout">退出登录</a>
</li>
<li th:if="${session.loginUser} ==null">
<a href="http://auth.glmall.com/login.html">你好,请登录 </a>
<a href="http://auth.kkmall.com/login.html">你好,请登录 </a>
</li>
<li th:if="${session.loginUser} ==null">
<a href="http://auth.glmall.com/reg.html" class="li_2">免费注册</a>
<a href="http://auth.kkmall.com/reg.html" class="li_2">免费注册</a>
</li>
<span>|</span>
<li th:if="${session.loginUser} !=null">
<a href="http://member.glmall.com/memberOrder.html">我的订单</a>
<a href="http://member.kkmall.com/memberOrder.html">我的订单</a>
</li>
</ul>
</div>
@ -122,7 +122,7 @@
<div class="header_ico">
<div class="header_gw">
<img src="/static/index/img/img_15.png" />
<span><a href="http://cart.glmall.com/cart.html">我的购物车</a></span>
<span><a href="http://cart.kkmall.com/cart.html">我的购物车</a></span>
<span>0</span>
</div>
<div class="header_ko">
@ -580,13 +580,13 @@
<script type="text/javascript">
function search() {
var keyword=$("#searchText").val()
window.location.href="http://search.glmall.com/list.html?keyword="+keyword;
window.location.href="http://search.kkmall.com/list.html?keyword="+keyword;
}
function to_href(skuId){
location.href = "http://item.glmall.com/" + skuId + ".html";
location.href = "http://item.kkmall.com/" + skuId + ".html";
}
$.get("http://seckill.glmall.com/currentSeckillSkus",function (resp) {
$.get("http://seckill.kkmall.com/currentSeckillSkus",function (resp) {
if(resp.data.length > 0){
resp.data.forEach(function (item) {
$("<li onclick='to_href(" + item.skuId + ")'></li>")

View file

@ -16,221 +16,221 @@
<div class="min">
<ul class="header_ul_left">
<li class="glyphicon glyphicon-home"> <a href="/" class="aa">京东首页</a></li>
<li class="glyphicon glyphicon-map-marker"> <a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">北京</a>
<li class="glyphicon glyphicon-map-marker"> <a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">北京</a>
<ol id="beijing">
<li style="background: red;"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" style="color: white;">北京</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">上海</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">天津</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">重庆</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">河北</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">山西</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">河南</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">辽宁</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">吉林</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">黑龙江</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">内蒙古</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">江苏</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">山东</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">安徽</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">浙江</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">福建</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">湖北</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">湖南</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">广东</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">广西</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">江西</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">四川</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">海南</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">贵州</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">云南</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">西藏</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">陕西</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">甘肃</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">青海</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">宁夏</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">新疆</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">港澳</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">台湾</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">钓鱼岛</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">海外</a></li>
<li style="background: red;"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" style="color: white;">北京</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">上海</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">天津</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">重庆</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">河北</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">山西</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">河南</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">辽宁</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">吉林</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">黑龙江</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">内蒙古</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">江苏</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">山东</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">安徽</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">浙江</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">福建</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">湖北</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">湖南</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">广东</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">广西</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">江西</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">四川</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">海南</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">贵州</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">云南</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">西藏</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">陕西</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">甘肃</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">青海</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">宁夏</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">新疆</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">港澳</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">台湾</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">钓鱼岛</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">海外</a></li>
</ol>
</li>
</ul>
<ul class="header_ul_right">
<li style="border: 0;" th:if="${session.loginUser} !=null">
<a class="aa" style="width: 100px">[[${session.loginUser.username}]]</a>
<!-- <a th:href="'http://member.glmall.com/user/' + ${session.loginUser.id}+ '.html'">你好,[[${session.loginUser.username}]]</a>-->
<!-- <a th:href="'http://member.kkmall.com/user/' + ${session.loginUser.id}+ '.html'">你好,[[${session.loginUser.username}]]</a>-->
</li>
<li th:if="${session.loginUser} !=null">
<a href="http://auth.glmall.com/oauth2.0/logout">退出登录</a>
<a href="http://auth.kkmall.com/oauth2.0/logout">退出登录</a>
</li>
<li style="border: 0;" th:if="${session.loginUser} ==null">
<a href="http://auth.glmall.com/login.html" class="aa">你好,请登录 </a>
<a href="http://auth.kkmall.com/login.html" class="aa">你好,请登录 </a>
</li>
<li th:if="${session.loginUser} ==null">
<a href="http://auth.glmall.com/reg.html" style="color: red;">免费注册</a> |
<a href="http://auth.kkmall.com/reg.html" style="color: red;">免费注册</a> |
</li>
<li th:if="${session.loginUser} !=null"><a href="http://member.glmall.com/memberOrder.html" class="aa">我的订单</a> |</li>
<li class="jingdong"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">我的京东</a><span class="glyphicon glyphicon-menu-down">|</span>
<li th:if="${session.loginUser} !=null"><a href="http://member.kkmall.com/memberOrder.html" class="aa">我的订单</a> |</li>
<li class="jingdong"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">我的京东</a><span class="glyphicon glyphicon-menu-down">|</span>
<ol class="jingdong_ol">
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">待处理订单</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">消息</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">返修退换货</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">我的回答</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">降价商品</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">我的关注</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">待处理订单</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">消息</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">返修退换货</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">我的回答</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">降价商品</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">我的关注</a></li>
<li style="width: 100%;height: 1px;background: lavender;margin-top: 15px;"></li>
<li style="margin-top: 0;"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">我的京豆</a></li>
<li style="margin-top: 0;"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">我的优惠券</a></li>
<li style="margin-bottom: 10px;"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">我的白条</a></li>
<li style="margin-top: 0;"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">我的京豆</a></li>
<li style="margin-top: 0;"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">我的优惠券</a></li>
<li style="margin-bottom: 10px;"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">我的白条</a></li>
</ol>
</li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa">京东会员</a> |</li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa">企业采购</a> |</li>
<li class="fuwu"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">客户服务</a><span class="glyphicon glyphicon-menu-down"></span> |
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa">京东会员</a> |</li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa">企业采购</a> |</li>
<li class="fuwu"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">客户服务</a><span class="glyphicon glyphicon-menu-down"></span> |
<ol class="fuwu_ol">
<h6>客户</h6>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">帮助中心</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">售后服务</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">在线客服</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">意见建议</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">电话客服</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">客服邮箱</a></li>
<li style="margin-bottom: -5px;"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">金融咨询</a></li>
<li style="margin-bottom: -5px;"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">售全球客服</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">帮助中心</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">售后服务</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">在线客服</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">意见建议</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">电话客服</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">客服邮箱</a></li>
<li style="margin-bottom: -5px;"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">金融咨询</a></li>
<li style="margin-bottom: -5px;"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">售全球客服</a></li>
<h6 style="border-top: 1px dashed darkgray;height: 30px;line-height: 30px;">商户</h6>
<li style="margin-top: -5px;"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">合作招商</a></li>
<li style="margin-top: -5px;"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">学习中心</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">商家后台</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">京麦工作台</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">商家帮助</a></li>
<li><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">规则平台</a></li>
<li style="margin-top: -5px;"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">合作招商</a></li>
<li style="margin-top: -5px;"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">学习中心</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">商家后台</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">京麦工作台</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">商家帮助</a></li>
<li><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">规则平台</a></li>
</ol>
</li>
<li class="daohang"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">网站导航</a><span class="glyphicon glyphicon-menu-down"></span> |
<li class="daohang"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">网站导航</a><span class="glyphicon glyphicon-menu-down"></span> |
<ol class="daohang_ol">
<li style="width: 34%;">
<h5>特色主题</h5>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">京东试用</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">京东金融</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">全球售</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">国际站</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">京东试用</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">京东金融</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">全球售</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">国际站</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">京东会员</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">京东预售</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">买什么</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">俄语站</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">京东会员</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">京东预售</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">买什么</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">俄语站</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">装机大师</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">0元评测</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">定期送</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">港澳售</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">装机大师</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">0元评测</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">定期送</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">港澳售</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">优惠券</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">秒杀</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">闪购</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">印尼站</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">优惠券</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">秒杀</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">闪购</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">印尼站</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">京东金融科技</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">In货推荐</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">陪伴计划</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">出海招商</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">京东金融科技</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">In货推荐</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">陪伴计划</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">出海招商</a>
</p>
</li>
<li>
<h5>行业频道</h5>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">手机</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">智能数码</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">玩3C</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">手机</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">智能数码</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">玩3C</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">电脑办公</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">家用电器</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东智能</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">电脑办公</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">家用电器</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东智能</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">服装城</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">美妆馆</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">家装城</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">服装城</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">美妆馆</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">家装城</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">母婴</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">食品</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">运动户外</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">母婴</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">食品</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">运动户外</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">农资频道</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">整车</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">图书</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">农资频道</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">整车</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">图书</a>
</p>
</li>
<li>
<h5>生活服务</h5>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东众筹</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">白条</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东金融APP</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东众筹</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">白条</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东金融APP</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东小金库</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">理财</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">智能家电</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东小金库</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">理财</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">智能家电</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">话费</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">水电煤</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">彩票</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">话费</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">水电煤</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">彩票</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">旅行</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">机票酒店</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">电影票</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">旅行</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">机票酒店</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">电影票</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东到家</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东众测</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">游戏</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东到家</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东众测</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">游戏</a>
</p>
</li>
<li style="border: 0;">
<h5>更多精选</h5>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">合作招商</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东通信</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东E卡</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">合作招商</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东通信</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东E卡</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">企业采购</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">服务市场</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">办公生活馆</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">企业采购</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">服务市场</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">办公生活馆</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">乡村招募</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">校园加盟</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">京友邦</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">乡村招募</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">校园加盟</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">京友邦</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东社区</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">智能社区</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">游戏社区</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">京东社区</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">智能社区</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">游戏社区</a>
</p>
<p>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2">知识产权维权</a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2"></a>
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa_2"></a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2">知识产权维权</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2"></a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa_2"></a>
</p>
</li>
</ol>
</li>
<li class="sjjd" style="border: 0;"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}" class="aa">手机京东</a>
<li class="sjjd" style="border: 0;"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}" class="aa">手机京东</a>
<div class="er">
<div class="er_1">
<div class="er_1_1">
@ -264,7 +264,7 @@
<div class="nav_top">
<div class="nav_top_one"><a href="/"><img src="/static/item/img/111.png"/></a></div>
<div class="nav_top_two"><input type="text"/><button>搜索</button></div>
<div class="nav_top_three"><a href="http://cart.glmall.com/cart.html">我的购物车</a><span class="glyphicon glyphicon-shopping-cart"></span>
<div class="nav_top_three"><a href="http://cart.kkmall.com/cart.html">我的购物车</a><span class="glyphicon glyphicon-shopping-cart"></span>
<div class="nav_top_three_1">
<img src="/static/item/img/44.png"/>购物车还没有商品,赶紧选购吧!
</div>
@ -272,17 +272,17 @@
</div>
<div class="nav_down">
<ul class="nav_down_ul">
<li class="nav_down_ul_1" style="width: 24%;float: left;"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">全部商品分类</a>
<li class="nav_down_ul_1" style="width: 24%;float: left;"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">全部商品分类</a>
</li>
<li class="ul_li"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">服装城</a></li>
<li class="ul_li"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">美妆馆</a></li>
<li class="ul_li"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">超市</a></li>
<li class="ul_li" style="border-right: 1px solid lavender;"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">生鲜</a></li>
<li class="ul_li"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">全球购</a></li>
<li class="ul_li"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">闪购</a></li>
<li class="ul_li" style="border-right: 1px solid lavender;"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">拍卖</a></li>
<li class="ul_li"><a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">金融</a></li>
<li class="ul_li"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">服装城</a></li>
<li class="ul_li"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">美妆馆</a></li>
<li class="ul_li"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">超市</a></li>
<li class="ul_li" style="border-right: 1px solid lavender;"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">生鲜</a></li>
<li class="ul_li"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">全球购</a></li>
<li class="ul_li"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">闪购</a></li>
<li class="ul_li" style="border-right: 1px solid lavender;"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">拍卖</a></li>
<li class="ul_li"><a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">金融</a></li>
</ul>
</div>
</div>
@ -295,15 +295,15 @@
<div class="w">
<div class="crumb">
<div class="crumb-item">
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">手机</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">手机</a>
</div>
<div class="crumb-item sep">></div>
<div class="crumb-item">
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">手机通讯</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">手机通讯</a>
</div>
<div class="crumb-item sep">></div>
<div class="crumb-item">
<a th:href="${'http://item.glmall.com/' + item.info.skuId + '.html'}">手机</a>
<a th:href="${'http://item.kkmall.com/' + item.info.skuId + '.html'}">手机</a>
</div>
<div class="crumb-item sep">></div>
<div class="crumb-item">
@ -1492,7 +1492,7 @@
}
console.log(filterEle[0])
// 3.跳转
location.href = "http://item.glmall.com/" + filterEle[0] + ".html";
location.href = "http://item.kkmall.com/" + filterEle[0] + ".html";
});
// 属性的回显
$(function () {
@ -1504,7 +1504,7 @@
let num = $("#numInput").val();
// 获取当前按钮的自定义属性
let skuId = $(this).attr("skuId");
location.href = "http://cart.glmall.com/addToCart?skuId=" + skuId + "&num=" + num;
location.href = "http://cart.kkmall.com/addToCart?skuId=" + skuId + "&num=" + num;
return false;
})
$("#secKillA").click(function () {
@ -1512,7 +1512,7 @@
if(isLogin){
var killId = $(this).attr("sessionid") + "-" + $(this).attr("skuid");
var num = $("#numInput").val();
location.href = "http://seckill.glmall.com/kill?killId=" + killId + "&key=" + $(this).attr("code") + "&num=" + num;
location.href = "http://seckill.kkmall.com/kill?killId=" + killId + "&key=" + $(this).attr("code") + "&num=" + num;
}else{
layer.msg("请先登录!")
}

View file

@ -1,9 +1,9 @@
package name.lkk.kkmall.product;
import name.lkk.kkmall.product.entity.BrandEntity;
import name.lkk.kkmall.product.service.impl.BrandServiceImpl;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.StringRedisTemplate;
@ -20,6 +20,9 @@ class KkmallProductApplicationTests {
@Autowired
StringRedisTemplate stringRedisTemplate;
@Autowired
RedissonClient redissonClient;
@Test
@DisplayName("测试StringRedisTemplate")
public void TestStringRedisTemplate(){
@ -28,6 +31,12 @@ class KkmallProductApplicationTests {
System.out.println(stringStringValueOperations.get("Hello"));
}
@Test
@DisplayName("测试RedissonClient")
public void TestRedissonClient(){
System.out.println(redissonClient);
}
@Test
void contextLoads() {
// BrandEntity brandEntity = new BrandEntity();

View file

@ -225,7 +225,7 @@ CREATE TABLE `oms_payment_info` (
-- ----------------------------
-- Records of oms_payment_info
-- ----------------------------
INSERT INTO `oms_payment_info` VALUES (1, '202007051323559261279647175235624962', NULL, '2020070522001473990501031834', 5990.0000, 'glmall', 'TRADE_SUCCESS', '2020-07-05 05:24:06', NULL, NULL, '2020-07-05 05:24:21');
INSERT INTO `oms_payment_info` VALUES (1, '202007051323559261279647175235624962', NULL, '2020070522001473990501031834', 5990.0000, 'kkmall', 'TRADE_SUCCESS', '2020-07-05 05:24:06', NULL, NULL, '2020-07-05 05:24:21');
-- ----------------------------
-- Table structure for oms_refund_info

View file

@ -1,7 +1,7 @@
# My hosts
10.43.1.52 nay1
10.43.1.52 order.glmall.com seckill.glmall.com glmall.com search.glmall.com
10.43.1.52 item.glmall.com auth.glmall.com member.glmall.com cart.glmall.com
10.43.1.52 order.kkmall.com seckill.kkmall.com kkmall.com search.kkmall.com
10.43.1.52 item.kkmall.com auth.kkmall.com member.kkmall.com cart.kkmall.com
# 单点登录
127.0.0.1 ssoserver.com clientA.com clientB.com localhost

View file

@ -31,14 +31,14 @@ http {
keepalive_timeout 65;
#gzip on;
upstream glmall{
upstream kkmall{
server 10.43.1.1:88;
}
server {
listen 80;
# 所有 *.glmall.com 的域名都会经过这里
server_name glmall.com *.glmall.com *.natappfree.cc *.52http.net;
# 所有 *.kkmall.com 的域名都会经过这里
server_name kkmall.com *.kkmall.com *.natappfree.cc *.52http.net;
#charset koi8-r;
@ -55,13 +55,13 @@ http {
}
# .natappfree.cc 这个路径下面的地址给它改一下请求地址
location /payed/ {
proxy_pass http://glmall;
proxy_pass http://kkmall;
# 转发请求的时候带上请求头信息
proxy_set_header Host order.glmall.com;
proxy_set_header Host order.kkmall.com;
}
location / {
proxy_pass http://glmall;
proxy_pass http://kkmall;
# 转发请求的时候带上请求头信息
proxy_set_header Host $host;
}