| | |
| | | ## dmvisit |
| | | 基础工程:Eva v2.0 |
| | | 官网:http://eva.adjustrd.com/ |
| | | 技术支持QQ群:877957236 |
| | | |
| | | 访客系统 |
| | | 1、安装nacos服务 |
| | | 2、按照mysql5.x |
| | | 3、jdk1.8安装 |
| | | 4、redis安装 |
| | | 5、ftp安装 |
| | | |
| | | |
| | | |
| | | nohup java -Xms512m -Xmx512m -Xmn512m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=10018 -jar /usr/local/jars/dmvisit/openapi.jar >/usr/local/jars/dmvisit/web.log 2>/usr/local/jars/dmvisit/err.log & |
| | | |
| | | |
| | | |
| | | 重要: |
| | | 1、关于外网访问限制 ,如果服务器重启了或者网卡重启,进行一下操作: |
| | | vim /etc/resolv.conf |
| | | nameserver 改成 nameserver 202.102.192.68 |
| | | |
| | | |
| | | #nohup不产生日志文件命令: |
| | | nohup java -jar /usr/local/jars/admin_interface.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/admin_timer.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/meeting_admin.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/system_gateway.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/system_timer.jar > /dev/null 2>&1 & |
| | |
| | | class="upload-demo" |
| | | :accept="uploadData.fileTyp" |
| | | :action="uploadImgUrl" |
| | | :limit="1" |
| | | :limit="this.fileLength" |
| | | :on-exceed="handleExceed" |
| | | :on-success="handleFileSuccess" |
| | | :on-error="uploadError" |
| | | :before-upload="beforeFileUpload" |
| | | :file-list="fileList"> |
| | | <el-button size="small" type="primary">点击上传</el-button> |
| | | <div slot="tip" class="el-upload__tip">只能上传{{ uploadData.fileType }}文件,且不超过5mb</div> |
| | | <div slot="tip" class="el-upload__tip" >只能上传{{ this.fileLength }}个文件,数量超过请删除已传附件重新上传</div> |
| | | </el-upload> |
| | | </div> |
| | | |
| | |
| | | type: String, |
| | | default: 'width: 190px; height: 190px;' |
| | | }, |
| | | fileLength:{ |
| | | type: Number, |
| | | default: () => 1 |
| | | }, |
| | | uploadData: Object |
| | | }, |
| | | data() { |
| | | return { |
| | | fileList:null, |
| | | fileList: [], |
| | | uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/visitsAdmin/cloudService/public/upload?folder='+this.uploadData.folder |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | // 上传图片 |
| | | handleExceed(){}, |
| | | handleExceed(){ |
| | | if(this.fileList && this.fileList.length >= this.fileLength){ |
| | | this.$message.error('只允许上传【'+this.fileLength+'个附件】') |
| | | } |
| | | }, |
| | | handleFileSuccess(res, file) { |
| | | if (res.code == 200) { |
| | | let { data } = res |
| | | // this.fileList = [{name: data.originname, url: data.url }] |
| | | this.fileList = [{name: data.originname, url: data.url }] |
| | | this.$message.success('上传成功') |
| | | this.$emit('uploadSuccess', { fileurl: data.imgaddr, fileurlFull: data.url, name: data.originname }) |
| | | } else { |
| | |
| | | this.$message.error('上传失败') |
| | | this.$emit('uploadEnd') |
| | | }, |
| | | // // 拦截 |
| | | // |
| | | beforeFileUpload(file) { |
| | | if(this.fileList && this.fileList.length >= this.fileLength){ |
| | | this.$message.error('只允许上传【'+this.fileLength+'w文件】') |
| | | return false; |
| | | } |
| | | this.$emit('uploadBegin') |
| | | return true |
| | | } |
| | |
| | | |
| | | <style lang="scss" scoped> |
| | | $image-width: 100px; |
| | | $image-height: 30px; |
| | | .avatar-uploader { |
| | | width: $image-width; |
| | | width: 100px; |
| | | height: $image-width; |
| | | } |
| | | ::v-deep .el-upload { |
| | |
| | | cursor: pointer; |
| | | position: relative; |
| | | width: $image-width; |
| | | height: $image-width; |
| | | height: $image-height; |
| | | overflow: hidden; |
| | | } |
| | | .avatar-uploader .el-upload:hover { |
| | |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: $image-width; |
| | | height: $image-width; |
| | | height: $image-height; |
| | | text-align: center; |
| | | } |
| | | .avatar { |
| | | width: $image-width; |
| | | height: $image-width; |
| | | height: $image-height; |
| | | display: block; |
| | | } |
| | | .tips-style { |
| | |
| | | width: 90px !important; |
| | | height: 90px !important; |
| | | } |
| | | ::v-deep .el-upload-list__item { |
| | | width: 80% !important; |
| | | height: 50px !important; |
| | | } |
| | | |
| | | .icon { |
| | | -webkit-transform: translate(-50%,-50%); |
| | | -ms-transform: translate(-50%,-50%); |
| | | transform: translate(0%, -85%); |
| | | } |
| | | |
| | | ::v-deep .el-upload-list__item { |
| | | width: 500px !important; |
| | | height: 30px !important; |
| | | } |
| | | </style> |
| | | |
| | |
| | | <el-input v-model="form.label" placeholder="请输入数据标签" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="是否富文本" prop="istext" > |
| | | <el-switch v-model="form.istext" :active-value="true" :inactive-value="false"/> |
| | | <span class="status-text">{{form.istext | disabledText1}}</span> |
| | | <el-radio-group v-model="form.istext"> |
| | | <el-radio :label="0" value="0">文本</el-radio> |
| | | <el-radio :label="1" value="1">图片|文件</el-radio> |
| | | <el-radio :label="2" value="2">富文本</el-radio> |
| | | </el-radio-group> |
| | | <!-- <el-switch v-model="form.istext" :active-value="true" :inactive-value="false"/> |
| | | <span class="status-text">{{form.istext | disabledText1}}</span>--> |
| | | </el-form-item> |
| | | <el-form-item label="数据值" prop="code" required> |
| | | <el-input v-if="!form.istext" v-model="form.code" placeholder="请输入数据值" v-trim/> |
| | | <RichEditor v-else :richData="form.code" :styleEditor="styleEditor" @getWangedditor="getWangedditor" :readonly="false"/> |
| | | <template v-if="form.istext == 1" > |
| | | <UploadFile :uploadData="{ folder: 'richeditor',fileType:'' }" :fileList="fileList" @uploadSuccess="fileUploaded" /> |
| | | <el-input readonly v-model="form.code" placeholder="完整数据值" v-trim/> |
| | | </template> |
| | | <RichEditor v-if="form.istext == 2" :richData="form.code" :styleEditor="styleEditor" @getWangedditor="getWangedditor" :readonly="false"/> |
| | | <el-input v-if="form.istext == 0" v-model="form.code" placeholder="请输入数据值" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="disabled" required class="form-item-status"> |
| | | <el-switch v-model="form.disabled" :active-value="false" :inactive-value="true"/> |
| | |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import RichEditor from '@/components/common/RichEditor' |
| | | import UploadFile from "@/components/common/UploadFile"; |
| | | export default { |
| | | name: 'OperaDictDataWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow,RichEditor }, |
| | | components: {UploadFile, GlobalWindow,RichEditor }, |
| | | data () { |
| | | return { |
| | | // 表单数据 |
| | |
| | | code: '', |
| | | label: '', |
| | | disabled: false, |
| | | istext: false, |
| | | remark:'' |
| | | istext: 0, |
| | | remark: '' |
| | | }, |
| | | fileList: [], |
| | | // 验证规则 |
| | | rules: { |
| | | label: [ |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | fileUploaded(data){ |
| | | this.form.code = data.fileurlFull |
| | | }, |
| | | getWangedditor(val){ |
| | | this.form.code =val |
| | | }, |
| | |
| | | open (title, dictId, target) { |
| | | this.title = title |
| | | this.visible = true |
| | | |
| | | this.form.istext = 0 |
| | | // 新建 |
| | | if (target == null) { |
| | | this.$nextTick(() => { |
| | | this.$refs.form.resetFields() |
| | | this.form.id = null |
| | | this.form.dictId = dictId |
| | | this.form.istext=false |
| | | this.form.istext=0 |
| | | }) |
| | | return |
| | | } |
| | |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | this.form.dictId = dictId |
| | | this.form.istext=false |
| | | this.form.istext = 0 |
| | | } |
| | | }) |
| | | } |
| | |
| | | 基础工程:Eva v2.0 |
| | | 官网:http://eva.adjustrd.com/ |
| | | 技术支持QQ群:877957236 |
| | | |
| | | 1、安装nacos服务 |
| | | 2、按照mysql5.x |
| | | 3、jdk1.8安装 |
| | | 4、redis安装 |
| | | 5、ftp安装 |
| | | |
| | | |
| | | |
| | | nohup java -Xms512m -Xmx512m -Xmn512m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=10018 -jar /usr/local/jars/dmvisit/openapi.jar >/usr/local/jars/dmvisit/web.log 2>/usr/local/jars/dmvisit/err.log & |
| | | |
| | | |
| | | |
| | | 重要: |
| | | 1、关于外网访问限制 ,如果服务器重启了或者网卡重启,进行一下操作: |
| | | vim /etc/resolv.conf |
| | | nameserver 改成 nameserver 202.102.192.68 |
| | | |
| | | |
| | | #nohup不产生日志文件命令: |
| | | nohup java -jar /usr/local/jars/admin_interface.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/admin_timer.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/meeting_admin.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/system_gateway.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/system_timer.jar > /dev/null 2>&1 & |
| | | |
| | |
| | | max-swallow-size: -1 |
| | | servlet: |
| | | session: |
| | | timeout: PT3H #表示12小时 |
| | | timeout: PT3H #表示12小时 |
| | | |
| | | auth: |
| | | jwt: |
| | | enabled: true #是否开启JWT登录认证功能 |
| | | secret: fjkfaf;afa # JWT私钥,用于校验JWT令牌的合法性 |
| | | expiration: 1800000 #JWT令牌的有效期,用于校验JWT令牌的合法性 |
| | | # expiration: 300000 #JWT令牌的有效期,用于校验JWT令牌的合法性 |
| | | header: JWTHeaderName #HTTP请求的Header名称,该Header作为参数传递JWT令牌 |
| | | userParamName: username #用户登录认证用户名参数名称 |
| | | pwdParamName: password #用户登录认证密码参数名称 |
| | | useDefaultController: true # 是否使用默认的JwtAuthController |
| | |
| | | return ApiResponse.success(null); |
| | | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/logoutForH5") |
| | | @ApiOperation("退出登陆") |
| | | public ApiResponse<String> logoutForH5(@RequestHeader(Constants.HEADER_USER_TOKEN) String oldToken){ |
| | |
| | | return ApiResponse.failed(ResponseStatus.SERVER_ERROR); |
| | | } |
| | | return ApiResponse.success(null); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | package com.doumee.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.config.jwt.JwtTokenUtil; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.core.utils.Constants; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.method.HandlerMethod; |
| | |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Slf4j |
| | | public class LoginHandlerInterceptor implements HandlerInterceptor { |
| | | |
| | | private RedisTemplate<String,Object> stringRedisTemplate; |
| | | private long expireTime; |
| | | |
| | | public long getExpireTime() { |
| | | return expireTime; |
| | | } |
| | | |
| | | public void setExpireTime(long expireTime) { |
| | | this.expireTime = expireTime; |
| | | } |
| | | |
| | | // 由于该类未交给spring管理,因此不能使用自动装配的方式获取RedisTemplate对象 |
| | | public LoginHandlerInterceptor(RedisTemplate<String,Object> stringRedisTemplate,long expireTime) { |
| | |
| | | if(user ==null ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户登陆已失效,请重新登陆!"); |
| | | } |
| | | stringRedisTemplate.expire(Constants.REDIS_TOKEN_KEY+token,this.expireTime, TimeUnit.MILLISECONDS); |
| | | log.error("=========开始刷新token有效期:"+token+"======time:"+this.getExpireTime()); |
| | | stringRedisTemplate.expire(Constants.REDIS_TOKEN_KEY+token,this.getExpireTime(), TimeUnit.MILLISECONDS); |
| | | //权限判断------------ |
| | | return user; |
| | | } |
| | |
| | | try { |
| | | String userInfo = (String) redisTemplate.opsForValue().get(Constants.REDIS_TOKEN_KEY+token); |
| | | claims = JSONObject.toJavaObject(JSONObject.parseObject(userInfo),LoginUserInfo.class); |
| | | refreshToken(token); |
| | | } catch (Exception e) { |
| | | claims = null; |
| | | } |
| | |
| | | * 向后延伸有效期保持会话继续 |
| | | * @param token |
| | | */ |
| | | |
| | | public void refreshTokenTime(String token ) { |
| | | log.error("===============开始刷新登录token"+token); |
| | | redisTemplate.expire(Constants.REDIS_TOKEN_KEY+token,jwtProperties.getExpiration(), TimeUnit.MILLISECONDS); |
| | | log.error("===============结束刷新登录token"+token); |
| | | // redisTemplate.opsForValue().set(Constants.REDIS_TOKEN_KEY+token,usrerInfo,jwtProperties.getExpiration(), TimeUnit.MILLISECONDS); |
| | | } |
| | | } |
| | |
| | | servlet: |
| | | session: |
| | | timeout: PT3H #表示12小时 |
| | | auth: |
| | | jwt: |
| | | enabled: true #是否开启JWT登录认证功能 |
| | | secret: fjkfaf;afa # JWT私钥,用于校验JWT令牌的合法性 |
| | | expiration: 1800000 #JWT令牌的有效期,用于校验JWT令牌的合法性 |
| | | # expiration: 300000 #JWT令牌的有效期,用于校验JWT令牌的合法性 |
| | | header: JWTHeaderName #HTTP请求的Header名称,该Header作为参数传递JWT令牌 |
| | | userParamName: username #用户登录认证用户名参数名称 |
| | | pwdParamName: password #用户登录认证密码参数名称 |
| | | useDefaultController: true # 是否使用默认的JwtAuthController |
| | |
| | | @RestController |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/web/driverPlatform") |
| | | @Slf4j |
| | | @LoginNoRequired |
| | | //@LoginNoRequired |
| | | public class DriverPlatformController extends BaseController { |
| | | |
| | | @Autowired |
| | |
| | | @RestController |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/web/member") |
| | | @Slf4j |
| | | @LoginNoRequired |
| | | //@LoginNoRequired |
| | | public class InternalWebController extends BaseController { |
| | | |
| | | @Autowired |
| | |
| | | @RestController |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/web/pdaPlatform") |
| | | @Slf4j |
| | | @LoginNoRequired |
| | | //@LoginNoRequired |
| | | public class PdaPlatformController extends BaseController { |
| | | |
| | | |
| | |
| | | visits.setSourceType(Constants.ZERO); |
| | | return ApiResponse.success("查询成功", visitsService.createFk(visits,false,Constants.ZERO)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "来访事由", notes = "来访事由") |
| | | @PostMapping("/visitReason") |
| | | public ApiResponse<List<VisitReason>> visitReason() { |
| | |
| | | if(Objects.isNull(visits)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!(Constants.equalsInteger(memberId,visits.getMemberId()))){ |
| | | /* if(!(Constants.equalsInteger(memberId,visits.getMemberId()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"无此操作权限"); |
| | | } |
| | | }*/ |
| | | if(!StringUtils.equals(openid,visits.getOpenid())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"无此操作权限"); |
| | | } |