mirror of
https://github.com/RemainderTime/spring-boot-base-demo.git
synced 2026-06-01 23:47:53 +08:00
优化
This commit is contained in:
@@ -1,23 +0,0 @@
|
|||||||
package cn.xf.basedemo.config;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @program: xf-boot-base
|
|
||||||
* @ClassName WebMvcConfig
|
|
||||||
* @description: 放行Knife4j请求
|
|
||||||
* @author: xiongfeng
|
|
||||||
* @create: 2022-07-26 11:17
|
|
||||||
**/
|
|
||||||
@Configuration
|
|
||||||
public class WebMvcConfig extends WebMvcConfigurationSupport {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
||||||
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
|
|
||||||
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.xf.basedemo.model.domain;
|
package cn.xf.basedemo.model.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -26,5 +27,6 @@ public class User {
|
|||||||
|
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
@TableField(value = "create_time")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,18 +10,18 @@ spring:
|
|||||||
connection-test-query: SELECT 1
|
connection-test-query: SELECT 1
|
||||||
datasource:
|
datasource:
|
||||||
master: #${SERVER_ADDRESS}
|
master: #${SERVER_ADDRESS}
|
||||||
url: jdbc:mysql://120.48.109.209:3306/xf-boot-base?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://117.72.35.70:3307/xf-boot-base?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: 123456
|
password: 123456
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
slave:
|
slave:
|
||||||
url: jdbc:mysql://120.48.109.209:3306/xf-boot-base?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://117.72.35.70:3307/xf-boot-base?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: 123456
|
password: 123456
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
redis:
|
redis:
|
||||||
port: 6379 #Redis服务器连接的端口
|
port: 6379 #Redis服务器连接的端口
|
||||||
host: 120.48.109.209 # Redis服务器的地址
|
host: 117.72.35.70 # Redis服务器的地址
|
||||||
password: 123456 # Redis服务器连接密码(默认为空)
|
password: 123456 # Redis服务器连接密码(默认为空)
|
||||||
timeout: 5000 # 连接超时时间(毫秒)
|
timeout: 5000 # 连接超时时间(毫秒)
|
||||||
lettuce: #参考博客 https://blog.csdn.net/weixin_43944305/article/details/124322595
|
lettuce: #参考博客 https://blog.csdn.net/weixin_43944305/article/details/124322595
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
var json = JSON.stringify(data);
|
var json = JSON.stringify(data);
|
||||||
var cipher = this.encryptByPublicKey(json);
|
var cipher = this.encryptByPublicKey(json);
|
||||||
console.log("密文 :" + cipher);
|
console.log("密文 :" + cipher);
|
||||||
var url = "http://120.48.109.209:8088/user/login";
|
var url = "http://117.72.35.70:8088/user/login";
|
||||||
axios.post(url, {
|
axios.post(url, {
|
||||||
encryptedData: cipher,
|
encryptedData: cipher,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
name: ''
|
name: ''
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
|
|
||||||
this.token = this.getData("token");
|
this.token = this.getData("token");
|
||||||
//只需要转一次码
|
//只需要转一次码
|
||||||
this.name = decodeURI(this.getData("name"));
|
this.name = decodeURI(this.getData("name"));
|
||||||
@@ -33,8 +34,10 @@
|
|||||||
getData: function (name) {
|
getData: function (name) {
|
||||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
|
||||||
var r = window.location.search.substr(1).match(reg); //匹配目标参数
|
var r = window.location.search.substr(1).match(reg); //匹配目标参数
|
||||||
|
|
||||||
if (r != null) return unescape(r[2]);
|
if (r != null) return unescape(r[2]);
|
||||||
return null; //返回参数值
|
window.location.href = "login"
|
||||||
|
// return null; //返回参数值
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user