Merge branch 'master' of https://bdgit.educoder.net/zhailw/gdms into wmj
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
|
<data-source source="LOCAL" name="@localhost:gdms" uuid="356b1cbb-8e8d-401f-bdfc-b3e917bc8301">
|
||||||
|
<driver-ref>mariadb</driver-ref>
|
||||||
|
<synchronize>true</synchronize>
|
||||||
|
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver>
|
||||||
|
<jdbc-url>jdbc:mariadb://localhost:3306/gdms</jdbc-url>
|
||||||
|
<driver-properties>
|
||||||
|
<property name="autoReconnect" value="true" />
|
||||||
|
<property name="zeroDateTimeBehavior" value="convertToNull" />
|
||||||
|
<property name="tinyInt1isBit" value="false" />
|
||||||
|
<property name="characterEncoding" value="utf8" />
|
||||||
|
<property name="characterSetResults" value="utf8" />
|
||||||
|
<property name="yearIsDateType" value="false" />
|
||||||
|
</driver-properties>
|
||||||
|
</data-source>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -1,6 +1,8 @@
|
|||||||
<component name="ProjectDictionaryState">
|
<component name="ProjectDictionaryState">
|
||||||
<dictionary name="zhai_">
|
<dictionary name="zhai_">
|
||||||
<words>
|
<words>
|
||||||
|
<w>gdms</w>
|
||||||
|
<w>mariadb</w>
|
||||||
<w>synchronizable</w>
|
<w>synchronizable</w>
|
||||||
</words>
|
</words>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="false" project-jdk-name="10" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Context>
|
||||||
|
<Resource type="javax.sql.DataSource"
|
||||||
|
name="jdbc/gdms"
|
||||||
|
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
|
||||||
|
driverClassName="com.mysql.jdbc.Driver"
|
||||||
|
url="jdbc:mariadb://localhost:3306/gdms"
|
||||||
|
username="gdms"
|
||||||
|
password="GDMS"/>
|
||||||
|
</Context>
|
@ -0,0 +1,5 @@
|
|||||||
|
0 windows home 1809
|
||||||
|
1 java jdk10 默认路径
|
||||||
|
2 tomcat8.5 默认路径
|
||||||
|
3 mariaDB10.3 默认路径
|
||||||
|
4
|
@ -0,0 +1 @@
|
|||||||
|
CREATE DATABASE `GDMS`;
|
After Width: | Height: | Size: 101 KiB |
After Width: | Height: | Size: 286 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 382 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 63 KiB |
@ -1,21 +0,0 @@
|
|||||||
package core.operation;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface Executable {
|
|
||||||
default void execute(Map<String, Object> options) throws Exception {
|
|
||||||
checkSelf();
|
|
||||||
beforeRun(options);
|
|
||||||
run(options);
|
|
||||||
afterRun(options);
|
|
||||||
}
|
|
||||||
|
|
||||||
void checkSelf ()throws Exception;
|
|
||||||
|
|
||||||
void beforeRun(Map<String, Object> options);
|
|
||||||
|
|
||||||
void run(Map<String, Object> options);
|
|
||||||
|
|
||||||
void afterRun(Map<String, Object> options);
|
|
||||||
}
|
|
@ -0,0 +1,18 @@
|
|||||||
|
package core.operation;
|
||||||
|
|
||||||
|
import core.user.User;
|
||||||
|
import dao.DBManagement;
|
||||||
|
import error.GExcptSQL;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class Select extends Operation {
|
||||||
|
|
||||||
|
private Map<String, Object> options;
|
||||||
|
private User subject;
|
||||||
|
@Override
|
||||||
|
public void execute(User subject) throws GExcptSQL {
|
||||||
|
this.setSubject(subject);
|
||||||
|
DBManagement.update("update stu ");
|
||||||
|
}
|
||||||
|
}
|
@ -1,13 +1,15 @@
|
|||||||
package core.operation;
|
package core.operation;
|
||||||
|
|
||||||
import java.io.File;
|
import core.user.User;
|
||||||
|
import error.GExcptSQL;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class UploadFileOperation extends Operation {
|
public class UploadFileOperation extends Operation {
|
||||||
Map<String, Object> options;
|
Map<String, Object> options;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(Map<String, Object> options) {
|
public void execute(User subject) throws GExcptSQL {
|
||||||
//todo
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
package core.operation.utils;
|
package core.operation.utils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public interface util {
|
public interface util {
|
||||||
static void checkOptions(File jsonFile, Map<String, Object> options){
|
static String stringOptionsFormat(String options){
|
||||||
|
return options.replaceAll(" {2,}", " ") ;
|
||||||
|
}
|
||||||
|
static Map<String, Object> string2MapOptions(String sOptions){
|
||||||
|
sOptions = stringOptionsFormat(sOptions);
|
||||||
|
Map<String, Object> options = new HashMap<>();
|
||||||
|
String[] sOpts = sOptions.split(" ");
|
||||||
|
for(int i=0;i<sOpts.length;i++){
|
||||||
|
options.put(sOpts[i],sOpts[++i]);
|
||||||
|
}
|
||||||
|
return options;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
package core.process;
|
|
||||||
|
|
||||||
import core.operation.Operation;
|
|
||||||
import core.user.User;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
public class AtomProcess extends Process {
|
|
||||||
private User subject;
|
|
||||||
private Operation operation;
|
|
||||||
private Map<String, Object> option;
|
|
||||||
|
|
||||||
public AtomProcess(String subjectName, String operationName, Map<String, Object> option, String info) throws Exception {
|
|
||||||
super(info);
|
|
||||||
this.subject = (User) core.utils.GetObjectByName.getUserByName(subjectName);
|
|
||||||
this.operation = (Operation) core.utils.GetObjectByName.getOperationByName(operationName);
|
|
||||||
this.option = option;
|
|
||||||
this.operation.setSubject(this.subject);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void execute() throws Exception {
|
|
||||||
this.operation.execute(this.option);
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,7 @@
|
|||||||
|
package core.process;
|
||||||
|
|
||||||
|
public class AuxiliaryProcess extends Process {
|
||||||
|
public AuxiliaryProcess(String permission, String operationName, String processOptions, String info) throws Exception {
|
||||||
|
super(permission, operationName, processOptions, info);
|
||||||
|
}
|
||||||
|
}
|
@ -1,17 +0,0 @@
|
|||||||
package core.process;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class CompoundProcess extends Process {
|
|
||||||
private List<Process> processes;
|
|
||||||
public CompoundProcess(String info) {
|
|
||||||
super(info);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute() throws Exception {
|
|
||||||
for(Process process:processes){
|
|
||||||
process.execute();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,27 @@
|
|||||||
|
package core.process;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Condition {
|
||||||
|
public List<Process> getProcesses() {
|
||||||
|
return processes;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Process> processes;
|
||||||
|
public Process get(int index){
|
||||||
|
return processes.get(index);
|
||||||
|
}
|
||||||
|
public Condition(List<Process> processes){
|
||||||
|
this.processes=processes;
|
||||||
|
}
|
||||||
|
public Condition(){
|
||||||
|
processes = new ArrayList<>();
|
||||||
|
}
|
||||||
|
public void add(Process process){
|
||||||
|
this.processes.add(process);
|
||||||
|
}
|
||||||
|
public void add(List<Process> processes){
|
||||||
|
this.processes.addAll(processes);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package core.process;
|
||||||
|
|
||||||
|
public class LastProcess extends Process{
|
||||||
|
|
||||||
|
public LastProcess(String permission, String operationName, String processOptions, String info) throws Exception {
|
||||||
|
super(permission, operationName, processOptions, info);
|
||||||
|
}
|
||||||
|
}
|
@ -1,20 +1,75 @@
|
|||||||
package core.process;
|
package core.process;
|
||||||
|
|
||||||
import core.operation.Executable;
|
|
||||||
import core.operation.Operation;
|
import core.operation.Operation;
|
||||||
|
import core.user.User;
|
||||||
import java.io.File;
|
import error.GExcptFactory;
|
||||||
import java.util.List;
|
import error.GExcptSQL;
|
||||||
|
|
||||||
public abstract class Process {
|
public abstract class Process {
|
||||||
|
|
||||||
|
private String permission;
|
||||||
|
private Operation operation;
|
||||||
|
private String buttonName;
|
||||||
private String info;
|
private String info;
|
||||||
|
private String processOptions;
|
||||||
|
|
||||||
|
public Process(String permission, String operationName, String processOptions, String info) throws Exception {
|
||||||
|
super();
|
||||||
|
this.setPermission(permission);
|
||||||
|
this.setOperation(operationName);
|
||||||
|
this.setInfo(info);
|
||||||
|
this.setProcessOptions(processOptions);
|
||||||
|
operation.setProcessOperations(processOptions);
|
||||||
|
}
|
||||||
|
|
||||||
public Process(String info) {
|
public void setUserOperations(String key,Object value){
|
||||||
this.info=info;
|
this.operation.addUserOperations(key,value);
|
||||||
|
}
|
||||||
|
public void execute(User subject) throws GExcptSQL {
|
||||||
|
this.operation.execute(subject);
|
||||||
|
}
|
||||||
|
private void setOperation(String operationName) throws GExcptFactory {
|
||||||
|
try {
|
||||||
|
this.operation = (Operation) core.utils.GetObjectByName.getOperationByName(operationName);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new GExcptFactory("create"+operationName+"failure");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void execute()throws Exception;
|
public void setInfo(String info) {
|
||||||
public String getInfo() {
|
this.info = info;
|
||||||
|
}
|
||||||
|
public String getButtonName() {
|
||||||
|
return buttonName;
|
||||||
|
}
|
||||||
|
public void setButtonName(String buttonName) {
|
||||||
|
this.buttonName = buttonName;
|
||||||
|
}
|
||||||
|
public String getInfo() {
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
public String getPermission() {
|
||||||
|
return permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPermission(String permission) {
|
||||||
|
this.permission = permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Operation getOperation() {
|
||||||
|
return operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOperation(Operation operation) {
|
||||||
|
this.operation = operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProcessOptions() {
|
||||||
|
return processOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcessOptions(String processOptions) {
|
||||||
|
this.processOptions = processOptions;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,25 @@
|
|||||||
package core.process;
|
package core.process;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class ProcessManagement {
|
public class ProcessManagement {
|
||||||
private CompoundProcess processes;
|
private List<TemporaryProcess> temporaryProcesses;
|
||||||
|
private Map<String, List<Process>> lastProcesses;
|
||||||
|
private List<AuxiliaryProcess> auxiliaryProcesses;
|
||||||
public void setProcessesByJson(File file){
|
public void setProcessesByJson(File file){
|
||||||
//todo
|
//todo
|
||||||
}
|
}
|
||||||
public void execute() throws Exception {
|
public Process getTemporaryProcess(int index){
|
||||||
processes.execute();
|
return temporaryProcesses.get(index);
|
||||||
}
|
}
|
||||||
|
public Condition getCondition(String userType, List<Integer> index){
|
||||||
|
Condition condition = new Condition(this.lastProcesses.get(userType));
|
||||||
|
for(int i:index){
|
||||||
|
condition.add(getTemporaryProcess(i));
|
||||||
|
}
|
||||||
|
return condition;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
package core.process;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class TemporaryProcess extends Process {
|
||||||
|
public TemporaryProcess(String permission, String operationName, String processOptions, String info) throws Exception {
|
||||||
|
super(permission, operationName, processOptions, info);
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,4 @@
|
|||||||
|
package core.user;
|
||||||
|
|
||||||
|
public class Administrator {
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
package dao;
|
||||||
|
|
||||||
|
import java.sql.*;
|
||||||
|
|
||||||
|
import error.GExcptSQL;
|
||||||
|
import org.apache.tomcat.jdbc.pool.DataSource;
|
||||||
|
import org.apache.tomcat.jdbc.pool.PoolProperties;
|
||||||
|
|
||||||
|
|
||||||
|
public class DBManagement {
|
||||||
|
|
||||||
|
static final String driverClassName="org.mariadb.jdbc.Driver";
|
||||||
|
static final String url="jdbc:mariadb://localhost:3306/gdms";
|
||||||
|
static final String username="gdms";
|
||||||
|
static final String password="GDMS";
|
||||||
|
|
||||||
|
public static DataSource dataSource = new DataSource();
|
||||||
|
|
||||||
|
private static boolean ifInit = false;
|
||||||
|
|
||||||
|
public static void init(){
|
||||||
|
PoolProperties poolProperties = new PoolProperties();
|
||||||
|
poolProperties.setUrl(url);
|
||||||
|
poolProperties.setDriverClassName(driverClassName);
|
||||||
|
poolProperties.setUsername(username);
|
||||||
|
poolProperties.setPassword(password);
|
||||||
|
dataSource.setPoolProperties(poolProperties);
|
||||||
|
try {
|
||||||
|
Class.forName(driverClassName);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
ifInit = true;
|
||||||
|
}
|
||||||
|
public static Connection getConnection(){
|
||||||
|
if(!ifInit) return null;
|
||||||
|
try {
|
||||||
|
return DriverManager.getConnection(url,username,password);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResultSet query(String sql) throws Exception {
|
||||||
|
if(!ifInit) return null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
Connection con = null;
|
||||||
|
try{
|
||||||
|
con = DBManagement.getConnection();
|
||||||
|
Statement stmt = con.createStatement();
|
||||||
|
rs = stmt.executeQuery(sql);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new GExcptSQL("Connect Failure");
|
||||||
|
}finally {
|
||||||
|
if(con!=null) {
|
||||||
|
try {
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new GExcptSQL("Connection Close Failure");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rs;
|
||||||
|
}
|
||||||
|
public static void update(String sql) throws GExcptSQL {
|
||||||
|
if(!ifInit) return;
|
||||||
|
Connection con = null;
|
||||||
|
try{
|
||||||
|
con = DBManagement.getConnection();
|
||||||
|
Statement stmt = con.createStatement();
|
||||||
|
stmt.executeUpdate(sql);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new GExcptSQL("Connect Failure");
|
||||||
|
}finally {
|
||||||
|
if(con!=null) {
|
||||||
|
try {
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new GExcptSQL("Connection Close Failure");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,6 @@
|
|||||||
package dao;
|
package dao;
|
||||||
|
|
||||||
public interface Utils {
|
public interface Utils {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
package error;
|
||||||
|
|
||||||
|
import core.operation.Operation;
|
||||||
|
|
||||||
|
public abstract class GExcpt extends Exception {
|
||||||
|
String info;
|
||||||
|
public GExcpt(String info){
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package error;
|
||||||
|
|
||||||
|
public class GExcptFactory extends GExcpt {
|
||||||
|
public GExcptFactory(String info) {
|
||||||
|
super(info);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package error;
|
||||||
|
|
||||||
|
public class GExcptSQL extends GExcpt {
|
||||||
|
|
||||||
|
public GExcptSQL(String info) {
|
||||||
|
super(info);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
package gdms;
|
||||||
|
|
||||||
|
public interface Mode {
|
||||||
|
public static int strict = 1;
|
||||||
|
public static int debug = 1;
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package gdms;
|
||||||
|
import core.user.Student;
|
||||||
|
import core.user.User;
|
||||||
|
import dao.DBManagement;
|
||||||
|
import org.apache.tomcat.jdbc.pool.DataSource;
|
||||||
|
|
||||||
|
import javax.naming.Context;
|
||||||
|
import javax.naming.InitialContext;
|
||||||
|
import javax.naming.NamingException;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class test {
|
||||||
|
public test(){
|
||||||
|
Connection con = null;
|
||||||
|
try{
|
||||||
|
con = DBManagement.getConnection();
|
||||||
|
Statement stmt = con.createStatement(); //创建Statement对象
|
||||||
|
System.out.print("成功连接到数据库!");
|
||||||
|
String sql = "select * from test";
|
||||||
|
ResultSet rs = stmt.executeQuery(sql);
|
||||||
|
rs.next();
|
||||||
|
System.out.println(rs.getString("name"));
|
||||||
|
rs.close();
|
||||||
|
stmt.close();
|
||||||
|
con.close();
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}finally {
|
||||||
|
if(con!=null) {
|
||||||
|
try {
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public static void main(String argc[]) throws NamingException, SQLException {
|
||||||
|
new test();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package init;
|
||||||
|
|
||||||
|
import dao.DBManagement;
|
||||||
|
import gdms.test;
|
||||||
|
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.annotation.WebServlet;
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@WebServlet(name = "Init")
|
||||||
|
public class Init extends HttpServlet {
|
||||||
|
public void init(){
|
||||||
|
DBManagement.init();
|
||||||
|
new test();
|
||||||
|
}
|
||||||
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
<%--
|
||||||
|
Created by IntelliJ IDEA.
|
||||||
|
User: lenovo
|
||||||
|
Date: 2019/1/9
|
||||||
|
Time: 12:11
|
||||||
|
To change this template use File | Settings | File Templates.
|
||||||
|
--%>
|
||||||
|
<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.Date" %>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<%!Date date =new Date();%>
|
||||||
|
<div class="testp">时间是:<%=date%></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,4 @@
|
|||||||
|
function a(){
|
||||||
|
alert(123);
|
||||||
|
}
|
||||||
|
window.onload=a();
|
@ -0,0 +1,7 @@
|
|||||||
|
function test6() {
|
||||||
|
$('.tes').load('server.jsp .testp');
|
||||||
|
|
||||||
|
}
|
||||||
|
$(document).ready(function () {
|
||||||
|
window.setInterval('test6()',1000);
|
||||||
|
});
|
@ -0,0 +1,7 @@
|
|||||||
|
function showtime() {
|
||||||
|
var tim=new Date();
|
||||||
|
$('.tes2').html(tim);
|
||||||
|
}
|
||||||
|
$(document).ready(function () {
|
||||||
|
window.setInterval('showtime()',1000);
|
||||||
|
})
|
@ -0,0 +1,57 @@
|
|||||||
|
<%--
|
||||||
|
Created by IntelliJ IDEA.
|
||||||
|
User: lenovo
|
||||||
|
Date: 2019/1/9
|
||||||
|
Time: 13:07
|
||||||
|
To change this template use File | Settings | File Templates.
|
||||||
|
--%>
|
||||||
|
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>毕业设计管理系统</title>
|
||||||
|
<link type="text/css" rel="stylesheet" href="cssFile/login-style.css">
|
||||||
|
<script type="text/javascript" src="jsFile/jquery-3.3.1.js"></script>
|
||||||
|
<script type="text/javascript" src="jsFile/login.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="main">
|
||||||
|
<div class="top-bar">
|
||||||
|
<div class="top-center-bar">
|
||||||
|
<div class="logo">GDMS</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="img-bar">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="login-cont">
|
||||||
|
<form method="post" action="#">
|
||||||
|
<input class="input-text username-text" type="text" name="username"
|
||||||
|
placeholder="请输入学号">
|
||||||
|
<input class="input-text password-text" type="password" name="password"
|
||||||
|
placeholder="请输入密码">
|
||||||
|
<input class="submit-style" type="submit" value="登陆">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="register-area">
|
||||||
|
<div class="welcome-text"><h1>欢迎使用</h1><p>落日无边江不尽,此身此日更须忙</p></div>
|
||||||
|
<div class="to-any to-register">注册</div>
|
||||||
|
<div class="to-any to-login">登陆</div>
|
||||||
|
</div>
|
||||||
|
<div class="register-cont">
|
||||||
|
<form method="post" action="#">
|
||||||
|
<input class="register-input-text sno-text" type="text" name="sno"
|
||||||
|
placeholder="学号">
|
||||||
|
<input class="register-input-text name-text" type="text" name="name"
|
||||||
|
placeholder="姓名">
|
||||||
|
<input class="register-input-text e-mail-text" type="text" name="e-mail"
|
||||||
|
placeholder="邮箱">
|
||||||
|
<input class="register-input-text password-text" type="password" name="password"
|
||||||
|
placeholder="请输入密码">
|
||||||
|
<input class="register-input-text check-password-text" type="password" name="password"
|
||||||
|
placeholder="请输入密码">
|
||||||
|
<input class="register-submit-style" type="submit" value="注册">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
After Width: | Height: | Size: 452 KiB |
After Width: | Height: | Size: 650 KiB |
@ -0,0 +1,164 @@
|
|||||||
|
.img-bar{
|
||||||
|
width: 100%;
|
||||||
|
height: 600px;
|
||||||
|
background: url("images/login-img2.jpg");
|
||||||
|
}
|
||||||
|
.top-bar{
|
||||||
|
width: 100%;
|
||||||
|
height: 55px;
|
||||||
|
background-color: #c13139;
|
||||||
|
overflow: hidden;
|
||||||
|
z-index: 2;
|
||||||
|
box-shadow: 5px 0px 10px rgba(0,0,0,0.47);
|
||||||
|
}
|
||||||
|
.top-center-bar{
|
||||||
|
height: 100%;
|
||||||
|
width: 900px;
|
||||||
|
background-color: #c6333e;
|
||||||
|
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.42);
|
||||||
|
margin: 0px auto;
|
||||||
|
}
|
||||||
|
.top-center-bar .logo{
|
||||||
|
position: absolute;
|
||||||
|
margin: auto 20px;
|
||||||
|
top: 15px;
|
||||||
|
color: white;
|
||||||
|
font-weight: bolder;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.login-cont{
|
||||||
|
box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.44);
|
||||||
|
position: absolute;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
width: 400px;
|
||||||
|
height: 400px;
|
||||||
|
top: 150px;
|
||||||
|
right: 150px;
|
||||||
|
}
|
||||||
|
body{
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.login-cont .input-text{
|
||||||
|
padding: 0px 0px 0px 20px;
|
||||||
|
position: absolute;
|
||||||
|
width:340px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 5px;
|
||||||
|
left: 29px;
|
||||||
|
border:1px solid rgba(0, 0, 0, 0.37);;
|
||||||
|
}
|
||||||
|
.login-cont .input-text:hover{
|
||||||
|
background-color: #e3e3e3;
|
||||||
|
}
|
||||||
|
.input-text.username-text{
|
||||||
|
top: 120px;
|
||||||
|
}
|
||||||
|
.input-text.password-text{
|
||||||
|
top: 200px;
|
||||||
|
}
|
||||||
|
.submit-style{
|
||||||
|
position: absolute;
|
||||||
|
top: 280px;
|
||||||
|
width: 300px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 5px;
|
||||||
|
left: 49px;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||||
|
background-color: #65b0ff;
|
||||||
|
color: white;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.submit-style:hover{
|
||||||
|
background-color: #4aa0e3;
|
||||||
|
}
|
||||||
|
.register-cont{
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
width: 400px;
|
||||||
|
height: 500px;
|
||||||
|
top: 120px;
|
||||||
|
right: 150px;
|
||||||
|
box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.44);
|
||||||
|
}
|
||||||
|
.register-cont .register-input-text{
|
||||||
|
padding: 0px 0px 0px 20px;
|
||||||
|
position: absolute;
|
||||||
|
width:340px;
|
||||||
|
height: 35px;
|
||||||
|
border-radius: 5px;
|
||||||
|
left: 29px;
|
||||||
|
border:1px solid rgba(0, 0, 0, 0.37);;
|
||||||
|
}
|
||||||
|
.register-submit-style{
|
||||||
|
position: absolute;
|
||||||
|
top: 280px;
|
||||||
|
width: 300px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 5px;
|
||||||
|
left: 49px;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||||
|
background-color: #65b0ff;
|
||||||
|
color: white;
|
||||||
|
font-size: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.register-input-text.sno-text{
|
||||||
|
top: 60px;
|
||||||
|
}
|
||||||
|
.register-input-text.name-text{
|
||||||
|
top: 125px;
|
||||||
|
}
|
||||||
|
.register-input-text.e-mail-text{
|
||||||
|
top:190px;
|
||||||
|
}
|
||||||
|
.register-input-text.password-text{
|
||||||
|
top: 255px;
|
||||||
|
}
|
||||||
|
.register-input-text.check-password-text{
|
||||||
|
top:320px;
|
||||||
|
}
|
||||||
|
.register-submit-style{
|
||||||
|
top: 395px;
|
||||||
|
}
|
||||||
|
.register-input-text:hover{
|
||||||
|
background-color: #e7e0ea;
|
||||||
|
}
|
||||||
|
.register-submit-style:hover{
|
||||||
|
background-color: #438ecb;
|
||||||
|
}
|
||||||
|
.register-area{
|
||||||
|
position: absolute;
|
||||||
|
left: 270px;
|
||||||
|
top:230px;
|
||||||
|
}
|
||||||
|
.register-area h1{
|
||||||
|
color: white;
|
||||||
|
font-weight: lighter;
|
||||||
|
font-size: 55px;
|
||||||
|
}
|
||||||
|
.register-area p{
|
||||||
|
color: white;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.register-area .to-any{
|
||||||
|
transition: all 0.3s;
|
||||||
|
width: 100px;
|
||||||
|
height: 50px;
|
||||||
|
font-size: 25px;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 50px;
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: rgba(255, 255, 255, 0.66);
|
||||||
|
color: #ffffff;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.register-area .to-any:hover{
|
||||||
|
background-color: rgba(255, 255, 255, 0.8);
|
||||||
|
}
|
||||||
|
.to-login{
|
||||||
|
display: none;
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
function showRegister() {
|
||||||
|
$('.register-cont').css('display','block');
|
||||||
|
$('.login-cont').css('display','none');
|
||||||
|
$('.to-register').css( 'display','none');
|
||||||
|
$('.to-login').css( 'display','block');
|
||||||
|
}
|
||||||
|
function showlogin() {
|
||||||
|
$('.register-cont').css('display','none');
|
||||||
|
$('.login-cont').css('display','block');
|
||||||
|
$('.to-register').css( 'display','block');
|
||||||
|
$('.to-login').css( 'display','none');
|
||||||
|
}
|
||||||
|
function isEmpty(e)
|
||||||
|
{
|
||||||
|
if($('.input-text').val().length<=0)
|
||||||
|
{
|
||||||
|
e.preventDefault();
|
||||||
|
alert('密码不能为空');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$(document).ready(
|
||||||
|
function () {
|
||||||
|
$('.to-register').on('click', showRegister);
|
||||||
|
$('.to-login').on('click', showlogin);
|
||||||
|
})
|
||||||
|
|