接入信息

master
wangbing 5 years ago
parent c2c2b0a704
commit 09985ad0ca

@ -714,7 +714,11 @@ public class JavaFxApplication extends Application {
mTree.setOnMouseClicked(new EventHandler<MouseEvent>() { mTree.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override @Override
public void handle(MouseEvent event) { public void handle(MouseEvent event) {
Object value = ((TreeItem) mTree.getSelectionModel().getSelectedItem()).getValue(); TreeItem model = (TreeItem) mTree.getSelectionModel().getSelectedItem();
if (model == null) {
return;
}
Object value = model.getValue();
if (value instanceof Project) { if (value instanceof Project) {
loadProject(); loadProject();
} else if (value instanceof Module) { } else if (value instanceof Module) {
@ -796,7 +800,7 @@ public class JavaFxApplication extends Application {
projectTreeItem.getChildren().remove(moduleTreeItem); projectTreeItem.getChildren().remove(moduleTreeItem);
project.getModules().remove(module); project.getModules().remove(module);
if (currentModule.hashCode() == module.hashCode()){ if (currentModule.hashCode() == module.hashCode()) {
loadProject(); loadProject();
} }
System.out.println("删除模块" + mo.getModuleName()); System.out.println("删除模块" + mo.getModuleName());
@ -850,7 +854,7 @@ public class JavaFxApplication extends Application {
getTreeItem().getParent().getChildren().remove(indexOf); getTreeItem().getParent().getChildren().remove(indexOf);
module.getTables().remove(indexOf); module.getTables().remove(indexOf);
if (currentTable.hashCode() == table.hashCode()){ if (currentTable.hashCode() == table.hashCode()) {
loadModule(); loadModule();
} }
System.out.println("删除对象" + table.getTableName()); System.out.println("删除对象" + table.getTableName());

@ -59,21 +59,21 @@
<top> <top>
<ToolBar prefHeight="30.0" prefWidth="200.0" BorderPane.alignment="CENTER"> <ToolBar prefHeight="30.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<items> <items>
<CheckBox mnemonicParsing="false" fx:id="All" text="All" selected="false"> <CheckBox mnemonicParsing="false" fx:id="All" text="All" selected="true">
</CheckBox> </CheckBox>
<CheckBox mnemonicParsing="false" fx:id="create" text="create" selected="false"> <CheckBox mnemonicParsing="false" fx:id="create" text="create" selected="true">
</CheckBox> </CheckBox>
<CheckBox mnemonicParsing="false" fx:id="delete" text="delete" selected="false"> <CheckBox mnemonicParsing="false" fx:id="delete" text="delete" selected="true">
</CheckBox> </CheckBox>
<CheckBox mnemonicParsing="false" fx:id="update" text="update" selected="false"> <CheckBox mnemonicParsing="false" fx:id="update" text="update" selected="true">
</CheckBox> </CheckBox>
<CheckBox mnemonicParsing="false" fx:id="find" text="find" selected="false"> <CheckBox mnemonicParsing="false" fx:id="find" text="find" selected="true">
</CheckBox> </CheckBox>
<CheckBox mnemonicParsing="false" fx:id="search" text="search" selected="false"> <CheckBox mnemonicParsing="false" fx:id="search" text="search" selected="true">
</CheckBox> </CheckBox>
<CheckBox mnemonicParsing="false" fx:id="get" text="get" selected="false"> <CheckBox mnemonicParsing="false" fx:id="get" text="get" selected="true">
</CheckBox> </CheckBox>
<CheckBox mnemonicParsing="false" fx:id="getAll" text="getAll" selected="false"> <CheckBox mnemonicParsing="false" fx:id="getAll" text="getAll" selected="true">
</CheckBox> </CheckBox>
</items> </items>
</ToolBar> </ToolBar>

@ -33,6 +33,11 @@ import ${domain}.frame.utils.MapperUtil;
import ${domain}.frame.utils.StringUtil; import ${domain}.frame.utils.StringUtil;
import ${domain}.module.wsys.mgr.LogerrManager; import ${domain}.module.wsys.mgr.LogerrManager;
<#if project.frameValue() = 1> <#if project.frameValue() = 1>
import ${domain}.module.wsys.ent.Visitor;
import ${domain}.module.wsys.mgr.VisitorManager;
import ${domain}.module.wsys.req.VisitorFindRequest;
import ${domain}.module.wsys.req.TokensBuildRequest;
import ${domain}.module.wsys.rsp.VisitorFindResponse;
import ${domain}.module.wsys.mgr.TokensManager; import ${domain}.module.wsys.mgr.TokensManager;
import ${domain}.module.wsys.req.TokensBuildRequest; import ${domain}.module.wsys.req.TokensBuildRequest;
import ${domain}.module.wsys.rsp.TokensBuildResponse; import ${domain}.module.wsys.rsp.TokensBuildResponse;
@ -74,6 +79,8 @@ public class GlobalController {
private String loginPage; private String loginPage;
@Autowired @Autowired
private FreeMarkerViewResolver viewResolver; private FreeMarkerViewResolver viewResolver;
@Autowired
private VisitorManager visitorManager;
@RequestMapping("/") @RequestMapping("/")
public String home() { public String home() {
@ -272,28 +279,42 @@ public class GlobalController {
return MapperUtil.toJson(response); return MapperUtil.toJson(response);
} }
String data = null; String data;
String appSecret = "01234567890123456789012345678901"; Visitor visitor;
// 检索应用码对应的接入对象,未找到或发生错误时,返回空白
VisitorFindRequest visitorFindRequest = new VisitorFindRequest();
visitorFindRequest.setAppKey(appKey);
VisitorFindResponse visitorFindResponse = visitorManager.find(visitorFindRequest, LocalData.getSysToken());
if (visitorFindResponse.hasError()) {
return MapperUtil.toJson(visitorFindResponse);
} else if (visitorFindResponse.getResult().size() == 0) {
response.addError(ErrorType.BUSINESS_ERROR, "接入信息不存在!");
return MapperUtil.toJson(response);
} else {
visitor = visitorFindResponse.getResult().get(0);
}
// 解码 // 解码
try { try {
data = AESUtil.decrypt2String(encryptData, appSecret); data = AESUtil.decrypt2String(encryptData, visitor.getAppSecret());
} catch (Exception e) { } catch (Exception e) {
response.addError(ErrorType.BUSINESS_ERROR, "解码失败,请确认编码是否正确!"); response.addError(ErrorType.BUSINESS_ERROR, "解码失败,请确认编码是否正确!");
return MapperUtil.toJson(response); return MapperUtil.toJson(response);
} }
// 验证签名 // 验证签名
String sign_ = MD5Util.encode(appSecret + data + timestamp); String sign_ = MD5Util.encode(visitor.getAppSecret() + data + timestamp);
if (!sign_.equals(sign)) { if (!sign_.equals(sign)) {
response.addError(ErrorType.BUSINESS_ERROR, "签名验证失败!"); response.addError(ErrorType.BUSINESS_ERROR, "签名验证失败!");
return AESUtil.encrypt2Base64(MapperUtil.toJson(response).getBytes(), appSecret); return AESUtil.encrypt2Base64(MapperUtil.toJson(response).getBytes(), visitor.getAppSecret());
} }
// 时效性验证 // 时效性验证
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
if (currentTime - timestamp > 2 * 60 * 1000) { if (currentTime - timestamp > 2 * 60 * 1000) {
response.addError(ErrorType.BUSINESS_ERROR, "请求过期, 或本地时间错误!"); response.addError(ErrorType.BUSINESS_ERROR, "请求过期, 或本地时间错误!");
return AESUtil.encrypt2Base64(MapperUtil.toJson(response).getBytes(), appSecret); return AESUtil.encrypt2Base64(MapperUtil.toJson(response).getBytes(), visitor.getAppSecret());
} }
<#-- --> <#-- -->
<#if project.frameValue() = 1> <#if project.frameValue() = 1>
@ -307,13 +328,13 @@ public class GlobalController {
LocalData.setToken(tokensBuildResponse.getToken()); LocalData.setToken(tokensBuildResponse.getToken());
if (!LocalData.getToken().hasRes(httpServletRequest.getServletPath())) { if (!LocalData.getToken().hasRes(httpServletRequest.getServletPath())) {
response.addError(ErrorType.BUSINESS_ERROR, "[" + httpServletRequest.getServletPath() + "]未授权的资源!"); response.addError(ErrorType.BUSINESS_ERROR, "[" + httpServletRequest.getServletPath() + "]未授权的资源!");
return AESUtil.encrypt2Base64(MapperUtil.toJson(response).getBytes(), appSecret); return AESUtil.encrypt2Base64(MapperUtil.toJson(response).getBytes(), visitor.getAppSecret());
} }
} else { } else {
String excluded = LocalData.getEnvironment().getProperty("web.url.auth.excluded", "") + ",/api/wsys/User/login"; String excluded = LocalData.getEnvironment().getProperty("web.url.auth.excluded", "") + ",/api/wsys/User/login";
if (!excluded.contains(excluded)) { if (!excluded.contains(excluded)) {
response.addError(ErrorType.BUSINESS_ERROR, "请通过登录接口获取Token!"); response.addError(ErrorType.BUSINESS_ERROR, "请通过登录接口获取Token!");
return AESUtil.encrypt2Base64(MapperUtil.toJson(response).getBytes(), appSecret); return AESUtil.encrypt2Base64(MapperUtil.toJson(response).getBytes(), visitor.getAppSecret());
} }
} }
</#if> </#if>
@ -334,7 +355,7 @@ public class GlobalController {
if (methodC == null) { if (methodC == null) {
response.addError(ErrorType.BUSINESS_ERROR, "未找到对应的方法!"); response.addError(ErrorType.BUSINESS_ERROR, "未找到对应的方法!");
return AESUtil.encrypt2Base64(MapperUtil.toJson(response).getBytes(), appSecret); return AESUtil.encrypt2Base64(MapperUtil.toJson(response).getBytes(), visitor.getAppSecret());
} }
Parameter[] parameters = methodC.getParameters(); Parameter[] parameters = methodC.getParameters();
@ -374,7 +395,7 @@ public class GlobalController {
e.getTargetException().printStackTrace(); e.getTargetException().printStackTrace();
response.addError(ErrorType.BUSINESS_ERROR, "方法执行错误[" + e.getTargetException().getMessage() + "]"); response.addError(ErrorType.BUSINESS_ERROR, "方法执行错误[" + e.getTargetException().getMessage() + "]");
} }
return AESUtil.encrypt2Base64(MapperUtil.toJson(response).getBytes(), appSecret); return AESUtil.encrypt2Base64(MapperUtil.toJson(response).getBytes(), visitor.getAppSecret());
} }
private static ConcurrentHashMap<String, SseEmitter> sseMap = new ConcurrentHashMap(); private static ConcurrentHashMap<String, SseEmitter> sseMap = new ConcurrentHashMap();

@ -0,0 +1,23 @@
package ${domain}.action.ajax.wsys;
import ${domain}.frame.auth.LocalData;
import ${domain}.module.wsys.mgr.SequenceManager;
import ${domain}.module.wsys.req.SequenceNextRequest;
import ${domain}.module.wsys.req.SequenceRamHexRequest;
import ${domain}.module.wsys.rsp.SequenceNextResponse;
import ${domain}.module.wsys.rsp.SequenceRamHexResponse;
import org.springframework.beans.factory.annotation.Autowired;
public class SequenceAjax {
@Autowired
private SequenceManager sequenceManager;
public SequenceNextResponse next(SequenceNextRequest request) {
return sequenceManager.next(request, LocalData.getToken());
}
public SequenceRamHexResponse ramHex(SequenceRamHexRequest request) {
return sequenceManager.ramHex(request, LocalData.getToken());
}
}

@ -75,7 +75,6 @@ public class UserAjax {
UserLoginResponse response = userManager.login(request, LocalData.getToken()); UserLoginResponse response = userManager.login(request, LocalData.getToken());
if (!response.hasError()) { if (!response.hasError()) {
Cookie cookie = CookieUtil.newCookie("token", response.getToken()); Cookie cookie = CookieUtil.newCookie("token", response.getToken());
cookie.setPath("/");
httpServletResponse.addCookie(cookie); httpServletResponse.addCookie(cookie);
} }
return response; return response;

@ -3,8 +3,10 @@ package ${domain}.module.wsys.mgr;
import ${domain}.frame.auth.Token; import ${domain}.frame.auth.Token;
import ${domain}.module.wsys.req.SequenceFindRequest; import ${domain}.module.wsys.req.SequenceFindRequest;
import ${domain}.module.wsys.req.SequenceNextRequest; import ${domain}.module.wsys.req.SequenceNextRequest;
import ${domain}.module.wsys.req.SequenceRamHexRequest;
import ${domain}.module.wsys.rsp.SequenceFindResponse; import ${domain}.module.wsys.rsp.SequenceFindResponse;
import ${domain}.module.wsys.rsp.SequenceNextResponse; import ${domain}.module.wsys.rsp.SequenceNextResponse;
import ${domain}.module.wsys.rsp.SequenceRamHexResponse;
/** /**
* *
@ -32,4 +34,13 @@ public interface SequenceManager {
* @return * @return
*/ */
SequenceNextResponse next(SequenceNextRequest request, Token token); SequenceNextResponse next(SequenceNextRequest request, Token token);
/**
* HEX
*
* @param request
* @param token
* @return
*/
SequenceRamHexResponse ramHex(SequenceRamHexRequest request, Token token);
} }

@ -1,22 +1,25 @@
package ${domain}.module.wsys.mgr; package ${domain}.module.wsys.mgr;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import ${domain}.frame.auth.Token; import ${domain}.frame.auth.Token;
import ${domain}.frame.base.ErrorType; import ${domain}.frame.base.ErrorType;
import ${domain}.frame.utils.IDgenerator; import ${domain}.frame.utils.IDgenerator;
import ${domain}.frame.utils.RandomUtil;
import ${domain}.frame.utils.ValidationUtil; import ${domain}.frame.utils.ValidationUtil;
import ${domain}.module.wsys.ent.Sequence; import ${domain}.module.wsys.ent.Sequence;
import ${domain}.module.wsys.mpr.SequenceMapper; import ${domain}.module.wsys.mpr.SequenceMapper;
import ${domain}.module.wsys.req.SequenceFindRequest; import ${domain}.module.wsys.req.SequenceFindRequest;
import ${domain}.module.wsys.req.SequenceNextRequest; import ${domain}.module.wsys.req.SequenceNextRequest;
import ${domain}.module.wsys.req.SequenceRamHexRequest;
import ${domain}.module.wsys.rsp.SequenceFindResponse; import ${domain}.module.wsys.rsp.SequenceFindResponse;
import ${domain}.module.wsys.rsp.SequenceNextResponse; import ${domain}.module.wsys.rsp.SequenceNextResponse;
import ${domain}.module.wsys.rsp.SequenceRamHexResponse;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
@ -150,4 +153,35 @@ public class SequenceManagerImpl implements SequenceManager {
value)); value));
return response; return response;
} }
/**
* HEX
*
* @param request
* @param token
* @return
*/
@Override
public SequenceRamHexResponse ramHex(SequenceRamHexRequest request, Token token) {
SequenceRamHexResponse response = new SequenceRamHexResponse();
ValidationUtil.validate(request, response);
if (response.hasError()) {
return response;
}
String sequence = RandomUtil.getString("0123456789abcdef", request.getSize());
response.setSequence(sequence);
if (request.isUpperCase()) {
response.setSequence(response.getSequence().toUpperCase());
}
if (StringUtil.isNotEmpty(request.getPrefix())) {
response.setSequence(request.getPrefix() + response.getSequence());
}
if (StringUtil.isNotEmpty(request.getSuffix())) {
response.setSequence(response.getSequence() + request.getSuffix());
}
return response;
}
} }

@ -0,0 +1,65 @@
package ${domain}.module.wsys.req;
import ${domain}.frame.base.BaseRequest;
/**
* SequenceNextRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2020-06-25
*/
public class SequenceRamHexRequest extends BaseRequest {
/**
*
*/
private String prefix;
/**
*
*/
private String suffix;
/**
*
*/
private int size = 6;
/**
*
*/
private boolean upperCase;
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getSuffix() {
return suffix;
}
public void setSuffix(String suffix) {
this.suffix = suffix;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public boolean isUpperCase() {
return upperCase;
}
public void setUpperCase(boolean upperCase) {
this.upperCase = upperCase;
}
}

@ -39,7 +39,7 @@ public class VisitorCreateRequest extends BaseRequest {
* . * .
*/ */
@NotBlank(message = "[appSecret]安全码不能为空") @NotBlank(message = "[appSecret]安全码不能为空")
@Length(min = 0, max = 16, message = "[appSecret]安全码长度不合法(0-16)") @Length(min = 32, max = 32, message = "[appSecret]安全码长度不合法(32)")
private String appSecret; private String appSecret;
/** /**

@ -45,7 +45,7 @@ public class VisitorUpdateRequest extends BaseUpdateRequest {
* . * .
*/ */
@NotBlank(message = "[appSecret]安全码不能为空") @NotBlank(message = "[appSecret]安全码不能为空")
@Length(min = 0, max = 16, message = "[appSecret]安全码长度不合法(0-16)") @Length(min = 32, max = 32, message = "[appSecret]安全码长度不合法(32)")
private String appSecret; private String appSecret;
/** /**

@ -0,0 +1,26 @@
package ${domain}.module.wsys.rsp;
import ${domain}.frame.base.BaseResponse;
/**
* SequenceNextResponse -
*
* @author wangbing
* @version 0.0.1
* @since 2020-06-25
*/
public class SequenceRamHexResponse extends BaseResponse {
/**
*
*/
private String sequence;
public String getSequence() {
return sequence;
}
public void setSequence(String sequence) {
this.sequence = sequence;
}
}

@ -208,7 +208,7 @@
<field defaultValue="NULL" fieldComment="应用名称" fieldLength="50" fieldName="APP_NAME" fieldType="String_var50" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/> <field defaultValue="NULL" fieldComment="应用名称" fieldLength="50" fieldName="APP_NAME" fieldType="String_var50" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="NULL" fieldComment="应用简介" fieldLength="255" fieldName="APP_NOTE" fieldType="String_var255" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="false" isUnique="false"/> <field defaultValue="NULL" fieldComment="应用简介" fieldLength="255" fieldName="APP_NOTE" fieldType="String_var255" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="NULL" fieldComment="应用码" fieldLength="50" fieldName="APP_KEY" fieldType="String_var50" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="true"/> <field defaultValue="NULL" fieldComment="应用码" fieldLength="50" fieldName="APP_KEY" fieldType="String_var50" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="true"/>
<field defaultValue="NULL" fieldComment="安全码" fieldLength="16" fieldName="APP_SECRET" fieldType="String_var" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/> <field defaultValue="NULL" fieldComment="安全码" fieldLength="32" fieldName="APP_SECRET" fieldType="String_var" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="NULL" fieldComment="是否有效" fieldLength="0" fieldName="VALID" fieldType="Boolean" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/> <field defaultValue="NULL" fieldComment="是否有效" fieldLength="0" fieldName="VALID" fieldType="Boolean" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="" fieldComment="行版本" fieldLength="0" fieldName="ROW_VERSION" fieldType="Long" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/> <field defaultValue="" fieldComment="行版本" fieldLength="0" fieldName="ROW_VERSION" fieldType="Long" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>
<field defaultValue="0" fieldComment="是否已删除" fieldLength="0" fieldName="IS_DELETED" fieldType="Boolean" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/> <field defaultValue="0" fieldComment="是否已删除" fieldLength="0" fieldName="IS_DELETED" fieldType="Boolean" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>

@ -263,7 +263,7 @@ CREATE TABLE `SYS_VISITOR` (
`APP_NAME` VARCHAR(50) NOT NULL COMMENT '应用名称', `APP_NAME` VARCHAR(50) NOT NULL COMMENT '应用名称',
`APP_NOTE` VARCHAR(250) COMMENT '应用简介', `APP_NOTE` VARCHAR(250) COMMENT '应用简介',
`APP_KEY` VARCHAR(50) NOT NULL COMMENT '应用码', `APP_KEY` VARCHAR(50) NOT NULL COMMENT '应用码',
`APP_SECRET` VARCHAR(16) NOT NULL COMMENT '安全码', `APP_SECRET` VARCHAR(32) NOT NULL COMMENT '安全码',
`VALID` TINYINT(1) NOT NULL COMMENT '是否有效', `VALID` TINYINT(1) NOT NULL COMMENT '是否有效',
`ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本',
`IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除',

@ -9,7 +9,7 @@ CREATE TABLE `SYS_VISITOR` (
`APP_NAME` VARCHAR(50) NOT NULL COMMENT '应用名称', `APP_NAME` VARCHAR(50) NOT NULL COMMENT '应用名称',
`APP_NOTE` VARCHAR(250) COMMENT '应用简介', `APP_NOTE` VARCHAR(250) COMMENT '应用简介',
`APP_KEY` VARCHAR(50) NOT NULL COMMENT '应用码', `APP_KEY` VARCHAR(50) NOT NULL COMMENT '应用码',
`APP_SECRET` VARCHAR(16) NOT NULL COMMENT '安全码', `APP_SECRET` VARCHAR(32) NOT NULL COMMENT '安全码',
`VALID` TINYINT(1) NOT NULL COMMENT '是否有效', `VALID` TINYINT(1) NOT NULL COMMENT '是否有效',
`ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本',
`IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除',

@ -407,7 +407,7 @@ CREATE TABLE "SYS_VISITOR" (
"APP_NAME" VARCHAR2(50) NULL, "APP_NAME" VARCHAR2(50) NULL,
"APP_NOTE" VARCHAR2(250) NULL, "APP_NOTE" VARCHAR2(250) NULL,
"APP_KEY" VARCHAR2(50) NULL, "APP_KEY" VARCHAR2(50) NULL,
"APP_SECRET" VARCHAR2(16) NULL, "APP_SECRET" VARCHAR2(32) NULL,
"VALID" CHAR(1) NULL, "VALID" CHAR(1) NULL,
"ROW_VERSION" NUMBER(19) NOT NULL, "ROW_VERSION" NUMBER(19) NOT NULL,
"IS_DELETED" CHAR(1) NOT NULL, "IS_DELETED" CHAR(1) NOT NULL,

@ -9,7 +9,7 @@ CREATE TABLE "SYS_VISITOR" (
"APP_NAME" VARCHAR2(50) NULL, "APP_NAME" VARCHAR2(50) NULL,
"APP_NOTE" VARCHAR2(250) NULL, "APP_NOTE" VARCHAR2(250) NULL,
"APP_KEY" VARCHAR2(50) NULL, "APP_KEY" VARCHAR2(50) NULL,
"APP_SECRET" VARCHAR2(16) NULL, "APP_SECRET" VARCHAR2(32) NULL,
"VALID" CHAR(1) NULL, "VALID" CHAR(1) NULL,
"ROW_VERSION" NUMBER(19) NOT NULL, "ROW_VERSION" NUMBER(19) NOT NULL,
"IS_DELETED" CHAR(1) NOT NULL, "IS_DELETED" CHAR(1) NOT NULL,

@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS SYS_VISITOR (
"APP_NAME" VARCHAR(50) NOT NULL, "APP_NAME" VARCHAR(50) NOT NULL,
"APP_NOTE" VARCHAR(250), "APP_NOTE" VARCHAR(250),
"APP_KEY" VARCHAR(50) NOT NULL, "APP_KEY" VARCHAR(50) NOT NULL,
"APP_SECRET" VARCHAR(16) NOT NULL, "APP_SECRET" VARCHAR(32) NOT NULL,
"VALID" BOOLEAN NOT NULL, "VALID" BOOLEAN NOT NULL,
"ROW_VERSION" BIGINT NOT NULL, "ROW_VERSION" BIGINT NOT NULL,
"IS_DELETED" BOOLEAN NOT NULL, "IS_DELETED" BOOLEAN NOT NULL,

@ -17,10 +17,12 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="开始日期" prop="startDate"> <el-form-item label="开始日期" prop="startDate">
<el-date-picker v-model="vm.startDate" clearable size="mini" placeholder="请输入开始日期" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> <el-date-picker v-model="vm.startDate" clearable size="mini" placeholder="请输入开始日期" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="结束日期" prop="endDate"> <el-form-item label="结束日期" prop="endDate">
<el-date-picker v-model="vm.endDate" clearable size="mini" placeholder="请输入结束日期" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> <el-date-picker v-model="vm.endDate" clearable size="mini" placeholder="请输入结束日期" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" icon="el-icon-search" @click="onSearch">搜索</el-button> <el-button type="primary" size="mini" icon="el-icon-search" @click="onSearch">搜索</el-button>
@ -154,10 +156,22 @@
<el-page-header slot="title" @back="form.formShow = false" :content="form.formTitle"></el-page-header> <el-page-header slot="title" @back="form.formShow = false" :content="form.formTitle"></el-page-header>
<el-form class="form" :model="form" :inline="true" :rules="formRules" ref="form" label-position="right" label-width="90px"> <el-form class="form" :model="form" :inline="true" :rules="formRules" ref="form" label-position="right"
label-width="90px">
<el-form-item label="应用名称" prop="appName"> <el-form-item label="应用名称" prop="appName">
<el-input v-model="form.appName" clearable size="mini" placeholder="请输入应用名称" maxlength="50"></el-input> <el-input v-model="form.appName" clearable size="mini" placeholder="请输入应用名称" maxlength="50"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="应用码" prop="appKey">
<el-row>
<el-col :span="23">
<el-input v-model="form.appKey" clearable size="mini" placeholder="请输入应用码"
maxlength="50"></el-input>
</el-col>
<el-col :span="1">
<el-link icon="el-icon-refresh" :underline="false" style="padding: 10px;" @click="refreshAppKey"></el-link>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="应用简介" prop="appNote"> <el-form-item label="应用简介" prop="appNote">
<el-input v-model="form.appNote" <el-input v-model="form.appNote"
clearable clearable
@ -167,11 +181,21 @@
maxlength="255" maxlength="255"
show-word-limit></el-input> show-word-limit></el-input>
</el-form-item> </el-form-item>
<el-form-item label="应用码" prop="appKey">
<el-input v-model="form.appKey" clearable size="mini" placeholder="请输入应用码" maxlength="50"></el-input>
</el-form-item>
<el-form-item label="安全码" prop="appSecret"> <el-form-item label="安全码" prop="appSecret">
<el-input v-model="form.appSecret" clearable size="mini" placeholder="请输入安全码" maxlength="16"></el-input> <el-row>
<el-col :span="23">
<el-input v-model="form.appSecret"
clearable
size="mini"
placeholder="请输入安全码"
type="textarea"
minlength="32"
maxlength="32"></el-input>
</el-col>
<el-col :span="1">
<el-link icon="el-icon-refresh" :underline="false" style="padding: 10px;" @click="refreshAppSecret"></el-link>
</el-col>
</el-row>
</el-form-item> </el-form-item>
<el-form-item label="是否有效" prop="valid"> <el-form-item label="是否有效" prop="valid">
<el-radio-group v-model="form.valid" clearable size="mini"> <el-radio-group v-model="form.valid" clearable size="mini">
@ -203,8 +227,8 @@
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
totalCount: 0, totalCount: 0,
sortKey:'CREATE_TIME', sortKey: 'CREATE_TIME',
sortType:'DESC' sortType: 'DESC'
}, },
form: {//待提交表单 form: {//待提交表单
formTitle: null, formTitle: null,
@ -231,7 +255,7 @@
], ],
appSecret: [ appSecret: [
{required: true, message: '安全码不能为空', trigger: 'blur'}, {required: true, message: '安全码不能为空', trigger: 'blur'},
{min: 1, max: 16, message: '安全码长度在 1 到 16 个字符', trigger: 'blur'} {min: 32, max: 32, message: '安全码长度为32个字符', trigger: 'blur'}
], ],
valid: [ valid: [
{required: true, message: '是否有效不能为空', trigger: 'blur'}, {required: true, message: '是否有效不能为空', trigger: 'blur'},
@ -247,7 +271,7 @@
this.form.appNote = ""; this.form.appNote = "";
this.form.appKey = ""; this.form.appKey = "";
this.form.appSecret = ""; this.form.appSecret = "";
this.form.valid = ""; this.form.valid = true;
}, },
onEdit: function (item) { onEdit: function (item) {
this.form.formTitle = "应用接入编辑"; this.form.formTitle = "应用接入编辑";
@ -277,6 +301,24 @@
}.bind(this)).catch(function (action) { }.bind(this)).catch(function (action) {
}); });
},
refreshAppKey: function () {
new Ajax("wsys", "sequence", "ramHex").post({size:16,prefix:"APP"}, function (response) {
if (response.errors.length > 0) {
nav.e(response.errors[0].message);
} else {
this.form.appKey = response.sequence;
}
}.bind(this))
},
refreshAppSecret: function () {
new Ajax("wsys", "sequence", "ramHex").post({size:32}, function (response) {
if (response.errors.length > 0) {
nav.e(response.errors[0].message);
} else {
this.form.appSecret = response.sequence;
}
}.bind(this))
} }
}, },
mounted: function () { mounted: function () {

Loading…
Cancel
Save

Powered by TurnKey Linux.