feat():增加注册
parent
4136464a03
commit
135448c504
8
pom.xml
8
pom.xml
|
@ -24,17 +24,25 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- SpringBootWeb开发框架 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot测试框架 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot校验框架 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- mqtt3 -->
|
<!-- mqtt3 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.paho</groupId>
|
<groupId>org.eclipse.paho</groupId>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZeLiang
|
* @author DongZeLiang
|
||||||
|
@ -13,6 +14,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||||
@MapperScan(value = "com.muyu.**.mapper")
|
@MapperScan(value = "com.muyu.**.mapper")
|
||||||
|
@EnableTransactionManagement
|
||||||
public class VehicleSimulationApplication {
|
public class VehicleSimulationApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
|
@ -2,6 +2,9 @@ package com.muyu.config;
|
||||||
|
|
||||||
import com.muyu.system.exception.BasicException;
|
import com.muyu.system.exception.BasicException;
|
||||||
import com.muyu.web.common.Result;
|
import com.muyu.web.common.Result;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
|
||||||
|
@ -12,25 +15,39 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
* @description 异常类
|
* @description 异常类
|
||||||
* @date 2023/11/15
|
* @date 2023/11/15
|
||||||
*/
|
*/
|
||||||
|
@Log4j2
|
||||||
@RestControllerAdvice
|
@RestControllerAdvice
|
||||||
public class ExceptionAdvice {
|
public class ExceptionAdvice {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运行时异常拦截
|
* 运行时异常拦截
|
||||||
* @param runtimeException 运行时异常
|
* @param exception 运行时异常
|
||||||
* @return 公共返回结果
|
* @return 公共返回结果
|
||||||
*/
|
*/
|
||||||
@ExceptionHandler(value = RuntimeException.class)
|
@ExceptionHandler(value = RuntimeException.class)
|
||||||
public Result<String> runtimeExceptionHandler(RuntimeException runtimeException){
|
public Result<String> runtimeExceptionHandler(HttpServletRequest request, RuntimeException exception){
|
||||||
return Result.error(runtimeException.getMessage());
|
log.error("请求发生异常:[{}] ----- [{}]",request.getRequestURI(), exception.getMessage(), exception);
|
||||||
|
return Result.error(exception.getMessage());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 运行时异常拦截
|
* 运行时异常拦截
|
||||||
* @param basicException 运行时异常
|
* @param exception 运行时异常
|
||||||
* @return 公共返回结果
|
* @return 公共返回结果
|
||||||
*/
|
*/
|
||||||
@ExceptionHandler(value = BasicException.class)
|
@ExceptionHandler(value = BasicException.class)
|
||||||
public Result<String> runtimeExceptionHandler(BasicException basicException){
|
public Result<String> runtimeExceptionHandler(HttpServletRequest request, BasicException exception){
|
||||||
return Result.error(basicException.getCode(), basicException.getMessage());
|
log.error("请求发生异常:[{}] ----- [{}]",request.getRequestURI(), exception.getMessage(), exception);
|
||||||
|
|
||||||
|
return Result.error(exception.getCode(), exception.getMessage());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 运行时异常拦截
|
||||||
|
* @param exception 运行时异常
|
||||||
|
* @return 公共返回结果
|
||||||
|
*/
|
||||||
|
@ExceptionHandler(value = MethodArgumentNotValidException.class)
|
||||||
|
public Result<String> runtimeExceptionHandler(HttpServletRequest request, MethodArgumentNotValidException exception){
|
||||||
|
log.error("请求发生异常:[{}] ----- [{}]",request.getRequestURI(), exception.getMessage(), exception);
|
||||||
|
return Result.error(exception.getAllErrors().get(0).getDefaultMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,18 +23,31 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||||
String[] setterNames = metaObject.getSetterNames();
|
String[] setterNames = metaObject.getSetterNames();
|
||||||
Set<String> setterNamesSet = Arrays.stream(setterNames).collect(Collectors.toSet());
|
Set<String> setterNamesSet = Arrays.stream(setterNames).collect(Collectors.toSet());
|
||||||
if (setterNamesSet.contains("tenantId")){
|
if (setterNamesSet.contains("tenantId")){
|
||||||
|
if (metaObject.getValue("tenantId") == null){
|
||||||
this.setFieldValByName("tenantId", SystemHandler.getTenantId(),metaObject);
|
this.setFieldValByName("tenantId", SystemHandler.getTenantId(),metaObject);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (setterNamesSet.contains("createTime")){
|
if (setterNamesSet.contains("createTime")){
|
||||||
|
|
||||||
|
if (metaObject.getValue("createTime") == null) {
|
||||||
this.setFieldValByName("createTime", new Date(), metaObject);
|
this.setFieldValByName("createTime", new Date(), metaObject);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (setterNamesSet.contains("updateTime")){
|
if (setterNamesSet.contains("updateTime")){
|
||||||
|
if (metaObject.getValue("updateTime") == null) {
|
||||||
this.setFieldValByName("updateTime", new Date(), metaObject);
|
this.setFieldValByName("updateTime", new Date(), metaObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateFill(MetaObject metaObject) {
|
public void updateFill(MetaObject metaObject) {
|
||||||
|
String[] setterNames = metaObject.getSetterNames();
|
||||||
|
Set<String> setterNamesSet = Arrays.stream(setterNames).collect(Collectors.toSet());
|
||||||
|
if (setterNamesSet.contains("updateTime")){
|
||||||
|
if (metaObject.getValue("updateTime") == null) {
|
||||||
this.setFieldValByName("updateTime", new Date(), metaObject);
|
this.setFieldValByName("updateTime", new Date(), metaObject);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ public class SystemWebConfigurer implements WebMvcConfigurer {
|
||||||
public void addInterceptors(InterceptorRegistry registry) {
|
public void addInterceptors(InterceptorRegistry registry) {
|
||||||
// 白名单
|
// 白名单
|
||||||
List<String> patterns = new ArrayList<String>();
|
List<String> patterns = new ArrayList<String>();
|
||||||
|
patterns.add("/system/auth/reg");
|
||||||
patterns.add("/system/auth/login");
|
patterns.add("/system/auth/login");
|
||||||
patterns.add("/system/auth/logout");
|
patterns.add("/system/auth/logout");
|
||||||
patterns.add("/");
|
patterns.add("/");
|
||||||
|
|
|
@ -3,8 +3,10 @@ package com.muyu.web.controller;
|
||||||
import com.muyu.system.domain.LoginUserInfo;
|
import com.muyu.system.domain.LoginUserInfo;
|
||||||
import com.muyu.web.common.Result;
|
import com.muyu.web.common.Result;
|
||||||
import com.muyu.web.domain.req.UserLoginReq;
|
import com.muyu.web.domain.req.UserLoginReq;
|
||||||
|
import com.muyu.web.domain.req.UserRegReq;
|
||||||
import com.muyu.web.service.SystemAuthService;
|
import com.muyu.web.service.SystemAuthService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,13 +22,19 @@ public class SystemAuthController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SystemAuthService systemAuthService;
|
private SystemAuthService systemAuthService;
|
||||||
|
|
||||||
|
@PostMapping("/reg")
|
||||||
|
public Result<String> reg(@RequestBody @Validated UserRegReq userRegReq) {
|
||||||
|
systemAuthService.reg(userRegReq);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户登录
|
* 用户登录
|
||||||
* @param userLoginReq 用户登录请求对象
|
* @param userLoginReq 用户登录请求对象
|
||||||
* @return token
|
* @return token
|
||||||
*/
|
*/
|
||||||
@PostMapping("/login")
|
@PostMapping("/login")
|
||||||
public Result<String> login(@RequestBody UserLoginReq userLoginReq){
|
public Result<String> login(@RequestBody @Validated UserLoginReq userLoginReq){
|
||||||
String token = systemAuthService.login(userLoginReq.getUserName(), userLoginReq.getPassword());
|
String token = systemAuthService.login(userLoginReq.getUserName(), userLoginReq.getPassword());
|
||||||
return Result.success(token);
|
return Result.success(token);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.web.domain.req;
|
package com.muyu.web.domain.req;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -20,10 +21,12 @@ public class UserLoginReq {
|
||||||
/**
|
/**
|
||||||
* 用户名称
|
* 用户名称
|
||||||
*/
|
*/
|
||||||
|
@NotEmpty(message = "请输入用户名称")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码
|
* 密码
|
||||||
*/
|
*/
|
||||||
|
@NotEmpty(message = "请输入用户密码")
|
||||||
private String password;
|
private String password;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.muyu.web.domain.req;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: DongZeLiang
|
||||||
|
* @date: 2024/9/12
|
||||||
|
* @Description: 用户注册请求对象
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserRegReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名称
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "请输入用户名称")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "请输入用户密码")
|
||||||
|
private String password;
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package com.muyu.web.service;
|
package com.muyu.web.service;
|
||||||
|
|
||||||
import com.muyu.system.domain.LoginUserInfo;
|
import com.muyu.system.domain.LoginUserInfo;
|
||||||
|
import com.muyu.web.domain.req.UserRegReq;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: DongZeLiang
|
* @Author: DongZeLiang
|
||||||
|
@ -29,4 +30,9 @@ public interface SystemAuthService {
|
||||||
*/
|
*/
|
||||||
LoginUserInfo info ();
|
LoginUserInfo info ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户注册
|
||||||
|
* @param userRegReq 用户注册请求
|
||||||
|
*/
|
||||||
|
void reg (UserRegReq userRegReq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.web.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.github.benmanes.caffeine.cache.Cache;
|
import com.github.benmanes.caffeine.cache.Cache;
|
||||||
|
import com.muyu.config.tenant.CustomTenantHandler;
|
||||||
import com.muyu.system.constants.SecurityConstants;
|
import com.muyu.system.constants.SecurityConstants;
|
||||||
import com.muyu.system.domain.LoginUserInfo;
|
import com.muyu.system.domain.LoginUserInfo;
|
||||||
import com.muyu.system.handle.SystemHandler;
|
import com.muyu.system.handle.SystemHandler;
|
||||||
|
@ -10,13 +11,16 @@ import com.muyu.utils.IdUtils;
|
||||||
import com.muyu.utils.JwtUtils;
|
import com.muyu.utils.JwtUtils;
|
||||||
import com.muyu.web.domain.ServerConfig;
|
import com.muyu.web.domain.ServerConfig;
|
||||||
import com.muyu.web.domain.UserInfo;
|
import com.muyu.web.domain.UserInfo;
|
||||||
|
import com.muyu.web.domain.req.UserRegReq;
|
||||||
import com.muyu.web.mapper.UserInfoMapper;
|
import com.muyu.web.mapper.UserInfoMapper;
|
||||||
import com.muyu.web.service.ServerConfigService;
|
import com.muyu.web.service.ServerConfigService;
|
||||||
import com.muyu.web.service.SystemAuthService;
|
import com.muyu.web.service.SystemAuthService;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -38,6 +42,8 @@ public class SystemAuthServiceImpl implements SystemAuthService {
|
||||||
|
|
||||||
@Resource( name = "loginUserCache")
|
@Resource( name = "loginUserCache")
|
||||||
private Cache<String, LoginUserInfo> loginUserInfoCache;
|
private Cache<String, LoginUserInfo> loginUserInfoCache;
|
||||||
|
@Autowired
|
||||||
|
private CustomTenantHandler customTenantHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户登录
|
* 用户登录
|
||||||
|
@ -98,4 +104,41 @@ public class SystemAuthServiceImpl implements SystemAuthService {
|
||||||
public LoginUserInfo info () {
|
public LoginUserInfo info () {
|
||||||
return SystemHandler.getUserInfo();
|
return SystemHandler.getUserInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户注册
|
||||||
|
*
|
||||||
|
* @param userRegReq 用户注册请求
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void reg (UserRegReq userRegReq) {
|
||||||
|
LambdaQueryWrapper<UserInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(UserInfo::getUserName, userRegReq.getUserName());
|
||||||
|
Long selectCount = userInfoMapper.selectCount(queryWrapper);
|
||||||
|
if (!selectCount.equals(0L)){
|
||||||
|
throw new RuntimeException("用户名称重复,请重新输入");
|
||||||
|
}
|
||||||
|
UserInfo userInfo = UserInfo.builder()
|
||||||
|
.userName(userRegReq.getUserName())
|
||||||
|
.password(userRegReq.getPassword())
|
||||||
|
.createTime(new Date())
|
||||||
|
.tenantId("TX_" + IdUtils.simpleUUID().substring(0, 10).toUpperCase())
|
||||||
|
.build();
|
||||||
|
this.userInfoMapper.insert(userInfo);
|
||||||
|
customTenantHandler.ignore();
|
||||||
|
serverConfigService.save(
|
||||||
|
ServerConfig.builder()
|
||||||
|
.tenantId(userInfo.getTenantId())
|
||||||
|
.host("127.0.0.1")
|
||||||
|
.port("81")
|
||||||
|
.uri("/verify/vehicleConnection")
|
||||||
|
.defaultMqttAddr("127.0.0.1")
|
||||||
|
.defaultMqttTopic("vehicle")
|
||||||
|
.defaultMqttQos(1)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
customTenantHandler.remove();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
||||||
@supports(-webkit-mask:none) and (not (cater-color:#fff)){.login-container .el-input input{color:#fff}}.login-container .el-input{display:inline-block;height:47px;width:85%}.login-container .el-input input{background:transparent;border:0;-webkit-appearance:none;border-radius:0;padding:12px 5px 12px 15px;color:#fff;height:47px;caret-color:#fff}.login-container .el-input input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #283443 inset!important;box-shadow:inset 0 0 0 1000px #283443!important;-webkit-text-fill-color:#fff!important}.login-container .el-form-item{border:1px solid hsla(0,0%,100%,.1);background:rgba(0,0,0,.1);border-radius:5px;color:#454545}.login-container[data-v-5f7d9308]{min-height:100%;width:100%;background-color:#2d3a4b;overflow:hidden}.login-container .login-form[data-v-5f7d9308]{position:relative;width:520px;max-width:100%;padding:160px 35px 0;margin:0 auto;overflow:hidden}.login-container .tips[data-v-5f7d9308]{font-size:14px;color:#fff;margin-bottom:10px}.login-container .tips span[data-v-5f7d9308]:first-of-type{margin-right:16px}.login-container .svg-container[data-v-5f7d9308]{padding:6px 5px 6px 15px;color:#889aa4;vertical-align:middle;width:30px;display:inline-block}.login-container .title-container[data-v-5f7d9308]{position:relative}.login-container .title-container .title[data-v-5f7d9308]{font-size:26px;color:#eee;margin:0 auto 40px auto;text-align:center;font-weight:700}.login-container .show-pwd[data-v-5f7d9308]{position:absolute;right:10px;top:7px;font-size:16px;color:#889aa4;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
|
|
@ -0,0 +1 @@
|
||||||
|
.el-dialog{background-color:#2d3a4b}@supports(-webkit-mask:none) and (not (cater-color:#fff)){.login-container .el-input input{color:#fff}}.login-container .el-input{display:inline-block;height:47px;width:85%}.login-container .el-input input{background:transparent;border:0;-webkit-appearance:none;border-radius:0;padding:12px 5px 12px 15px;color:#fff;height:47px;caret-color:#fff}.login-container .el-input input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #283443 inset!important;box-shadow:inset 0 0 0 1000px #283443!important;-webkit-text-fill-color:#fff!important}.login-container .el-form-item{border:1px solid hsla(0,0%,100%,.1);background:rgba(0,0,0,.1);border-radius:5px;color:#454545}.login-container[data-v-1ad18199]{min-height:100%;width:100%;background-color:#2d3a4b;overflow:hidden}.login-container .login-form[data-v-1ad18199]{position:relative;width:520px;max-width:100%;padding:160px 35px 0;margin:0 auto;overflow:hidden}.login-container .tips[data-v-1ad18199]{font-size:14px;color:#fff;margin-bottom:10px}.login-container .tips span[data-v-1ad18199]:first-of-type{margin-right:16px}.login-container .svg-container[data-v-1ad18199]{padding:6px 5px 6px 15px;color:#889aa4;vertical-align:middle;width:30px;display:inline-block}.login-container .title-container[data-v-1ad18199]{position:relative}.login-container .title-container .title[data-v-1ad18199]{font-size:26px;color:#eee;margin:0 auto 40px auto;text-align:center;font-weight:700}.login-container .show-pwd[data-v-1ad18199]{position:absolute;right:10px;top:7px;font-size:16px;color:#889aa4;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
|
@ -1 +1 @@
|
||||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=/favicon.ico><title>车辆</title><link href=/static/css/app.63269458.css rel=preload as=style><link href=/static/css/chunk-elementUI.c1c3b808.css rel=preload as=style><link href=/static/css/chunk-libs.3dfb7769.css rel=preload as=style><link href=/static/js/app.740bf904.js rel=preload as=script><link href=/static/js/chunk-elementUI.2491fb2f.js rel=preload as=script><link href=/static/js/chunk-libs.5e39c7d0.js rel=preload as=script><link href=/static/css/chunk-elementUI.c1c3b808.css rel=stylesheet><link href=/static/css/chunk-libs.3dfb7769.css rel=stylesheet><link href=/static/css/app.63269458.css rel=stylesheet></head><body><noscript><strong>We're sorry but 车辆 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script>(function(e){function t(t){for(var r,o,a=t[0],f=t[1],i=t[2],l=0,d=[];l<a.length;l++)o=a[l],Object.prototype.hasOwnProperty.call(u,o)&&u[o]&&d.push(u[o][0]),u[o]=0;for(r in f)Object.prototype.hasOwnProperty.call(f,r)&&(e[r]=f[r]);s&&s(t);while(d.length)d.shift()();return c.push.apply(c,i||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],r=!0,o=1;o<n.length;o++){var a=n[o];0!==u[a]&&(r=!1)}r&&(c.splice(t--,1),e=f(f.s=n[0]))}return e}var r={},o={runtime:0},u={runtime:0},c=[];function a(e){return f.p+"static/js/"+({}[e]||e)+"."+{"chunk-0df6049d":"652396eb","chunk-22cea610":"7879ff8f","chunk-24e6d936":"285324d6","chunk-3f128364":"a125ba12","chunk-6f60c8f1":"f16bf298","chunk-0e8cf5f4":"b7552abc","chunk-7d1a163b":"4d8cc933"}[e]+".js"}function f(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,f),n.l=!0,n.exports}f.e=function(e){var t=[],n={"chunk-0df6049d":1,"chunk-22cea610":1,"chunk-24e6d936":1,"chunk-3f128364":1,"chunk-0e8cf5f4":1};o[e]?t.push(o[e]):0!==o[e]&&n[e]&&t.push(o[e]=new Promise((function(t,n){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-0df6049d":"970f2904","chunk-22cea610":"3c7f5ad9","chunk-24e6d936":"a515fcdd","chunk-3f128364":"22503e40","chunk-6f60c8f1":"31d6cfe0","chunk-0e8cf5f4":"3328abfd","chunk-7d1a163b":"31d6cfe0"}[e]+".css",u=f.p+r,c=document.getElementsByTagName("link"),a=0;a<c.length;a++){var i=c[a],l=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(l===r||l===u))return t()}var d=document.getElementsByTagName("style");for(a=0;a<d.length;a++){i=d[a],l=i.getAttribute("data-href");if(l===r||l===u)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var r=t&&t.target&&t.target.src||u,c=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");c.code="CSS_CHUNK_LOAD_FAILED",c.request=r,delete o[e],s.parentNode.removeChild(s),n(c)},s.href=u;var h=document.getElementsByTagName("head")[0];h.appendChild(s)})).then((function(){o[e]=0})));var r=u[e];if(0!==r)if(r)t.push(r[2]);else{var c=new Promise((function(t,n){r=u[e]=[t,n]}));t.push(r[2]=c);var i,l=document.createElement("script");l.charset="utf-8",l.timeout=120,f.nc&&l.setAttribute("nonce",f.nc),l.src=a(e);var d=new Error;i=function(t){l.onerror=l.onload=null,clearTimeout(s);var n=u[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;d.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",d.name="ChunkLoadError",d.type=r,d.request=o,n[1](d)}u[e]=void 0}};var s=setTimeout((function(){i({type:"timeout",target:l})}),12e4);l.onerror=l.onload=i,document.head.appendChild(l)}return Promise.all(t)},f.m=e,f.c=r,f.d=function(e,t,n){f.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},f.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,t){if(1&t&&(e=f(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(f.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)f.d(n,r,function(t){return e[t]}.bind(null,r));return n},f.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return f.d(t,"a",t),t},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.p="/",f.oe=function(e){throw console.error(e),e};var i=window["webpackJsonp"]=window["webpackJsonp"]||[],l=i.push.bind(i);i.push=t,i=i.slice();for(var d=0;d<i.length;d++)t(i[d]);var s=l;n()})([]);</script><script src=/static/js/chunk-elementUI.2491fb2f.js></script><script src=/static/js/chunk-libs.5e39c7d0.js></script><script src=/static/js/app.740bf904.js></script></body></html>
|
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=/favicon.ico><title>车辆</title><link href=/static/css/app.e2ca9161.css rel=preload as=style><link href=/static/css/chunk-elementUI.c1c3b808.css rel=preload as=style><link href=/static/css/chunk-libs.3dfb7769.css rel=preload as=style><link href=/static/js/app.2f1a6545.js rel=preload as=script><link href=/static/js/chunk-elementUI.2491fb2f.js rel=preload as=script><link href=/static/js/chunk-libs.5e39c7d0.js rel=preload as=script><link href=/static/css/chunk-elementUI.c1c3b808.css rel=stylesheet><link href=/static/css/chunk-libs.3dfb7769.css rel=stylesheet><link href=/static/css/app.e2ca9161.css rel=stylesheet></head><body><noscript><strong>We're sorry but 车辆 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script>(function(e){function t(t){for(var r,o,a=t[0],f=t[1],i=t[2],l=0,d=[];l<a.length;l++)o=a[l],Object.prototype.hasOwnProperty.call(c,o)&&c[o]&&d.push(c[o][0]),c[o]=0;for(r in f)Object.prototype.hasOwnProperty.call(f,r)&&(e[r]=f[r]);s&&s(t);while(d.length)d.shift()();return u.push.apply(u,i||[]),n()}function n(){for(var e,t=0;t<u.length;t++){for(var n=u[t],r=!0,o=1;o<n.length;o++){var a=n[o];0!==c[a]&&(r=!1)}r&&(u.splice(t--,1),e=f(f.s=n[0]))}return e}var r={},o={runtime:0},c={runtime:0},u=[];function a(e){return f.p+"static/js/"+({}[e]||e)+"."+{"chunk-22cea610":"7879ff8f","chunk-24e6d936":"285324d6","chunk-3f128364":"a125ba12","chunk-6f60c8f1":"f16bf298","chunk-0e8cf5f4":"b7552abc","chunk-7d1a163b":"4d8cc933","chunk-fb358dce":"6446d522"}[e]+".js"}function f(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,f),n.l=!0,n.exports}f.e=function(e){var t=[],n={"chunk-22cea610":1,"chunk-24e6d936":1,"chunk-3f128364":1,"chunk-0e8cf5f4":1,"chunk-fb358dce":1};o[e]?t.push(o[e]):0!==o[e]&&n[e]&&t.push(o[e]=new Promise((function(t,n){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-22cea610":"3c7f5ad9","chunk-24e6d936":"a515fcdd","chunk-3f128364":"22503e40","chunk-6f60c8f1":"31d6cfe0","chunk-0e8cf5f4":"3328abfd","chunk-7d1a163b":"31d6cfe0","chunk-fb358dce":"921ea1ad"}[e]+".css",c=f.p+r,u=document.getElementsByTagName("link"),a=0;a<u.length;a++){var i=u[a],l=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(l===r||l===c))return t()}var d=document.getElementsByTagName("style");for(a=0;a<d.length;a++){i=d[a],l=i.getAttribute("data-href");if(l===r||l===c)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var r=t&&t.target&&t.target.src||c,u=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");u.code="CSS_CHUNK_LOAD_FAILED",u.request=r,delete o[e],s.parentNode.removeChild(s),n(u)},s.href=c;var h=document.getElementsByTagName("head")[0];h.appendChild(s)})).then((function(){o[e]=0})));var r=c[e];if(0!==r)if(r)t.push(r[2]);else{var u=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=u);var i,l=document.createElement("script");l.charset="utf-8",l.timeout=120,f.nc&&l.setAttribute("nonce",f.nc),l.src=a(e);var d=new Error;i=function(t){l.onerror=l.onload=null,clearTimeout(s);var n=c[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;d.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",d.name="ChunkLoadError",d.type=r,d.request=o,n[1](d)}c[e]=void 0}};var s=setTimeout((function(){i({type:"timeout",target:l})}),12e4);l.onerror=l.onload=i,document.head.appendChild(l)}return Promise.all(t)},f.m=e,f.c=r,f.d=function(e,t,n){f.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},f.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,t){if(1&t&&(e=f(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(f.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)f.d(n,r,function(t){return e[t]}.bind(null,r));return n},f.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return f.d(t,"a",t),t},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.p="/",f.oe=function(e){throw console.error(e),e};var i=window["webpackJsonp"]=window["webpackJsonp"]||[],l=i.push.bind(i);i.push=t,i=i.slice();for(var d=0;d<i.length;d++)t(i[d]);var s=l;n()})([]);</script><script src=/static/js/chunk-elementUI.2491fb2f.js></script><script src=/static/js/chunk-libs.5e39c7d0.js></script><script src=/static/js/app.2f1a6545.js></script></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
||||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0df6049d"],{4658:function(e,t,n){},"884f":function(e,t,n){"use strict";n("4658")},"9ed6":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"login-container"},[n("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,"auto-complete":"on","label-position":"left"}},[n("div",{staticClass:"title-container"},[n("h3",{staticClass:"title"},[e._v("车辆模拟")])]),n("el-form-item",{attrs:{prop:"userName"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{"icon-class":"user"}})],1),n("el-input",{ref:"userName",attrs:{placeholder:"userName",name:"userName",type:"text",tabindex:"1","auto-complete":"on"},model:{value:e.loginForm.userName,callback:function(t){e.$set(e.loginForm,"userName",t)},expression:"loginForm.userName"}})],1),n("el-form-item",{attrs:{prop:"password"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{"icon-class":"password"}})],1),n("el-input",{ref:"password",attrs:{type:"password",placeholder:"Password",name:"password",tabindex:"2","auto-complete":"on"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}})],1),n("el-button",{staticStyle:{width:"48%","margin-bottom":"30px"},attrs:{loading:e.loading,type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e._v("登录系统")]),n("el-button",{staticStyle:{width:"48%","margin-bottom":"30px","margin-left":"4%"},attrs:{loading:e.loading,type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e._v("注册系统")])],1)],1)},o=[],i={name:"Login",data:function(){return{loginForm:{userName:"",password:""},loginRules:{userName:[{required:!0,trigger:"blur"}],password:[{required:!0,trigger:"blur"}]},loading:!1,passwordType:"password",redirect:void 0}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},methods:{handleLogin:function(){var e=this;this.$refs.loginForm.validate((function(t){if(!t)return console.log("error submit!!"),!1;e.loading=!0,e.$store.dispatch("user/login",e.loginForm).then((function(){e.$router.push({path:e.redirect||"/"}),e.loading=!1})).catch((function(){e.loading=!1})),e.$router.push({path:e.redirect||"/"})}))}}},a=i,s=(n("884f"),n("efc9"),n("2877")),l=Object(s["a"])(a,r,o,!1,null,"5f7d9308",null);t["default"]=l.exports},a7f1:function(e,t,n){},efc9:function(e,t,n){"use strict";n("a7f1")}}]);
|
|
|
@ -0,0 +1 @@
|
||||||
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-fb358dce"],{"9ed6":function(e,t,r){"use strict";r.r(t);var s=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"login-container"},[r("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,"auto-complete":"on","label-position":"left"}},[r("div",{staticClass:"title-container"},[r("h3",{staticClass:"title"},[e._v("智能车联-车机模拟器")])]),r("el-form-item",{attrs:{prop:"userName"}},[r("span",{staticClass:"svg-container"},[r("svg-icon",{attrs:{"icon-class":"user"}})],1),r("el-input",{ref:"userName",attrs:{placeholder:"userName",name:"userName",type:"text",tabindex:"1","auto-complete":"on"},model:{value:e.loginForm.userName,callback:function(t){e.$set(e.loginForm,"userName",t)},expression:"loginForm.userName"}})],1),r("el-form-item",{attrs:{prop:"password"}},[r("span",{staticClass:"svg-container"},[r("svg-icon",{attrs:{"icon-class":"password"}})],1),r("el-input",{ref:"password",attrs:{type:"password",placeholder:"Password",name:"password",tabindex:"2","auto-complete":"on"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}})],1),r("el-button",{staticStyle:{width:"48%","margin-bottom":"30px"},attrs:{loading:e.loading,type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e._v("登录系统 ")]),r("el-button",{staticStyle:{width:"48%","margin-bottom":"30px","margin-left":"4%"},attrs:{loading:e.loading,type:"primary"},on:{click:e.regUser}},[e._v("注册系统 ")])],1),r("el-dialog",{attrs:{visible:e.regUserStatus,width:"30%"},on:{"update:visible":function(t){e.regUserStatus=t}}},[r("el-form",{ref:"regForm",staticClass:"login-form",staticStyle:{padding:"0 30px 0"},attrs:{model:e.regForm,rules:e.loginRules,"auto-complete":"on","label-position":"left"}},[r("div",{staticClass:"title-container"},[r("h3",{staticClass:"title"},[e._v("用户注册")])]),r("el-form-item",{attrs:{prop:"userName"}},[r("span",{staticClass:"svg-container"},[r("svg-icon",{attrs:{"icon-class":"user"}})],1),r("el-input",{ref:"userName",attrs:{placeholder:"用户登录名称",name:"userName",type:"text",tabindex:"1","auto-complete":"on"},model:{value:e.regForm.userName,callback:function(t){e.$set(e.regForm,"userName",t)},expression:"regForm.userName"}})],1),r("el-form-item",{attrs:{prop:"password"}},[r("span",{staticClass:"svg-container"},[r("svg-icon",{attrs:{"icon-class":"password"}})],1),r("el-input",{ref:"password",attrs:{type:"password",placeholder:"用户登录密码",name:"password",tabindex:"2","auto-complete":"on"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}},model:{value:e.regForm.password,callback:function(t){e.$set(e.regForm,"password",t)},expression:"regForm.password"}})],1)],1),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.regUserStatus=!1}}},[e._v("取 消")]),r("el-button",{attrs:{type:"primary"},on:{click:e.doRegUser}},[e._v("确 定")])],1)],1)],1)},o=[],a=r("c24f"),n={name:"Login",data:function(){return{loginForm:{userName:"",password:""},regForm:{userName:"",password:""},regUserStatus:!1,loginRules:{userName:[{required:!0,trigger:"blur",message:"请输入用户名称"}],password:[{required:!0,trigger:"blur",message:"请输入用户密码"}]},loading:!1,passwordType:"password",redirect:void 0}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},methods:{doRegUser:function(){var e=this;this.$refs.regForm.validate((function(t){t&&Object(a["c"])(e.regForm).then((function(t){e.$message({message:"注册成功",type:"success"}),e.regUserStatus=!1}))}))},regUser:function(){this.regUserStatus=!0,this.regForm={userName:"",password:""}},handleLogin:function(){var e=this;this.$refs.loginForm.validate((function(t){if(!t)return console.log("error submit!!"),!1;e.loading=!0,e.$store.dispatch("user/login",e.loginForm).then((function(){e.$router.push({path:e.redirect||"/"}),e.loading=!1})).catch((function(){e.loading=!1})),e.$router.push({path:e.redirect||"/"})}))}}},i=n,l=(r("f165"),r("db72"),r("2877")),c=Object(l["a"])(i,s,o,!1,null,"1ad18199",null);t["default"]=c.exports},b8c3:function(e,t,r){},db72:function(e,t,r){"use strict";r("b8c3")},ea51:function(e,t,r){},f165:function(e,t,r){"use strict";r("ea51")}}]);
|
Loading…
Reference in New Issue