Commit 91281b9d2c5bb3cc210316053855a52b79901648
Merge branch 'develop' of http://172.16.29.40:8010/wms/wms4 into develop
Showing
3 changed files
with
92 additions
and
49 deletions
ant-design-vue-jeecg/src/api/api.js
@@ -111,6 +111,8 @@ export const getLocationTypeList = (params) => getAction('/config/locationType/g | @@ -111,6 +111,8 @@ export const getLocationTypeList = (params) => getAction('/config/locationType/g | ||
111 | export const getLocationHighList = (params) => postAction('/config/locationHigh/getLocationHighList', params); | 111 | export const getLocationHighList = (params) => postAction('/config/locationHigh/getLocationHighList', params); |
112 | //获取货主列表 | 112 | //获取货主列表 |
113 | export const getCompanyList = (params) => getAction('/config/company/getCompanyList', params); | 113 | export const getCompanyList = (params) => getAction('/config/company/getCompanyList', params); |
114 | +//系统激活信息查询 | ||
115 | +export const querySystemActivationInfo = (params) => getAction('/sys/querySystemActivationInfo', params); | ||
114 | //获取盘点类型列表 | 116 | //获取盘点类型列表 |
115 | export const getCountTypeList = (params) => getAction('/config/cycleCountPreference/getCountTypeList', params); | 117 | export const getCountTypeList = (params) => getAction('/config/cycleCountPreference/getCountTypeList', params); |
116 | //获取承运商列表 | 118 | //获取承运商列表 |
ant-design-vue-jeecg/src/components/page/GlobalHeader.vue
@@ -7,45 +7,30 @@ | @@ -7,45 +7,30 @@ | ||
7 | 7 | ||
8 | <div v-if="mode === 'sidemenu'" class="header" :class="theme"> | 8 | <div v-if="mode === 'sidemenu'" class="header" :class="theme"> |
9 | <a-icon | 9 | <a-icon |
10 | - v-if="device==='mobile'" | 10 | + v-if="device === 'mobile'" |
11 | class="trigger" | 11 | class="trigger" |
12 | :type="collapsed ? 'menu-fold' : 'menu-unfold'" | 12 | :type="collapsed ? 'menu-fold' : 'menu-unfold'" |
13 | - @click="toggle"></a-icon> | ||
14 | - <a-icon | ||
15 | - v-else | ||
16 | - class="trigger" | ||
17 | - :type="collapsed ? 'menu-unfold' : 'menu-fold'" | ||
18 | - @click="toggle"/> | ||
19 | - | ||
20 | - <span style="height:59;line-height:59px;" v-if="device === 'desktop'">欢迎进入 华恒仓储管理系统</span> | ||
21 | - <a @click="downWord" style="height:59;line-height:59px;color: #d71345" v-if="manual === 'desktop'"> WMS操作手册</a> | ||
22 | - <span v-else>华恒仓储管理系统</span> | 13 | + @click="toggle" |
14 | + ></a-icon> | ||
15 | + <a-icon v-else class="trigger" :type="collapsed ? 'menu-unfold' : 'menu-fold'" @click="toggle" /> | ||
23 | 16 | ||
24 | - <user-menu :theme="theme"/> | 17 | + <span style="height:59;line-height:59px;" v-if="device === 'desktop'">欢迎进入 华恒仓储管理系统</span> |
18 | + <span style="height:59;line-height:59px;color: #d71345" v-if="manual === 'desktop'">{{ expirationTime }}</span> | ||
19 | + <user-menu :theme="theme" /> | ||
25 | </div> | 20 | </div> |
26 | <!-- 顶部导航栏模式 --> | 21 | <!-- 顶部导航栏模式 --> |
27 | <div v-else :class="['top-nav-header-index', theme]"> | 22 | <div v-else :class="['top-nav-header-index', theme]"> |
28 | <div class="header-index-wide"> | 23 | <div class="header-index-wide"> |
29 | <div class="header-index-left" :style="topMenuStyle.headerIndexLeft"> | 24 | <div class="header-index-left" :style="topMenuStyle.headerIndexLeft"> |
30 | - <logo class="top-nav-header" :show-title="device !== 'mobile'" :style="topMenuStyle.topNavHeader"/> | 25 | + <logo class="top-nav-header" :show-title="device !== 'mobile'" :style="topMenuStyle.topNavHeader" /> |
31 | <div v-if="device !== 'mobile'" :style="topMenuStyle.topSmenuStyle"> | 26 | <div v-if="device !== 'mobile'" :style="topMenuStyle.topSmenuStyle"> |
32 | - <s-menu | ||
33 | - mode="horizontal" | ||
34 | - :menu="menus" | ||
35 | - :theme="theme" | ||
36 | - @updateMenuTitle="handleUpdateMenuTitle" | ||
37 | - ></s-menu> | 27 | + <s-menu mode="horizontal" :menu="menus" :theme="theme" @updateMenuTitle="handleUpdateMenuTitle"></s-menu> |
38 | </div> | 28 | </div> |
39 | - <a-icon | ||
40 | - v-else | ||
41 | - class="trigger" | ||
42 | - :type="collapsed ? 'menu-fold' : 'menu-unfold'" | ||
43 | - @click="toggle"></a-icon> | 29 | + <a-icon v-else class="trigger" :type="collapsed ? 'menu-fold' : 'menu-unfold'" @click="toggle"></a-icon> |
44 | </div> | 30 | </div> |
45 | - <user-menu class="header-index-right" :theme="theme" :style="topMenuStyle.headerIndexRight"/> | 31 | + <user-menu class="header-index-right" :theme="theme" :style="topMenuStyle.headerIndexRight" /> |
46 | </div> | 32 | </div> |
47 | </div> | 33 | </div> |
48 | - | ||
49 | </a-layout-header> | 34 | </a-layout-header> |
50 | </template> | 35 | </template> |
51 | 36 | ||
@@ -53,15 +38,15 @@ | @@ -53,15 +38,15 @@ | ||
53 | import UserMenu from '../tools/UserMenu' | 38 | import UserMenu from '../tools/UserMenu' |
54 | import SMenu from '../menu/' | 39 | import SMenu from '../menu/' |
55 | import Logo from '../tools/Logo' | 40 | import Logo from '../tools/Logo' |
56 | -import {downLoad} from '@/api/api' | ||
57 | -import {mixin} from '@/utils/mixin.js' | 41 | +import { downLoad, querySystemActivationInfo } from '@/api/api' |
42 | +import { mixin } from '@/utils/mixin.js' | ||
58 | import { downFile } from '@/api/manage' | 43 | import { downFile } from '@/api/manage' |
59 | export default { | 44 | export default { |
60 | name: 'GlobalHeader', | 45 | name: 'GlobalHeader', |
61 | components: { | 46 | components: { |
62 | UserMenu, | 47 | UserMenu, |
63 | SMenu, | 48 | SMenu, |
64 | - Logo, | 49 | + Logo |
65 | }, | 50 | }, |
66 | mixins: [mixin], | 51 | mixins: [mixin], |
67 | props: { | 52 | props: { |
@@ -89,12 +74,11 @@ export default { | @@ -89,12 +74,11 @@ export default { | ||
89 | required: false, | 74 | required: false, |
90 | default: 'desktop' | 75 | default: 'desktop' |
91 | }, | 76 | }, |
92 | - manual:{ | 77 | + manual: { |
93 | type: String, | 78 | type: String, |
94 | required: false, | 79 | required: false, |
95 | default: 'desktop' | 80 | default: 'desktop' |
96 | - }, | ||
97 | - | 81 | + } |
98 | }, | 82 | }, |
99 | data() { | 83 | data() { |
100 | return { | 84 | return { |
@@ -106,12 +90,16 @@ export default { | @@ -106,12 +90,16 @@ export default { | ||
106 | headerIndexRight: {}, | 90 | headerIndexRight: {}, |
107 | topSmenuStyle: {} | 91 | topSmenuStyle: {} |
108 | }, | 92 | }, |
93 | + expirationTime: '', | ||
109 | chatStatus: '', | 94 | chatStatus: '', |
110 | - url:{ | ||
111 | - downLoad:"/sys/common/downLoad" | 95 | + url: { |
96 | + downLoad: '/sys/common/downLoad' | ||
112 | } | 97 | } |
113 | } | 98 | } |
114 | }, | 99 | }, |
100 | + created() { | ||
101 | + this.loadFrom(); | ||
102 | + }, | ||
115 | watch: { | 103 | watch: { |
116 | /** 监听设备变化 */ | 104 | /** 监听设备变化 */ |
117 | device() { | 105 | device() { |
@@ -148,16 +136,23 @@ export default { | @@ -148,16 +136,23 @@ export default { | ||
148 | this.headerBarFixed = false | 136 | this.headerBarFixed = false |
149 | } | 137 | } |
150 | }, | 138 | }, |
139 | + loadFrom() { | ||
140 | + querySystemActivationInfo().then(res => { | ||
141 | + if (res.success) { | ||
142 | + this.expirationTime = '系统授权到期日:' + res.result.expirationTime; | ||
143 | + } | ||
144 | + }) | ||
145 | + }, | ||
151 | toggle() { | 146 | toggle() { |
152 | this.$emit('toggle') | 147 | this.$emit('toggle') |
153 | }, | 148 | }, |
154 | - downWord(){ | ||
155 | - var fileName='华恒WMS4操作说明书.doc'; | ||
156 | - return downFile(this.url.downLoad, fileName).then((data) => { | 149 | + downWord() { |
150 | + var fileName = '华恒WMS4操作说明书.doc' | ||
151 | + return downFile(this.url.downLoad, fileName).then(data => { | ||
157 | debugger | 152 | debugger |
158 | - this.$message.info("华恒WMS4操作说明书开始下载...."); | 153 | + this.$message.info('华恒WMS4操作说明书开始下载....') |
159 | if (!data || data.size === 0) { | 154 | if (!data || data.size === 0) { |
160 | - this.$message.error("文件下载失败"); | 155 | + this.$message.error('文件下载失败') |
161 | return | 156 | return |
162 | } | 157 | } |
163 | if (typeof window.navigator.msSaveBlob !== 'undefined') { | 158 | if (typeof window.navigator.msSaveBlob !== 'undefined') { |
@@ -186,10 +181,10 @@ export default { | @@ -186,10 +181,10 @@ export default { | ||
186 | this.topMenuStyle.headerIndexLeft = {} | 181 | this.topMenuStyle.headerIndexLeft = {} |
187 | } else { | 182 | } else { |
188 | let rightWidth = '356px' | 183 | let rightWidth = '356px' |
189 | - this.topMenuStyle.topNavHeader = {'min-width': '208px'} | ||
190 | - this.topMenuStyle.topSmenuStyle = {'width': 'calc(100% - 208px)'} | ||
191 | - this.topMenuStyle.headerIndexRight = {'min-width': rightWidth, 'white-space': 'nowrap'} | ||
192 | - this.topMenuStyle.headerIndexLeft = {'width': `calc(100% - ${rightWidth})`} | 184 | + this.topMenuStyle.topNavHeader = { 'min-width': '208px' } |
185 | + this.topMenuStyle.topSmenuStyle = { width: 'calc(100% - 208px)' } | ||
186 | + this.topMenuStyle.headerIndexRight = { 'min-width': rightWidth, 'white-space': 'nowrap' } | ||
187 | + this.topMenuStyle.headerIndexLeft = { width: `calc(100% - ${rightWidth})` } | ||
193 | } | 188 | } |
194 | } | 189 | } |
195 | }, | 190 | }, |
@@ -198,9 +193,8 @@ export default { | @@ -198,9 +193,8 @@ export default { | ||
198 | // update-begin-author:sunjianlei date:20210508 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题 | 193 | // update-begin-author:sunjianlei date:20210508 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题 |
199 | handleUpdateMenuTitle(value) { | 194 | handleUpdateMenuTitle(value) { |
200 | this.$emit('updateMenuTitle', value) | 195 | this.$emit('updateMenuTitle', value) |
201 | - }, | 196 | + } |
202 | // update-end-author:sunjianlei date:20210508 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题 | 197 | // update-end-author:sunjianlei date:20210508 for: 修复动态功能测试菜单、带参数菜单标题错误、展开错误的问题 |
203 | - | ||
204 | } | 198 | } |
205 | } | 199 | } |
206 | </script> | 200 | </script> |
@@ -211,9 +205,7 @@ export default { | @@ -211,9 +205,7 @@ export default { | ||
211 | @height: 59px; | 205 | @height: 59px; |
212 | 206 | ||
213 | .layout { | 207 | .layout { |
214 | - | ||
215 | .top-nav-header-index { | 208 | .top-nav-header-index { |
216 | - | ||
217 | .header-index-wide { | 209 | .header-index-wide { |
218 | margin-left: 0px; | 210 | margin-left: 0px; |
219 | 211 | ||
@@ -248,7 +240,8 @@ export default { | @@ -248,7 +240,8 @@ export default { | ||
248 | } | 240 | } |
249 | } | 241 | } |
250 | 242 | ||
251 | - .header, .top-nav-header-index { | 243 | + .header, |
244 | + .top-nav-header-index { | ||
252 | &.dark .trigger:hover { | 245 | &.dark .trigger:hover { |
253 | background: rgba(0, 0, 0, 0.05); | 246 | background: rgba(0, 0, 0, 0.05); |
254 | } | 247 | } |
@@ -261,5 +254,4 @@ export default { | @@ -261,5 +254,4 @@ export default { | ||
261 | } | 254 | } |
262 | 255 | ||
263 | /* update_end author:scott date:20190220 for: 缩小首页布局顶部的高度*/ | 256 | /* update_end author:scott date:20190220 for: 缩小首页布局顶部的高度*/ |
264 | - | ||
265 | </style> | 257 | </style> |
266 | \ No newline at end of file | 258 | \ No newline at end of file |
huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/LoginController.java
@@ -74,9 +74,13 @@ import com.auth0.jwt.JWTVerifier; | @@ -74,9 +74,13 @@ import com.auth0.jwt.JWTVerifier; | ||
74 | import com.auth0.jwt.algorithms.Algorithm; | 74 | import com.auth0.jwt.algorithms.Algorithm; |
75 | import com.auth0.jwt.exceptions.JWTVerificationException; | 75 | import com.auth0.jwt.exceptions.JWTVerificationException; |
76 | import com.auth0.jwt.exceptions.TokenExpiredException; | 76 | import com.auth0.jwt.exceptions.TokenExpiredException; |
77 | +import com.auth0.jwt.interfaces.DecodedJWT; | ||
77 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 78 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
78 | import com.baomidou.mybatisplus.core.toolkit.IdWorker; | 79 | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
79 | 80 | ||
81 | +import cn.hutool.core.date.DatePattern; | ||
82 | +import cn.hutool.core.date.DateUnit; | ||
83 | +import cn.hutool.core.date.DateUtil; | ||
80 | import cn.hutool.core.util.RandomUtil; | 84 | import cn.hutool.core.util.RandomUtil; |
81 | import io.swagger.annotations.Api; | 85 | import io.swagger.annotations.Api; |
82 | import io.swagger.annotations.ApiOperation; | 86 | import io.swagger.annotations.ApiOperation; |
@@ -200,6 +204,51 @@ public class LoginController { | @@ -200,6 +204,51 @@ public class LoginController { | ||
200 | // systemSync.sendSysAnnouncement(sysUser); | 204 | // systemSync.sendSysAnnouncement(sysUser); |
201 | return result; | 205 | return result; |
202 | } | 206 | } |
207 | + | ||
208 | + @ApiOperation("系统激活信息查询") | ||
209 | + @GetMapping(value = "/querySystemActivationInfo") | ||
210 | + public Result<?> querySystemActivationInfo() throws IOException { | ||
211 | + Result<?> result = new Result(); | ||
212 | + // 是否需要校验激活码 | ||
213 | + if (applicationConfig.getCheckSystemActivationCode() == null) { | ||
214 | + result.setSuccess(false); | ||
215 | + result.setCode(499); | ||
216 | + result.setMessage("是否检查系统激活码参数未启用"); | ||
217 | + return result; | ||
218 | + } | ||
219 | + if (!applicationConfig.getCheckSystemActivationCode()) { | ||
220 | + result.setSuccess(true); | ||
221 | + result.setCode(200); | ||
222 | + return result; | ||
223 | + } | ||
224 | + try { | ||
225 | + String activationCode = huahengRedisUtil.get(HuahengJwtUtil.SYSTEM_ACTIVATION_CODE_KEY, String.class); | ||
226 | + if (StringUtils.isEmpty(activationCode)) { | ||
227 | + result.setSuccess(false); | ||
228 | + result.setCode(499); | ||
229 | + result.setMessage("系统激活码为空"); | ||
230 | + return result; | ||
231 | + } | ||
232 | + // 验证激活码 | ||
233 | + Algorithm algorithm = Algorithm.RSA256(new SystemRSA256Key().getPublicKey(), new SystemRSA256Key().getPrivateKey()); | ||
234 | + JWTVerifier verifier = | ||
235 | + JWT.require(algorithm).withClaim("operator", applicationConfig.getArtifactId()).withIssuer(applicationConfig.getArtifactId()).build(); | ||
236 | + DecodedJWT decodedJWT = verifier.verify(activationCode); | ||
237 | + Map<String, String> returnMap = new HashMap<String, String>(); | ||
238 | + returnMap.put("audience", decodedJWT.getClaim("aud").asString()); | ||
239 | + returnMap.put("expirationTime", DateUtil.format(decodedJWT.getClaim("exp").asDate(), DatePattern.NORM_DATE_PATTERN)); | ||
240 | + return Result.OK("系统激活信息查询成功", returnMap); | ||
241 | + } catch (TokenExpiredException e) { | ||
242 | + result.setSuccess(false); | ||
243 | + result.setCode(499); | ||
244 | + result.setMessage("系统激活授权期限已到期"); | ||
245 | + } catch (Exception e) { | ||
246 | + result.setSuccess(false); | ||
247 | + result.setCode(499); | ||
248 | + result.setMessage("系统激活码无效"); | ||
249 | + } | ||
250 | + return result; | ||
251 | + } | ||
203 | 252 | ||
204 | @ApiOperation("系统激活API") | 253 | @ApiOperation("系统激活API") |
205 | @RequestMapping(value = "/systemActivation", method = RequestMethod.POST) | 254 | @RequestMapping(value = "/systemActivation", method = RequestMethod.POST) |