Compare commits
No commits in common. "3afde75e856f6ad7b1982660d154a68755ba0dd1" and "f75bdf6d39da9a750e18bf7cb0f5dc161999eaca" have entirely different histories.
3afde75e85
...
f75bdf6d39
2
.gitignore
vendored
@ -722,5 +722,3 @@ local.properties
|
||||
# Typically, this file would be tracked if it contains build/dependency configurations:
|
||||
#.project
|
||||
|
||||
target
|
||||
target/*
|
||||
|
@ -80,12 +80,6 @@
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.32</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>requirement</finalName>
|
||||
|
@ -1,83 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-04 10:52:31
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-04 13:38:58
|
||||
* @FilePath: /后端-需求/src/main/java/com/cpic/xim/data/RequirementStatus.java
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
package com.cpic.xim.data;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public final class RequirementStatus
|
||||
{
|
||||
public RequirementStatus()
|
||||
{}
|
||||
|
||||
public int getStatus_code()
|
||||
{
|
||||
return status_code;
|
||||
}
|
||||
|
||||
public void setStatus_code( int status_code )
|
||||
{
|
||||
this.status_code = status_code;
|
||||
}
|
||||
|
||||
public String getStatus_name()
|
||||
{
|
||||
return status_name;
|
||||
}
|
||||
|
||||
public void setStatus_name( String status_name )
|
||||
{
|
||||
this.status_name = status_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + status_code;
|
||||
result = prime * result + ((status_name == null) ? 0 : status_name.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( Object obj )
|
||||
{
|
||||
if ( this == obj )
|
||||
return true;
|
||||
if ( obj == null )
|
||||
return false;
|
||||
if ( getClass() != obj.getClass() )
|
||||
return false;
|
||||
RequirementStatus other = (RequirementStatus) obj;
|
||||
if ( status_code != other.status_code )
|
||||
return false;
|
||||
if ( status_name == null )
|
||||
{
|
||||
if ( other.status_name != null )
|
||||
return false;
|
||||
} else if ( !status_name.equals( other.status_name ) )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "RequirementStatus [status_code=" + status_code + ", status_name=" + status_name
|
||||
+ "]";
|
||||
}
|
||||
|
||||
@JsonProperty( "status_code" )
|
||||
private int status_code;
|
||||
|
||||
@JsonProperty( "status_name" )
|
||||
private String status_name;
|
||||
}
|
@ -1,99 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-04 11:38:32
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-17 10:52:40
|
||||
* @FilePath: /后端-需求/src/main/java/com/cpic/xim/utils/db/RequirementDbOperation.java
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
package com.cpic.xim.utils.db;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.Vector;
|
||||
import com.cpic.xim.data.RequirementStatus;
|
||||
|
||||
public final class RequirementDbOperation
|
||||
{
|
||||
private static final String MYSQL_JDBC_CONNECT = "jdbc:mysql://10.39.0.85:3306";
|
||||
private static final String MYSQL_CLASS_DRIVER = "com.mysql.cj.jdbc.Driver";
|
||||
|
||||
/*****************************************************
|
||||
* 查询需求状态。
|
||||
* @return Vector<RequirementStatus> 需求状态的集合
|
||||
*****************************************************/
|
||||
public static Vector<RequirementStatus> queryRequirementStatus()
|
||||
throws ClassNotFoundException, SQLException
|
||||
{
|
||||
Vector<RequirementStatus> vStatus = new Vector<RequirementStatus>();
|
||||
|
||||
Class.forName( MYSQL_CLASS_DRIVER );
|
||||
|
||||
Connection conn = null;
|
||||
Statement statement = null;
|
||||
ResultSet results = null;
|
||||
String querSQL = "select * from requirement.requirement_status";
|
||||
|
||||
try
|
||||
{
|
||||
conn = DriverManager.getConnection( MYSQL_JDBC_CONNECT, "cpicxim", "Cpic#1234" );
|
||||
statement = conn.createStatement();
|
||||
results = statement.executeQuery( querSQL );
|
||||
|
||||
while ( results.next())
|
||||
{
|
||||
RequirementStatus status = new RequirementStatus();
|
||||
|
||||
status.setStatus_code( results.getInt( "status_code" ) );
|
||||
status.setStatus_name( results.getString( "status_name" ) );
|
||||
|
||||
vStatus.add( status );
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ( results != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
results.close();
|
||||
}
|
||||
catch ( SQLException except )
|
||||
{
|
||||
except.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if ( statement != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
statement.close();
|
||||
}
|
||||
catch ( SQLException except )
|
||||
{
|
||||
except.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if ( conn != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
conn.close();
|
||||
}
|
||||
catch ( SQLException except )
|
||||
{
|
||||
except.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return vStatus;
|
||||
}
|
||||
}
|
@ -2,25 +2,27 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-29 13:59:37
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-04 14:40:07
|
||||
* @FilePath: /后端-需求/src/main/java/com/cpic/xim/web/controllers/requirements/RequirementController.java
|
||||
* @LastEditTime: 2023-01-29 17:10:18
|
||||
* @FilePath: \requirement\src\main\java\com\cpic\xim\web\controllers\requirements\RequirementController.java
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
package com.cpic.xim.web.controllers.requirements;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.channels.IllegalSelectorException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Vector;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.cpic.xim.data.RequirementStatus;
|
||||
import com.cpic.xim.utils.db.RequirementDbOperation;
|
||||
import com.cpic.xim.web.controllers.requirements.param.RequirementQueryParam;
|
||||
import com.cpic.xim.web.controllers.requirements.response.QueryRequirementStatusResult;
|
||||
import com.cpic.xim.web.controllers.requirements.response.RequirementQueryResult;
|
||||
import com.cpic.xim.web.controllers.requirements.param.*;
|
||||
import com.cpic.xim.web.controllers.requirements.response.*;
|
||||
|
||||
@SuppressWarnings( "unused" )
|
||||
@Controller
|
||||
@ -37,30 +39,4 @@ public class RequirementController
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping( "/query_requirement_status.do" )
|
||||
@ResponseBody
|
||||
public QueryRequirementStatusResult queryRequirementStatus()
|
||||
{
|
||||
QueryRequirementStatusResult result = new QueryRequirementStatusResult();
|
||||
|
||||
try
|
||||
{
|
||||
Vector<RequirementStatus> status = RequirementDbOperation.queryRequirementStatus();
|
||||
|
||||
result.setSuccess( true );
|
||||
result.setRequirementStatus( status );
|
||||
}
|
||||
catch ( ClassNotFoundException exception )
|
||||
{
|
||||
result.setSuccess( false );
|
||||
result.setMessage( exception.getMessage() );
|
||||
}
|
||||
catch ( SQLException exception )
|
||||
{
|
||||
result.setSuccess( false );
|
||||
result.setMessage( exception.getMessage() );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -1,73 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-04 13:24:14
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-04 13:38:03
|
||||
* @FilePath: /后端-需求/src/main/java/com/cpic/xim/web/controllers/requirements/response/QueryRequirementStatusResult.java
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
package com.cpic.xim.web.controllers.requirements.response;
|
||||
|
||||
import com.cpic.xim.data.RequirementStatus;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.Vector;
|
||||
|
||||
public class QueryRequirementStatusResult
|
||||
{
|
||||
public QueryRequirementStatusResult()
|
||||
{}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage( String message )
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public boolean isSuccess()
|
||||
{
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess( boolean success )
|
||||
{
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public int getReturnCode()
|
||||
{
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
public void setReturnCode( int returnCode )
|
||||
{
|
||||
this.returnCode = returnCode;
|
||||
}
|
||||
|
||||
public Vector<RequirementStatus> getRequirementStatus()
|
||||
{
|
||||
return requirementStatus;
|
||||
}
|
||||
|
||||
public void setRequirementStatus( Vector<RequirementStatus> requirement_status )
|
||||
{
|
||||
this.requirementStatus = requirement_status;
|
||||
}
|
||||
|
||||
@JsonProperty( "message" )
|
||||
private String message;
|
||||
|
||||
@JsonProperty( "success" )
|
||||
private boolean success;
|
||||
|
||||
@JsonProperty( "return_code" )
|
||||
private int returnCode;
|
||||
|
||||
@JsonProperty( "requirement_status" )
|
||||
private Vector<RequirementStatus> requirementStatus;
|
||||
}
|
@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-29 10:39:41
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-04 17:12:05
|
||||
* @FilePath: /后端-需求/src/main/java/com/cpic/xim/web/filters/cros/CrosFilter.java
|
||||
* @LastEditTime: 2023-01-29 10:39:44
|
||||
* @FilePath: \requirement\src\main\java\com\cpic\xim\web\filters\cros\CrosFilter.java
|
||||
* @Description: 过滤器,用于对CROS访问进行响应。允许任何来源的访问。
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@ -33,7 +33,7 @@ public class CrosFilter implements Filter
|
||||
response.setHeader( "Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE" );
|
||||
response.setHeader( "Access-Control-Max-Age", "0" );
|
||||
response.setHeader( "Access-Control-Allow-Headers",
|
||||
"Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId,token,username" );
|
||||
"Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId,token" );
|
||||
response.setHeader( "Access-Control-Allow-Credentials", "true" );
|
||||
response.setHeader( "XDomainRequestAllowed", "1" );
|
||||
response.setHeader( "XDomainRequestAllowed", "1" );
|
||||
|
@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-29 10:50:49
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-04 18:05:18
|
||||
* @FilePath: /后端-需求/src/main/java/com/cpic/xim/web/filters/token/TokenFilter.java
|
||||
* @LastEditTime: 2023-01-29 10:55:27
|
||||
* @FilePath: \requirement\src\main\java\com\cpic\xim\web\filters\token\TokenFilter.java
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@ -11,7 +11,6 @@
|
||||
package com.cpic.xim.web.filters.token;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Enumeration;
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
@ -20,11 +19,9 @@ import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@SuppressWarnings( "unused" )
|
||||
@SuppressWarnings( "unused")
|
||||
public class TokenFilter implements Filter
|
||||
{
|
||||
private static final String FILTE_METHODS = "POST,GET";
|
||||
|
||||
@Override
|
||||
public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain )
|
||||
throws ServletException, IOException
|
||||
@ -32,14 +29,8 @@ public class TokenFilter implements Filter
|
||||
HttpServletRequest request = (HttpServletRequest) req;
|
||||
HttpServletResponse response = (HttpServletResponse) resp;
|
||||
|
||||
String method = request.getMethod().toUpperCase();
|
||||
|
||||
// 只处理POST和GET
|
||||
if ( FILTE_METHODS.indexOf( method ) != -1 )
|
||||
{
|
||||
// 检查token
|
||||
String token = request.getHeader( "token" );
|
||||
}
|
||||
// 获取请求中的token字符串
|
||||
String token = request.getHeader( "Token" );
|
||||
|
||||
chain.doFilter( request, response );
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
com\cpic\xim\data\RequirementStatus.class
|
||||
com\cpic\xim\web\controllers\requirements\param\RequirementQueryParam.class
|
||||
com\cpic\xim\web\filters\cros\CrosFilter.class
|
||||
com\cpic\xim\utils\db\RequirementDbOperation.class
|
||||
com\cpic\xim\web\controllers\requirements\response\QueryRequirementStatusResult.class
|
||||
com\cpic\xim\web\controllers\requirements\response\RequirementQueryResult.class
|
||||
com\cpic\xim\web\filters\token\TokenFilter.class
|
||||
com\cpic\xim\web\controllers\requirements\param\RequirementQueryParam.class
|
||||
com\cpic\xim\web\filters\cros\CrosFilter.class
|
||||
com\cpic\xim\web\controllers\requirements\RequirementController.class
|
||||
|
@ -1,8 +1,5 @@
|
||||
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\data\RequirementStatus.java
|
||||
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\web\controllers\requirements\response\RequirementQueryResult.java
|
||||
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\web\controllers\requirements\param\RequirementQueryParam.java
|
||||
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\web\controllers\requirements\response\QueryRequirementStatusResult.java
|
||||
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\web\filters\cros\CrosFilter.java
|
||||
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\web\filters\token\TokenFilter.java
|
||||
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\web\controllers\requirements\RequirementController.java
|
||||
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\utils\db\RequirementDbOperation.java
|
||||
D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\controllers\requirements\RequirementController.java
|
||||
D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\filters\cros\CrosFilter.java
|
||||
D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\controllers\requirements\param\RequirementQueryParam.java
|
||||
D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\controllers\requirements\response\RequirementQueryResult.java
|
||||
D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\filters\token\TokenFilter.java
|
||||
|
@ -1,4 +0,0 @@
|
||||
node_modules
|
||||
dist
|
||||
target
|
||||
tsconfig.json
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-09 15:26:18
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-10 10:25:42
|
||||
* @FilePath: /后端辅助工具/.eslintrc.js
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
browser: true,
|
||||
es2021: true,
|
||||
node: true,
|
||||
},
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
// project: ["./tsconfig.json",],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
plugins: [
|
||||
"@typescript-eslint",
|
||||
],
|
||||
extends: [
|
||||
// "standard-with-typescript",
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
],
|
||||
rules: {
|
||||
"no-console": "warn",
|
||||
"quote-props": ["warn", "as-needed",],
|
||||
quotes: ["warn", "double", { allowTemplateLiterals: true, },],
|
||||
indent: ["warn", 4,],
|
||||
"no-unused-vars": "off",
|
||||
semi: ["error", "always",], // 控制行尾部分号
|
||||
"comma-dangle": ["error", {
|
||||
arrays: "always",
|
||||
objects: "always",
|
||||
imports: "never",
|
||||
exports: "never",
|
||||
functions: "never",
|
||||
},], // 数组和对象键值对最后一个逗号
|
||||
"comma-style": ["error", "last",], // 逗号在行位
|
||||
"array-bracket-spacing": ["error", "never",],
|
||||
"no-undef-init": "error",
|
||||
"no-invalid-this": "error",
|
||||
"no-use-before-define": "error",
|
||||
"no-shadow-restricted-names": "error", // 禁止对一些关键字或者保留字进行赋值操作,比如NaN、Infinity、undefined、eval、arguments等
|
||||
// "comma-spacing": ["error", { "before": false, "after": true, },],
|
||||
"brace-style": ["error", "allman", { allowSingleLine: true, },],
|
||||
"prefer-const": "warn",
|
||||
"@typescript-eslint/no-extra-semi": "off",
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
},
|
||||
};
|
21
code/ts/pako/package-lock.json
generated
@ -1,21 +0,0 @@
|
||||
{
|
||||
"name": "pako",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "pako",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"pako": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pako": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/pako/-/pako-2.1.0.tgz",
|
||||
"integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug=="
|
||||
}
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "pako",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "node index.js"
|
||||
},
|
||||
"keywords": [
|
||||
"pako"
|
||||
],
|
||||
"type": "module",
|
||||
"author": "Kane",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"pako": "^2.1.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-13 14:54:46
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-13 14:55:19
|
||||
* @FilePath: /pako/src/utils/StringConverter.js
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
|
||||
function Uint8ArrayToString(fileData)
|
||||
{
|
||||
var dataString = "";
|
||||
for (var i = 0; i < fileData.length; i++)
|
||||
{
|
||||
dataString += String.fromCharCode(fileData[i]);
|
||||
}
|
||||
|
||||
return dataString;
|
||||
}
|
||||
|
||||
function stringToUint8Array(str)
|
||||
{
|
||||
var arr = [];
|
||||
|
||||
for (var i = 0, j = str.length; i < j; ++i)
|
||||
{
|
||||
arr.push(str.charCodeAt(i));
|
||||
}
|
||||
|
||||
var tmpUint8Array = new Uint8Array(arr);
|
||||
|
||||
return tmpUint8Array;
|
||||
}
|
||||
|
||||
export { Uint8ArrayToString, stringToUint8Array };
|
@ -1,4 +0,0 @@
|
||||
node_modules
|
||||
dist
|
||||
target
|
||||
tsconfig.json
|
@ -1,61 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-09 15:26:18
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-18 23:36:07
|
||||
* @FilePath: /后端辅助工具/.eslintrc.js
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
browser: true,
|
||||
es2021: true,
|
||||
node: true,
|
||||
},
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
// project: ["./tsconfig.json",],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
plugins: [
|
||||
"@typescript-eslint",
|
||||
],
|
||||
extends: [
|
||||
// "standard-with-typescript",
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
],
|
||||
rules: {
|
||||
"no-console": "off",
|
||||
"quote-props": ["warn", "as-needed",],
|
||||
quotes: ["warn", "double", { allowTemplateLiterals: true, },],
|
||||
indent: ["warn", 4,],
|
||||
"no-unused-vars": "off",
|
||||
semi: ["error", "always",], // 控制行尾部分号
|
||||
"comma-dangle": ["error", {
|
||||
arrays: "always",
|
||||
objects: "always",
|
||||
imports: "never",
|
||||
exports: "never",
|
||||
functions: "never",
|
||||
},], // 数组和对象键值对最后一个逗号
|
||||
"comma-style": ["error", "last",], // 逗号在行位
|
||||
"array-bracket-spacing": ["error", "never",],
|
||||
"no-undef-init": "error",
|
||||
"no-invalid-this": "error",
|
||||
"no-use-before-define": "error",
|
||||
"no-shadow-restricted-names": "error", // 禁止对一些关键字或者保留字进行赋值操作,比如NaN、Infinity、undefined、eval、arguments等
|
||||
// "comma-spacing": ["error", { "before": false, "after": true, },],
|
||||
"brace-style": ["error", "allman", { allowSingleLine: true, },],
|
||||
"prefer-const": "warn",
|
||||
"@typescript-eslint/no-extra-semi": "off",
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
},
|
||||
};
|
20
code/ts/后端辅助工具/.vscode/launch.json
vendored
@ -1,20 +0,0 @@
|
||||
{
|
||||
// 使用 IntelliSense 了解相关属性。
|
||||
// 悬停以查看现有属性的描述。
|
||||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "pwa-node",
|
||||
"request": "launch",
|
||||
"name": "Launch Program",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"program": "${file}",
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/**/*.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
3
code/ts/后端辅助工具/.vscode/settings.json
vendored
@ -1,3 +0,0 @@
|
||||
{
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
}
|
14
code/ts/后端辅助工具/.vscode/tasks.json
vendored
@ -1,14 +0,0 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "typescript",
|
||||
"tsconfig": "tsconfig.json",
|
||||
"problemMatcher": [
|
||||
"$tsc"
|
||||
],
|
||||
"group": "build",
|
||||
"label": "tsc: build - tsconfig.json"
|
||||
}
|
||||
]
|
||||
}
|
1559
code/ts/后端辅助工具/package-lock.json
generated
@ -1,11 +0,0 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
||||
"@typescript-eslint/parser": "^5.51.0",
|
||||
"eslint": "^8.33.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.3.2",
|
||||
"pako": "^2.1.0"
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-17 22:35:49
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-19 21:38:18
|
||||
* @FilePath: /后端辅助工具/src/DataType/Class.ts
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
class CpicximStuff
|
||||
{
|
||||
constructor(
|
||||
private _stuffName: string,
|
||||
private _stuffCode: string,
|
||||
private _p13UID: string
|
||||
) { }
|
||||
|
||||
get stuffName(): string
|
||||
{
|
||||
return this._stuffName;
|
||||
}
|
||||
|
||||
set stuffName(stuffName: string)
|
||||
{
|
||||
this._stuffName = stuffName;
|
||||
}
|
||||
|
||||
get stuffCode(): string
|
||||
{
|
||||
return this._stuffCode;
|
||||
}
|
||||
|
||||
set stuffCode(code: string)
|
||||
{
|
||||
this._stuffCode = code;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export { CpicximStuff };
|
@ -1,73 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-10 15:08:53
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-13 10:04:33
|
||||
* @FilePath: /后端辅助工具/src/DataType/DataType.ts
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
/*eslint no-unused-vars: "off" */
|
||||
/*eslint @typescript-eslint/no-unused-vars: "off" */
|
||||
|
||||
|
||||
//Tuple
|
||||
function dataTypes()
|
||||
{
|
||||
const tu: readonly [number, number, number] = [1, 1, 2,];
|
||||
|
||||
const toArray: [number, number, string] = [1, 2, "3",];
|
||||
const v1: (number | string)[] = toArray;
|
||||
|
||||
const s1 = "string";
|
||||
|
||||
console.log(typeof s1);
|
||||
|
||||
|
||||
let point: {
|
||||
x: number,
|
||||
y: number,
|
||||
};
|
||||
point = { x: 0, y: 0, };
|
||||
|
||||
function addOne(x: number, y: number = 1): number
|
||||
{
|
||||
return x + y;
|
||||
}
|
||||
|
||||
console.log(addOne(1));
|
||||
|
||||
function allParams(x: number, y: number): void
|
||||
{
|
||||
const z = x + y;
|
||||
}
|
||||
|
||||
//剩余参数,数组形式
|
||||
function overplusArgusWithArray(x: number, ...argus: number[]): number
|
||||
{
|
||||
return argus.length;
|
||||
}
|
||||
|
||||
function overplusArugsWithTuple(x: number, ...argus: [number, number, string]): number
|
||||
{
|
||||
|
||||
console.log(`元组形式的参数表${argus},剩余参数的数量${argus.length}。`);
|
||||
console.log(argus[2]);
|
||||
|
||||
return argus.length;
|
||||
}
|
||||
|
||||
overplusArugsWithTuple(1, 2, 3, "test");
|
||||
|
||||
console.log(overplusArgusWithArray(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
|
||||
|
||||
//测试null
|
||||
const nulltest: null = null;
|
||||
let var_2: { x: string; } = { x: "test", };
|
||||
|
||||
// var_2 = null;
|
||||
}
|
||||
|
||||
|
||||
export default dataTypes;
|
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-13 23:08:34
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-16 22:43:22
|
||||
* @FilePath: /后端辅助工具/src/DataType/Function.ts
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
function f(x: number, y: number): number
|
||||
{
|
||||
return x + y;
|
||||
}
|
||||
|
||||
f.version = "1.0.0";
|
||||
|
||||
const func: {
|
||||
(x: number, y: number): void,
|
||||
version: string,
|
||||
} = f;
|
||||
|
||||
function func_this_void(this: void, arg1: number): number
|
||||
{
|
||||
return arg1;
|
||||
}
|
||||
|
||||
let constructor: {
|
||||
new(x: string, y: string): object;
|
||||
};
|
@ -1,24 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-14 22:24:26
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-21 23:31:40
|
||||
* @FilePath: /后端辅助工具/src/DataType/Interface.ts
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
|
||||
interface document
|
||||
{
|
||||
getElementById(id: string): HTMLElement | null;
|
||||
}
|
||||
|
||||
interface CpicStuff
|
||||
{
|
||||
stuffName: string;
|
||||
stuffCode: string;
|
||||
p13uid: string;
|
||||
password: string;
|
||||
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-21 17:39:01
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-22 14:08:48
|
||||
* @FilePath: /后端辅助工具/src/DataType/Template.ts
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
|
||||
interface Point
|
||||
{
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
function radius<TPoint>(x: TPoint): TPoint
|
||||
{
|
||||
const result: TPoint = x;
|
||||
|
||||
return result;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-13 15:46:17
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-13 23:34:55
|
||||
* @FilePath: /后端辅助工具/src/axios/AxiosTest.ts
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
import axios from "axios";
|
@ -1,19 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-13 15:53:45
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-13 22:41:50
|
||||
* @FilePath: /后端辅助工具/src/axios/request.ts
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
import axios, {AxiosInstance, AxiosRequestConfig, AxiosResponse} from 'axios';
|
||||
|
||||
// const service = axios.create({
|
||||
// baseURL: "",
|
||||
// timeout: 10000,
|
||||
// timeoutErrorMessage: "请求超时!",
|
||||
// });
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-09 22:14:30
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-21 23:32:00
|
||||
* @FilePath: /后端辅助工具/src/main.ts
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
|
||||
import dataTypes from "./DataType/DataType";
|
||||
import { pakoTest } from "./gzip/PakoTest";
|
||||
|
||||
const greetings = "hello, this is kane's typescript!";
|
||||
|
||||
console.log(greetings);
|
||||
console.log("all");
|
||||
|
||||
//dataTypes();
|
||||
pakoTest();
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-13 14:54:46
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-13 14:55:19
|
||||
* @FilePath: /pako/src/utils/StringConverter.js
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
|
||||
function Uint8ArrayToString(fileData: Uint8Array): string
|
||||
{
|
||||
let dataString: string = "";
|
||||
|
||||
for (let i = 0; i < fileData.length; i++)
|
||||
{
|
||||
dataString += String.fromCharCode(fileData[i]);
|
||||
}
|
||||
|
||||
return dataString;
|
||||
}
|
||||
|
||||
function stringToUint8Array(str: string): Uint8Array
|
||||
{
|
||||
const arr: number[] = [];
|
||||
|
||||
for (let i = 0, j = str.length; i < j; ++i)
|
||||
{
|
||||
arr.push(str.charCodeAt(i));
|
||||
}
|
||||
|
||||
const tmpUint8Array: Uint8Array = new Uint8Array(arr);
|
||||
|
||||
return tmpUint8Array;
|
||||
}
|
||||
|
||||
export { Uint8ArrayToString, stringToUint8Array };
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-09 15:24:20
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-17 23:15:11
|
||||
* @FilePath: /后端辅助工具/tsconfig.json
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./target",
|
||||
"strict": false,
|
||||
"strictNullChecks": true,
|
||||
"strictPropertyInitialization": true,
|
||||
"sourceMap": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"moduleResolution": "node",
|
||||
"module": "CommonJS",
|
||||
"target": "ES2015"
|
||||
},
|
||||
// "files": [
|
||||
// "./src/main.ts",
|
||||
// ],
|
||||
"include": [
|
||||
"./src/**/*",
|
||||
// "./src/*.ts",
|
||||
// "src/main.ts",
|
||||
// ".eslintrc.js",
|
||||
],
|
||||
"exclude": [
|
||||
"./target",
|
||||
"node_modules",
|
||||
"bower_componets",
|
||||
"jspm_packages",
|
||||
],
|
||||
// "outFile": "./target/mian.js",
|
||||
}
|
2
code/web/IT工具综合平台/.env.development
Normal file
@ -0,0 +1,2 @@
|
||||
VUE_APP_API_URL_LOGIN = "http://222.76.244.118:11001/admin-system/account/p13_account_check"
|
||||
VUR_APPP_API_URL_UPLOAD_FILE= "http://222.76.244.118:11001/admin-system/file/file-upload.do"
|
27
code/web/IT工具综合平台/.eslintrc.js
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2022-12-14 15:12:46
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2022-12-14 15:20:20
|
||||
* @FilePath: \admin_system\.eslintrc.js
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
node: true
|
||||
},
|
||||
'extends': [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended'
|
||||
],
|
||||
parserOptions: {
|
||||
parser: '@babel/eslint-parser'
|
||||
},
|
||||
rules: {
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
|
||||
}
|
||||
}
|
36
code/web/IT工具综合平台/package.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "CPIC-IT-Console",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.0.10",
|
||||
"axios": "^1.2.1",
|
||||
"core-js": "^3.8.3",
|
||||
"element-plus": "^2.2.26",
|
||||
"sass": "^1.56.2",
|
||||
"sass-loader": "^13.2.0",
|
||||
"scss": "^0.2.4",
|
||||
"scss-loader": "^0.0.1",
|
||||
"vue": "^3.2.13",
|
||||
"vue-router": "^4.0.3",
|
||||
"vuex": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.16",
|
||||
"@babel/eslint-parser": "^7.12.16",
|
||||
"@vue/cli-plugin-babel": "~5.0.0",
|
||||
"@vue/cli-plugin-eslint": "~5.0.0",
|
||||
"@vue/cli-plugin-router": "~5.0.0",
|
||||
"@vue/cli-plugin-vuex": "~5.0.0",
|
||||
"@vue/cli-service": "~5.0.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-vue": "^8.0.3",
|
||||
"svg-sprite-loader": "^2.1.0",
|
||||
"vue-cli-plugin-element-plus": "~0.0.13"
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-12-17 11:08:18
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-23 00:44:29
|
||||
* @FilePath: /it-console-toVite/public/index.html
|
||||
* @LastEditTime: 2023-01-29 09:46:42
|
||||
* @FilePath: \IT工具综合平台\public\index.html
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@ -14,7 +14,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<link rel="icon" href="favicon.ico" />
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
|
||||
<title>王炜的工具箱</title>
|
||||
</head>
|
||||
<body>
|
||||
@ -25,10 +25,9 @@
|
||||
continue.</strong
|
||||
>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<div id="app" v-cloak></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
<script type="module" src="../src/main.js"></script>
|
||||
<style>
|
||||
.v-cloak {
|
||||
display: none;
|
@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-12-14 15:12:46
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-15 09:34:25
|
||||
* @FilePath: /IT工具综合平台/src/App.vue
|
||||
* @LastEditTime: 2023-01-19 14:26:17
|
||||
* @FilePath: \admin_system\src\App.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@ -20,11 +20,10 @@ import zhCn from "element-plus/lib/locale/lang/zh-cn";
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
setup()
|
||||
{
|
||||
const locale = zhCn;
|
||||
|
||||
return { locale, };
|
||||
data() {
|
||||
return {
|
||||
locale: zhCn, //语言属性
|
||||
};
|
||||
},
|
||||
components: {
|
||||
// HelloWorld,
|
||||
@ -33,5 +32,4 @@ export default {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-06 20:33:57
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-22 17:10:18
|
||||
* @FilePath: /IT工具综合平台/src/components/svg/SvgIcon.vue
|
||||
* @LastEditTime: 2023-01-07 17:10:07
|
||||
* @FilePath: \admin_system\src\components\svg\SvgIcon.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@ -18,10 +18,10 @@ export default {
|
||||
data()
|
||||
{
|
||||
return {
|
||||
iconName: "",
|
||||
iconName: ""
|
||||
};
|
||||
},
|
||||
props: ["icon",],
|
||||
props: ["icon"],
|
||||
created()
|
||||
{
|
||||
console.log("svg");
|
||||
@ -31,4 +31,6 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 753 B After Width: | Height: | Size: 753 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 928 B After Width: | Height: | Size: 928 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 937 B After Width: | Height: | Size: 937 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@ -2,14 +2,14 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-04 11:05:44
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-06 09:26:48
|
||||
* @FilePath: /IT工具综合平台/src/layout/Index.vue
|
||||
* @LastEditTime: 2023-01-28 23:35:47
|
||||
* @FilePath: \admin_system\src\layout\Index.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
-->
|
||||
<template>
|
||||
<el-container id="layout-container" v-loading="ui.ageVisible" element-loading-text="载入应用数据…">
|
||||
<el-container id="layout-container">
|
||||
<el-header id="layout-header">
|
||||
<LayoutHeader />
|
||||
</el-header>
|
||||
@ -28,62 +28,28 @@
|
||||
import LayoutAside from "./components/Aside.vue";
|
||||
import LayoutHeader from "./components/Header.vue";
|
||||
import LayoutMain from "./components/Main.vue";
|
||||
import { useStore } from "vuex";
|
||||
import { onMounted, computed, reactive } from "vue";
|
||||
// import { query_requirement_status } from "@/utils/api/requirement/requirement.js";
|
||||
|
||||
export default {
|
||||
name: "layoutPage",
|
||||
setup()
|
||||
{
|
||||
const store = useStore();
|
||||
|
||||
const ui = reactive(
|
||||
{
|
||||
pageVisible: true,
|
||||
});
|
||||
|
||||
const asideWidth = computed(() =>
|
||||
{
|
||||
const collapse = store.state.app.asideBarCollapse;
|
||||
|
||||
return collapse === true ? "65px" : "180px";
|
||||
});
|
||||
|
||||
onMounted(() =>
|
||||
{
|
||||
//加载数据
|
||||
// query_requirement_status()
|
||||
// .then((response) =>
|
||||
// {
|
||||
// // debugger;
|
||||
// const data = response.data;
|
||||
// console.log(data);
|
||||
// })
|
||||
// .catch((error) =>
|
||||
// {
|
||||
// // debugger;
|
||||
// console.log(error);
|
||||
// });
|
||||
});
|
||||
|
||||
return {
|
||||
ui,
|
||||
asideWidth,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
LayoutAside,
|
||||
LayoutHeader,
|
||||
LayoutMain,
|
||||
},
|
||||
computed: {
|
||||
asideWidth()
|
||||
{
|
||||
const collapse = this.$store.state.app.asideBarCollapse;
|
||||
|
||||
return collapse === true ? "65px" : "180px";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#layout-container {
|
||||
height: 100vh;
|
||||
/* width: 100vw; */
|
||||
max-height: 100vh;
|
||||
}
|
||||
|
||||
@ -97,9 +63,10 @@ export default {
|
||||
/* width: 175px; */
|
||||
background-color: #2f4156;
|
||||
overflow-x: hidden;
|
||||
height: calc(100vh - 50px);
|
||||
/* height: calc(100vh - 50px);
|
||||
max-height: calc(100vh - 50px);
|
||||
min-height: calc(100vh - 50px);
|
||||
min-height: calc(100vh - 50px); */
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#layout-header {
|
@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-04 11:30:33
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-06 09:28:16
|
||||
* @FilePath: /IT工具综合平台/src/layout/components/Aside.vue
|
||||
* @LastEditTime: 2023-01-28 16:01:49
|
||||
* @FilePath: \admin_system\src\layout\components\Aside.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved. 223142 2f4156
|
||||
@ -12,7 +12,7 @@
|
||||
<el-scrollbar class="wrapper">
|
||||
<el-menu id="side-bar" router :default-active="currentPath" background-color="#2f4156" text-color="#fff"
|
||||
active-text-color="#ffd04b" :collapse="asideCollapse">
|
||||
<template v-for="route in routes" :key="route.path">
|
||||
<template v-for="route in this.routers" :key="route.path">
|
||||
<template v-if="!route.hidden">
|
||||
<template v-if="hasOnlyChild(route.children)">
|
||||
<!-- 当只有一个子路由时,直接渲染子路由 -->
|
||||
@ -46,20 +46,19 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { computed } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
|
||||
export default {
|
||||
name: "LayoutAside",
|
||||
setup()
|
||||
data()
|
||||
{
|
||||
const router = useRouter();//路由
|
||||
const routes = router.getRoutes();//路由数组
|
||||
const store = useStore();
|
||||
|
||||
return {
|
||||
routers: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//用于判断一个路由是否只有一项子路由
|
||||
const hasOnlyChild = (children) =>
|
||||
hasOnlyChild: function (children)
|
||||
{
|
||||
//防御验证
|
||||
if (!children)
|
||||
@ -79,31 +78,27 @@ export default {
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
},
|
||||
|
||||
//计算变量
|
||||
},
|
||||
computed: {
|
||||
//获取当前的路由
|
||||
const currentPath = computed(() =>
|
||||
currentPath()
|
||||
{
|
||||
let path = useRoute().path;
|
||||
|
||||
return path;
|
||||
});
|
||||
|
||||
},
|
||||
//获取导航栏是否折叠的标志
|
||||
const asideCollapse = computed(() =>
|
||||
asideCollapse()
|
||||
{
|
||||
return store.state.app.ui.asideBarCollapse;
|
||||
});
|
||||
|
||||
return {
|
||||
router,
|
||||
routes,
|
||||
hasOnlyChild,
|
||||
currentPath,
|
||||
asideCollapse,
|
||||
};
|
||||
return this.$store.state.app.asideBarCollapse;
|
||||
}
|
||||
},
|
||||
created()
|
||||
{
|
||||
this.routers = useRouter().options.routes;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -125,22 +120,12 @@ export default {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.el-menu-item {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.el-sub-menu {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* 顺序必须在上面两个之后*/
|
||||
.is-active {
|
||||
background-color: #ffffff4f !important;
|
||||
/* font-weight: 1000; */
|
||||
/* font-size: 15px; */
|
||||
color: #ffd04b;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* .is-opened {
|
||||
border-left: 5px solid #1d74b2;
|
||||
} */
|
||||
@ -161,6 +146,5 @@ export default {
|
||||
|
||||
.wrapper {
|
||||
height: 100%;
|
||||
/* min-height: 400px; */
|
||||
}
|
||||
</style>
|
@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-04 11:39:04
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-04 01:09:49
|
||||
* @FilePath: \IT工具综合平台\src\layout\components\Header.vue
|
||||
* @LastEditTime: 2023-01-19 14:53:38
|
||||
* @FilePath: \admin_system\src\layout\components\Header.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@ -16,8 +16,13 @@
|
||||
<div>3.6.7 x64 Build 202208301257</div>
|
||||
</div>
|
||||
<div class="buttons_div">
|
||||
<User style="width: 25px; height; 25px; margin-right: 8px; cursor:pointer;" />
|
||||
<SwitchButton style="width: 25px; height; 25px; margin-right: 8px; cursor:pointer;" @click="logout" />
|
||||
<User
|
||||
style="width: 25px; height; 25px; margin-right: 8px; cursor:pointer;"
|
||||
/>
|
||||
<SwitchButton
|
||||
style="width: 25px; height; 25px; margin-right: 8px; cursor:pointer;"
|
||||
@click="logout"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -28,26 +33,22 @@ import { Logout } from "../../utils/api/info/account";
|
||||
|
||||
export default {
|
||||
name: "AppBanner",
|
||||
data()
|
||||
{
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
// created() {
|
||||
// console.log("banner请求数据!");
|
||||
// },
|
||||
mounted()
|
||||
{
|
||||
mounted() {
|
||||
//console.log("banner请求数据!");
|
||||
},
|
||||
methods: {
|
||||
logout()
|
||||
{
|
||||
logout() {
|
||||
this.$confirm("是否退出系统?", "请确认", {
|
||||
confirmButtonText: "是",
|
||||
cancelButtonText: "否",
|
||||
type: "warning",
|
||||
}).then(() =>
|
||||
{
|
||||
}).then(() => {
|
||||
Logout();
|
||||
});
|
||||
},
|
||||
@ -79,7 +80,7 @@ export default {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.app_banner>*+* {
|
||||
.app_banner > * + * {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-04 11:40:03
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-07 10:47:57
|
||||
* @FilePath: /IT工具综合平台/src/layout/components/Main.vue
|
||||
* @LastEditTime: 2023-01-26 12:34:20
|
||||
* @FilePath: \admin_system\src\layout\components\Main.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "LayoutMain",
|
||||
name: "LayoutMain"
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -31,6 +31,6 @@ export default {
|
||||
}
|
||||
|
||||
.view-wrapper {
|
||||
padding: 10px;
|
||||
padding: 15px;
|
||||
}
|
||||
</style>
|
@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-12-14 15:12:46
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-17 13:11:43
|
||||
* @FilePath: /IT工具综合平台/src/main.js
|
||||
* @LastEditTime: 2023-01-30 21:43:21
|
||||
* @FilePath: \IT工具综合平台\src\main.js
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@ -25,13 +25,13 @@ import("element-plus/dist/index.css");
|
||||
|
||||
import ElementPlus from "element-plus";
|
||||
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
|
||||
//import SvgIcon from "./components/svg/SvgIcon";
|
||||
import SvgIcon from "./components/svg/SvgIcon";
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
//app.component("SvgIcon", SvgIcon);
|
||||
app.component("SvgIcon", SvgIcon);
|
||||
|
||||
for (const [key, component,] of Object.entries(ElementPlusIconsVue))
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue))
|
||||
{
|
||||
app.component(key, component);
|
||||
}
|
||||
@ -39,5 +39,5 @@ for (const [key, component,] of Object.entries(ElementPlusIconsVue))
|
||||
app.use(ElementPlus);
|
||||
app.use(store);
|
||||
app.use(router);
|
||||
app.use(global);
|
||||
app.use( global );
|
||||
app.mount('#app');
|
@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-12-14 15:12:46
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-21 13:09:15
|
||||
* @FilePath: /IT工具综合平台/src/router/index.js
|
||||
* @LastEditTime: 2023-01-30 22:43:16
|
||||
* @FilePath: \IT工具综合平台\src\router\index.js
|
||||
* @Description: 定义应用路由配置
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@ -18,12 +18,6 @@ const routes = [
|
||||
redirect: "Login", //默认路由指向登录页面
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: "/error-page",
|
||||
name: "ErrorPage",
|
||||
hidden: true,
|
||||
component: () => import("@/views/ErrorPage.vue"),
|
||||
},
|
||||
{
|
||||
path: "/login",
|
||||
name: "Login",
|
||||
@ -35,7 +29,7 @@ const routes = [
|
||||
name: "Home",
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: "控制台",
|
||||
title: "控制台"
|
||||
},
|
||||
component: () => import("../layout/Index.vue"),
|
||||
},
|
||||
@ -91,52 +85,49 @@ const routes = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
//信息查询
|
||||
path: "/query_info",
|
||||
name: "QueryInfo",
|
||||
{//信息管理
|
||||
path: "/news",
|
||||
name: "News",
|
||||
meta: {
|
||||
title: "信息查询",
|
||||
icon: "search",
|
||||
title: "信息管理",
|
||||
icon: "edit",
|
||||
},
|
||||
component: () => import("@/layout/Index.vue"),
|
||||
children: [
|
||||
{
|
||||
path: "/query_stuff",
|
||||
name: "QueryStuff",
|
||||
path: "/staffInfo",
|
||||
name: "StaffInfo",
|
||||
meta: {
|
||||
title: "人员信息",
|
||||
icon: "user",
|
||||
},
|
||||
component: () => import("@/views/info/StaffInfo.vue"),
|
||||
},
|
||||
],
|
||||
},
|
||||
{//权限管理
|
||||
path: "/privilege",
|
||||
name: "Privilege",
|
||||
meta: {
|
||||
title: "权限管理",
|
||||
icon: "User",
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/user-manager",
|
||||
name: "UserManager",
|
||||
meta: {
|
||||
title: "用户管理",
|
||||
icon: "User",
|
||||
},
|
||||
component: () => import("../views/privilege/StaffInfo.vue"),
|
||||
},
|
||||
{
|
||||
path: "/privilege-manager",
|
||||
name: "PrivilegeManager",
|
||||
meta: {
|
||||
title: "权限管理",
|
||||
icon: "edit",
|
||||
},
|
||||
component: () => import("../views/privilege/PrivilegeManager.vue"),
|
||||
component: () => import("../views/info/StaffInfo.vue"),
|
||||
},
|
||||
{
|
||||
path: "/editStuffInfo",
|
||||
name: "EditStaffInfo",
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: "编辑人员信息",
|
||||
},
|
||||
component: () => import("../views/info/EditStaffInfo.vue"),
|
||||
},
|
||||
{
|
||||
path: "/newsIndex",
|
||||
name: "NewsIndex",
|
||||
meta: {
|
||||
title: "信息列表",
|
||||
icon: "edit",
|
||||
},
|
||||
component: () => import("../views/news/News.vue"),
|
||||
},
|
||||
{
|
||||
path: "/newsedit",
|
||||
name: "NewsEdit",
|
||||
meta: {
|
||||
title: "信息编辑",
|
||||
icon: "edit",
|
||||
},
|
||||
component: () => import("../views/news/NewsEdit.vue"),
|
||||
},
|
||||
],
|
||||
component: () => import("../layout/Index.vue"),
|
||||
@ -146,7 +137,7 @@ const routes = [
|
||||
name: "NetworkManager",
|
||||
meta: {
|
||||
title: "网络管理",
|
||||
icon: "switch",
|
||||
icon: "User",
|
||||
},
|
||||
component: () => import("../layout/Index.vue"),
|
||||
children: [
|
||||
@ -173,14 +164,14 @@ const routes = [
|
||||
icon: "switch",
|
||||
},
|
||||
component: () => import("../views/network/switch/SwitchManager.vue"),
|
||||
},
|
||||
}
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes,
|
||||
routes
|
||||
});
|
||||
|
||||
//前置路由守卫
|
@ -2,21 +2,19 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-12-14 15:12:46
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-04 15:59:09
|
||||
* @FilePath: /IT工具综合平台/src/store/index.js
|
||||
* @LastEditTime: 2023-01-11 14:20:04
|
||||
* @FilePath: \admin_system\src\store\index.js
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
import { createStore } from 'vuex';
|
||||
import app from "./modules/app";
|
||||
import requirement from "./modules/requirement";
|
||||
|
||||
const store = createStore({
|
||||
modules: {
|
||||
app,
|
||||
requirement,
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
export default store;
|
@ -2,19 +2,16 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-07 22:25:43
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-14 23:10:22
|
||||
* @FilePath: /IT工具综合平台/src/store/modules/app.js
|
||||
* @LastEditTime: 2023-01-11 09:44:46
|
||||
* @FilePath: \admin_system\src\store\modules\app.js
|
||||
* @Description: vuex中存放全局数据的模块
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
const state = {
|
||||
count: 1001,
|
||||
asideBarCollapse: false, //侧边栏折叠标志位
|
||||
userInfo: null, //用户信息和token
|
||||
ui:{ //ui相关的数据
|
||||
asideBarCollapse: false, //侧边栏折叠标志位
|
||||
|
||||
},
|
||||
};
|
||||
const getters = {};
|
||||
const mutations = {
|
||||
@ -29,7 +26,7 @@ const mutations = {
|
||||
SET_USERINFO(state, userInfo)
|
||||
{
|
||||
state.userInfo = userInfo;
|
||||
},
|
||||
}
|
||||
};
|
||||
const actions = {};
|
||||
|
@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-12-22 17:16:53
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-22 14:49:58
|
||||
* @FilePath: /IT工具综合平台/src/utils/api/common.js
|
||||
* @LastEditTime: 2022-12-22 20:48:03
|
||||
* @FilePath: \admin_system\src\utils\api\common.js
|
||||
* @Description: 通用请求
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@ -15,8 +15,6 @@ const URL_GET_VALIDATE_CODE = "";
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
* @param {*} data 承载数据的对象
|
||||
* @returns Promise对象
|
||||
*/
|
||||
export function GetValidate(data)
|
||||
{
|
@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-12-23 11:10:23
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-04 17:08:15
|
||||
* @FilePath: /IT工具综合平台/src/utils/api/config.js
|
||||
* @LastEditTime: 2022-12-23 11:11:58
|
||||
* @FilePath: \admin_system\src\utils\api\config.js
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@ -11,5 +11,4 @@
|
||||
|
||||
export const API_URL = {
|
||||
URL_LOGIN: process.env.VUE_APP_API_URL_LOGIN,
|
||||
URL_QUERY_REQUIREMENT_STATUS: process.env.VUE_APP_API_URL_REQUIREMENT_STATUS,
|
||||
};
|
@ -2,15 +2,16 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-12-22 09:10:20
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-04 15:45:51
|
||||
* @FilePath: /IT工具综合平台/src/utils/api/info/account.js
|
||||
* @Description: 登录登出相关的API。
|
||||
* @LastEditTime: 2023-01-25 00:29:54
|
||||
* @FilePath: \admin_system\src\utils\api\info\account.js
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
import instance from "@/utils/api/request";
|
||||
import { API_URL } from "@/utils/api/config"; //所有API的地址
|
||||
import router from "../../../router/index";
|
||||
import store from "../../../store/index";
|
||||
|
||||
/**
|
||||
* 登录请求函数
|
||||
@ -19,6 +20,8 @@ import router from "../../../router/index";
|
||||
*/
|
||||
export function Login(userInfo)
|
||||
{
|
||||
//console.log("登录请求地址:", API_URL.URL_LOGIN);
|
||||
//const url = "http://localhost:8080/admin-system/account/p13_account_check";
|
||||
return instance.request(
|
||||
{
|
||||
method: "post",
|
||||
@ -33,6 +36,8 @@ export function Login(userInfo)
|
||||
*/
|
||||
export function Logout()
|
||||
{
|
||||
console.log(store);
|
||||
|
||||
window.localStorage.removeItem("token");
|
||||
window.localStorage.removeItem("user_info");
|
||||
|
@ -2,24 +2,25 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-12-22 17:18:10
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-06 09:19:32
|
||||
* @FilePath: /IT工具综合平台/src/utils/api/request.js
|
||||
* @LastEditTime: 2023-01-12 17:47:39
|
||||
* @FilePath: \admin_system\src\utils\api\request.js
|
||||
* @Description: 配置axios拦截器
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
import axios from "axios";
|
||||
import store from "../../store/index";
|
||||
import router from "@/router";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import router from "@/router";
|
||||
|
||||
const service = axios.create(
|
||||
{
|
||||
baseURL: "",
|
||||
timeout: 10000, //十秒超时
|
||||
timeout: 5000,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* 加上请求拦截器
|
||||
*/
|
||||
@ -30,7 +31,7 @@ service.interceptors.request.use(
|
||||
if (store.state.app.userInfo)
|
||||
{
|
||||
//如果userInfo存在,则加上用户名和token
|
||||
const username = store.state.app.userInfo.staff_info.p13uid;
|
||||
const username = store.state.app.userInfo.user_info.p13uid;
|
||||
const token = store.state.app.userInfo.token;
|
||||
|
||||
config.headers["token"] = token;
|
||||
@ -47,7 +48,6 @@ service.interceptors.request.use(
|
||||
},
|
||||
function (error)
|
||||
{
|
||||
console.log("请求拦截器失败!");
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
@ -72,7 +72,7 @@ service.interceptors.response.use(
|
||||
confirmButtonText: "是",
|
||||
cancelButtonText: "否",
|
||||
type: "warning",
|
||||
}
|
||||
},
|
||||
).then(() =>
|
||||
{
|
||||
router.replace("/login");
|
@ -3,18 +3,18 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-12-14 15:23:54
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-07 10:46:48
|
||||
* @FilePath: /IT工具综合平台/src/views/account/Login.vue
|
||||
* @LastEditTime: 2023-01-28 21:35:47
|
||||
* @FilePath: \admin_system\src\views\account\Login.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
-->
|
||||
<template>
|
||||
<div id="login">
|
||||
<div class="form-wrapper">
|
||||
<div class="form-warp">
|
||||
<ul class="menu-tab">
|
||||
<li :class="{ 'current': ui.current_menu === item.type }" @click="onToggleMenu(item.type)"
|
||||
v-for="item in tab_menu" :key="item.type">{{ item.label }}
|
||||
<li :class="{ 'current': current_menu === item.type }" @click="onToggleMenu(item.type)" v-for="item in tab_menu"
|
||||
:key="item.type">{{ item.label }}
|
||||
</li>
|
||||
</ul>
|
||||
<!-- <el-form ref="form" :model="form"> -->
|
||||
@ -27,7 +27,7 @@
|
||||
<label class="form-label">密码</label>
|
||||
<el-input type="password" v-model.lazy.trim="loginForm.password"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="ui.current_menu === tab_menu[1].type">
|
||||
<el-form-item v-show="current_menu === tab_menu[1].type">
|
||||
<label class="form-label">确认密码</label>
|
||||
<el-input type="password" disabled v-model.lazy.trim="loginForm.confirm_password"></el-input>
|
||||
</el-form-item>
|
||||
@ -43,9 +43,9 @@
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" class="el-button-block" @click="login" :disabled="ui.submit_btn_disable"
|
||||
:loading="ui.submit_btn_loading">
|
||||
{{ ui.current_menu === "login" ? "登录" : "注册" }}
|
||||
<el-button type="primary" class="el-button-block" @click="login" :disabled="submit_btn_disable"
|
||||
:loading="submit_btn_loading">
|
||||
{{ current_menu === "login" ? "登录" : "注册" }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -54,79 +54,51 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { reactive, onBeforeMount, onMounted } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { useRouter } from "vue-router";
|
||||
import { Login } from "@/utils/api/info/account";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
//import router from "../../router/index";
|
||||
import router from "../../router/index";
|
||||
|
||||
export default {
|
||||
name: "loginPage",
|
||||
setup()
|
||||
data()
|
||||
{
|
||||
const store = useStore();
|
||||
const router = useRouter();
|
||||
|
||||
const loginForm = reactive({
|
||||
username: "",
|
||||
password: "",
|
||||
confirm_password: "",
|
||||
validateCode: "",
|
||||
});
|
||||
|
||||
const tab_menu = reactive(
|
||||
[
|
||||
{ type: "login", label: "登录", },
|
||||
{ type: "regiester", label: "注册", },
|
||||
]);
|
||||
|
||||
const ui = reactive(
|
||||
{
|
||||
current_menu: "",
|
||||
staffInfo: null,
|
||||
submit_btn_disable: false,
|
||||
submit_btn_loading: false,
|
||||
});
|
||||
|
||||
const onToggleMenu = (type) =>
|
||||
{
|
||||
ui.current_menu = type;
|
||||
console.log(process.env.VUE_APP_API_URL_LOGIN);
|
||||
return {
|
||||
loginForm: {
|
||||
username: "",
|
||||
password: "",
|
||||
confirm_password: "",
|
||||
validateCode: "",
|
||||
},
|
||||
tab_menu: [
|
||||
{ type: "login", label: "登录" },
|
||||
{ type: "regiester", label: "注册" },
|
||||
],
|
||||
current_menu: "",
|
||||
staffInfo: null,
|
||||
submit_btn_disable: false,
|
||||
submit_btn_loading: false,
|
||||
};
|
||||
|
||||
const getValidateCode = () =>
|
||||
},
|
||||
methods: {
|
||||
onToggleMenu(type)
|
||||
{
|
||||
this.current_menu = type;
|
||||
console.log(process.env.VUE_APP_API_URL_LOGIN);
|
||||
},
|
||||
getValidateCode()
|
||||
{
|
||||
ElMessage({
|
||||
message: "测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字",
|
||||
center: true,
|
||||
type: "error",
|
||||
});
|
||||
};
|
||||
|
||||
//将获取到的用户信息和token保存到vuex和localStorage
|
||||
const saveUserInfo = (userInfo) =>
|
||||
{
|
||||
console.log("保存用户信息");
|
||||
console.log("保存用户信息", store);
|
||||
//保存到vuex
|
||||
store.commit("app/SET_USERINFO", userInfo);
|
||||
|
||||
//保存到localStorage
|
||||
const token = userInfo.token;
|
||||
const userInfoJson = JSON.stringify(userInfo);
|
||||
|
||||
window.localStorage.setItem("token", token);
|
||||
window.localStorage.setItem("user_info", userInfoJson);
|
||||
};
|
||||
|
||||
},
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
const login = () =>
|
||||
login()
|
||||
{
|
||||
if (loginForm.username.length === 0 || loginForm.password === 0)
|
||||
if (this.loginForm.username.length === 0 || this.loginForm.password === 0)
|
||||
{
|
||||
ElMessage({
|
||||
message: "请填写您的P13账号和密码!",
|
||||
@ -136,12 +108,12 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
ui.submit_btn_disable = true;
|
||||
ui.submit_btn_loading = true;
|
||||
this.submit_btn_disable = true;
|
||||
this.submit_btn_loading = true;
|
||||
|
||||
const userInfo = {
|
||||
p13account: loginForm.username,
|
||||
password: loginForm.password,
|
||||
p13account: this.loginForm.username,
|
||||
password: this.loginForm.password,
|
||||
};
|
||||
|
||||
Login(userInfo)
|
||||
@ -161,10 +133,10 @@ export default {
|
||||
center: true,
|
||||
});
|
||||
|
||||
ui.staffInfo = data.staffInfo;
|
||||
this.staffInfo = data.staffInfo;
|
||||
|
||||
//保存用户信息和token
|
||||
saveUserInfo(data);
|
||||
this.saveUserInfo(data);
|
||||
|
||||
//验证成功,跳转路由
|
||||
router.push("/Desktop");
|
||||
@ -178,8 +150,8 @@ export default {
|
||||
center: true,
|
||||
});
|
||||
|
||||
ui.submit_btn_disable = false;
|
||||
ui.submit_btn_loading = false;
|
||||
this.submit_btn_disable = false;
|
||||
this.submit_btn_loading = false;
|
||||
}
|
||||
})
|
||||
.catch((error) =>
|
||||
@ -193,34 +165,32 @@ export default {
|
||||
center: true,
|
||||
});
|
||||
|
||||
ui.submit_btn_disable = false;
|
||||
ui.submit_btn_loading = false;
|
||||
this.submit_btn_disable = false;
|
||||
this.submit_btn_loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
onBeforeMount(() =>
|
||||
},
|
||||
saveUserInfo(userInfo) //将获取到的用户信息和token保存到vuex和localStorage
|
||||
{
|
||||
//初始化菜单选项
|
||||
ui.current_menu = tab_menu[0].type;
|
||||
});
|
||||
//保存到vuex
|
||||
this.$store.commit("app/SET_USERINFO", userInfo);
|
||||
|
||||
onMounted(() =>
|
||||
{
|
||||
//清理状态
|
||||
store.state.app.userInfo = null;
|
||||
});
|
||||
//保存到localStorage
|
||||
const token = userInfo.token;
|
||||
const userInfoJson = JSON.stringify(userInfo);
|
||||
|
||||
return {
|
||||
//数据
|
||||
ui,
|
||||
loginForm,
|
||||
tab_menu,
|
||||
//方法
|
||||
onToggleMenu,
|
||||
saveUserInfo,
|
||||
login,
|
||||
getValidateCode,
|
||||
};
|
||||
window.localStorage.setItem("token", token);
|
||||
window.localStorage.setItem("user_info", userInfoJson);
|
||||
}
|
||||
},
|
||||
created()
|
||||
{
|
||||
//初始化菜单选项
|
||||
this.current_menu = this.tab_menu[0].type;
|
||||
},
|
||||
mounted()
|
||||
{
|
||||
//清理状态
|
||||
this.$store.state.app.userInfo = null;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -230,14 +200,13 @@ export default {
|
||||
height: 100vh;
|
||||
background-color: #344a5f;
|
||||
padding-top: 50px;
|
||||
background-image: url("@/assets/img/cropped-1600-900-36302.jpg");
|
||||
}
|
||||
|
||||
.form-wrapper {
|
||||
.form-warp {
|
||||
width: 320px;
|
||||
padding: 30px;
|
||||
margin: auto;
|
||||
background-color: #ffffffaf;
|
||||
background-color: #ffffff10;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
@ -268,7 +237,7 @@ export default {
|
||||
display: inline-block;
|
||||
padding: 10px 24px;
|
||||
margin: 0 10px;
|
||||
color: #344a5fef;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
@ -280,15 +249,10 @@ export default {
|
||||
|
||||
.form-label {
|
||||
display: block;
|
||||
/* color: #fff; */
|
||||
color: #344a5fef;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
color: #344a5fef;
|
||||
}
|
||||
|
||||
.el-button-block {
|
||||
width: 100%;
|
||||
}
|