zhoushihao
2024-04-15 fb3ceff6f250f7483e77a1ebe90b13b712bd7817
代码还原,设置登录相关提交属性
8个文件已修改
324 ■■■■■ 已修改文件
UI-Project/src/views/LoginView.vue 172 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/springsecurity/src/main/resources/application.yml 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingMapper.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/LoginView.vue
@@ -1,23 +1,22 @@
<script lang="ts" setup>
import {onMounted, onUnmounted, reactive, ref} from "vue"
import {onMounted, onUnmounted, reactive, ref} from 'vue'
import {useRoute, useRouter} from 'vue-router'
import type {FormInstance, FormRules} from 'element-plus'
import {ElMessage} from "element-plus";
import {ElMessage} from 'element-plus'
import request from '@/utils/request'
import userInfo from '@/stores/userInfo'
const store=userInfo()
let ruleFormRef  = ref<FormInstance>()
const store = userInfo()
let ruleFormRef = ref<FormInstance>()
const router = useRouter()
const route = useRoute()
const userForm = reactive({
  userId: '',
  pass: ''
  userName: '',
  password: '',
})
if (typeof(route.query.id) != "undefined"){
if (typeof route.query.id != 'undefined') {
  userForm.userId = <string>route.query.id
}
@@ -38,8 +37,8 @@
}
const rules = reactive<FormRules<typeof userForm>>({
  userId: [{ validator: validateUser, trigger: 'blur' }],
  pass: [{ validator: validatePass, trigger: 'blur' }]
  userId: [{validator: validateUser, trigger: 'blur'}],
  pass: [{validator: validatePass, trigger: 'blur'}],
})
//登陆方法
@@ -62,24 +61,24 @@
              loginLoadings.value = false
              return false
            }
          }).catch(error => {
        ElMessage.error("服务器连接失败")
        loginLoadings.value=false
        return false
      })
          })
          .catch((error) => {
            ElMessage.error('服务器连接失败')
            loginLoadings.value = false
            return false
          })
    }
  })
}
function register() {
  router.push({
    path:'/register',
    path: '/register',
  })
}
let loginLoadings= ref(false)
let registerLoadings= ref(false)
let loginLoadings = ref(false)
let registerLoadings = ref(false)
const keyDown = (e) => {
  // 回车则执行登录方法 enter键的ASCII是13
@@ -87,17 +86,16 @@
    submitForm(ruleFormRef.value)
  }
}
onMounted(()=>{
onMounted(() => {
  window.addEventListener('keydown', keyDown)
})
onUnmounted(() => {
  window.removeEventListener('keydown', keyDown)
})
</script>
<template>
  <div class="mainDiv" >
  <div class="mainDiv">
    <div id="main-login">
      <!-- <img
        style="width: 100%; height: 99vh"
@@ -107,62 +105,52 @@
        <div style="position: absolute; left: 8vw; top: 6vw; ">
          <img src="../../src/assets/3.png">
        </div>
       <div style="position: absolute; left: 15vw; top: 22vw; font-size: 55px;color: rgba(29, 33, 41, 1);">
        北玻MES系统
      </div>
    </div>
      <div id="div-login">
        <el-form
            @submit.native.prevent
            ref="ruleFormRef"
            :model="userForm"
            status-icon
            :rules="rules"
        >
        <div id="center">
            <div style="color: rgba(78, 89, 105, 1);margin-bottom: 10px;">账号</div>
          <el-form-item prop="userId">
            <el-input
            style="width: 340px;"
                v-model="userForm.userId"
                type="text"
                autocomplete="off"
                :prefix-icon="Avatar"
                placeholder="请输入账号"
            />
          </el-form-item>
            <div style="color: rgba(78, 89, 105, 1);margin-bottom: 10px;">密码</div>
          <el-form-item prop="pass">
            <el-input
            style="width: 340px;"
                v-model="userForm.pass"
                type="password"
                autocomplete="off"
                :prefix-icon="Lock"
                show-password
                placeholder="请输入密码"
            />
          </el-form-item>
          <el-form-item id="submitForm">
            <el-button
                :loading="loginLoadings"
                type="primary"
                native-type="submit"
                @click="submitForm(ruleFormRef)"
                @keyup.enter.native="keyDown(e)"
                plain
            >登录
            </el-button>
            <el-button
                :loading="registerLoadings"
                type="primary"
                @click="register"
                plain
            >注册
            </el-button>
          </el-form-item>
        <div style="position: absolute; left: 15vw; top: 22vw; font-size: 55px;color: rgba(29, 33, 41, 1);">
          北玻MES系统
        </div>
      </div>
      <div id="div-login">
        <el-form @submit.native.prevent
                 ref="ruleFormRef"
                 :model="userForm"
                 status-icon
                 :rules="rules">
          <div id="center">
            <div style="color: rgba(78, 89, 105, 1);margin-bottom: 10px;">账号</div>
            <el-form-item prop="userId">
              <el-input style="width: 340px;"
                        v-model="userForm.userName"
                        type="text"
                        autocomplete="off"
                        :prefix-icon="Avatar"
                        placeholder="请输入账号"/>
            </el-form-item>
            <div style="color: rgba(78, 89, 105, 1);margin-bottom: 10px;">密码</div>
            <el-form-item prop="pass">
              <el-input style="width: 340px;"
                        v-model="userForm.password"
                        type="password"
                        autocomplete="off"
                        :prefix-icon="Lock"
                        show-password
                        placeholder="请输入密码"/>
            </el-form-item>
            <el-form-item id="submitForm">
              <el-button :loading="loginLoadings"
                         type="primary"
                         native-type="submit"
                         @click="submitForm(ruleFormRef)"
                         @keyup.enter.native="keyDown(e)"
                         plain>登录
              </el-button>
              <el-button :loading="registerLoadings"
                         type="primary"
                         @click="register"
                         plain>注册
              </el-button>
            </el-form-item>
          </div>
        </el-form>
      </div>
    </div>
@@ -171,18 +159,19 @@
</template>
<style scoped>
.mainDiv{
.mainDiv {
  overflow: hidden;
  min-width: 718px;
  background-image: url("../../src/assets/background.jpg");
  background-image: url('../../src/assets/background.jpg');
}
#main-login{
#main-login {
  margin: 150px auto 0 auto;
  height: 70vh;
  width: 80vw;
}
#img-div{
#img-div {
  width: 55%;
  height: 100%;
  display: flex;
@@ -190,11 +179,13 @@
  align-items: center;
  float: left;
}
#img-pic{
#img-pic {
  max-height: 90%;
  max-width: 100%;
}
#div-login{
#div-login {
  margin-top: 5%;
  /* margin-top: 20%; */
  /* margin-left: 650px; */
@@ -204,22 +195,25 @@
  height: 60%;
  min-width: 318px;
  border-radius: 4px;
  box-shadow: 0 8px 16px 0 rgba(0,0,0,0), 0 6px 5px 0 rgba(0,0,0,0.19);
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0), 0 6px 5px 0 rgba(0, 0, 0, 0.19);
}
#center{
#center {
  margin-top: -30px;
}
.el-form{
.el-form {
  width: 60%;
  margin: 20% auto auto;
}
#submitForm {
  display: flex;
  justify-content: space-evenly;
  margin-top: 2rem;
}
:deep(.el-form-item__content){
  flex: unset
:deep(.el-form-item__content) {
  flex: unset;
}
</style>
hangzhoumesParent/common/springsecurity/src/main/resources/application.yml
@@ -2,23 +2,10 @@
  port: 8089
spring:
  datasource:
    dynamic:
      primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master
      strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源.
      datasource:
        hangzhoumes:
          url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
        slave_1:
          #配置数据源类型
          type: com.zaxxer.hikari.HikariDataSource
          #配置连接数据库的信息
          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
          url: jdbc:sqlserver://10.153.19.150:1433;databasename=mybatisTest
          username: sa
          password: 'beibo.123/'
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false
    username: root
    password: beibo.123/
  cloud:
    nacos:
      discovery:
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml
@@ -2,23 +2,10 @@
  port: 8081
spring:
  datasource:
    dynamic:
      primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master
      strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源.
      datasource:
        hangzhoumes:
          url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
        slave_1:
          #配置数据源类型
          type: com.zaxxer.hikari.HikariDataSource
          #配置连接数据库的信息
          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
          url: jdbc:sqlserver://10.153.19.150:1433;databasename=mybatisTest
          username: sa
          password: 'beibo.123/'
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false
    username: root
    password: beibo.123/
  cloud:
    nacos:
      discovery:
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
@@ -3,23 +3,10 @@
spring:
  datasource:
    dynamic:
      primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master
      strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源.
      datasource:
        hangzhoumes:
          url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
        slave_1:
          #配置数据源类型
          type: com.zaxxer.hikari.HikariDataSource
          #配置连接数据库的信息
          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
          url: jdbc:sqlserver://10.153.19.150:1433;databasename=mybatisTest
          username: sa
          password: 'beibo.123/'
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false
    username: root
    password: beibo.123/
  cloud:
    nacos:
      discovery:
hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml
@@ -3,23 +3,10 @@
spring:
  datasource:
    dynamic:
      primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master
      strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源.
      datasource:
        hangzhoumes:
          url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
        slave_1:
          #配置数据源类型
          type: com.zaxxer.hikari.HikariDataSource
          #配置连接数据库的信息
          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
          url: jdbc:sqlserver://10.153.19.150:1433;databasename=mybatisTest
          username: sa
          password: 'beibo.123/'
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false
    username: root
    password: beibo.123/
  cloud:
    nacos:
      discovery:
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingMapper.java
@@ -1,33 +1,34 @@
package com.mes.temperingglass.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mes.temperingglass.entity.GlassInfo;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import org.apache.ibatis.annotations.*;
@Mapper
public interface TemperingMapper extends BaseMapper<TemperingGlassInfo> {
//查询该玻璃的尺寸和坐标
@Select("select *from glass_info where id=#{glassid};")
GlassInfo SelectGlass(String glassid);
    //查询该玻璃的尺寸和坐标
//@Select("select *from glass_info where id=#{glassid};")
//GlassInfo SelectGlass(String glassid);
//是否可以发送进炉信号
@Select("select count(*) from glass_info where id=#{glassid};")
int SelectTempering(String glassid);
//查询等待中的钢化版图玻璃信息
@Select("select*from tempering_glass_info a left join (select flowcard_id,count(state)state from tempering_glass_info GROUP BY flowcard_id,state)b on a.flowcard_id=b.flowcard_id where b.state=2")
List<TemperingGlassInfo> SelectWaitingGlass();
//查询进炉中的钢化版图玻璃信息
@Select("select*from tempering_glass_info a left join (select flowcard_id,min(state)state1 from tempering_glass_info GROUP BY flowcard_id having state1=1)b on a.flowcard_id=b.flowcard_id where b.state1=1")
List<TemperingGlassInfo> SelectInGlass();
//查询钢化后的钢化版图信息
@Select("select*from tempering_glass_info a left join (select flowcard_id,min(state)state1 from tempering_glass_info GROUP BY flowcard_id having state1=2)b on a.flowcard_id=b.flowcard_id where b.state1=2")
List <TemperingGlassInfo> SelectOutGlass();
    @Select("select count(*) from glass_info where id=#{glassid};")
    int SelectTempering(String glassid);
    //查询等待中的钢化版图玻璃信息
    @Select("select*from tempering_glass_info a left join (select flowcard_id,count(state)state from tempering_glass_info GROUP BY flowcard_id,state)b on a.flowcard_id=b.flowcard_id where b.state=2")
    List<TemperingGlassInfo> SelectWaitingGlass();
    //查询进炉中的钢化版图玻璃信息
    @Select("select*from tempering_glass_info a left join (select flowcard_id,min(state)state1 from tempering_glass_info GROUP BY flowcard_id having state1=1)b on a.flowcard_id=b.flowcard_id where b.state1=1")
    List<TemperingGlassInfo> SelectInGlass();
    //查询钢化后的钢化版图信息
    @Select("select*from tempering_glass_info a left join (select flowcard_id,min(state)state1 from tempering_glass_info GROUP BY flowcard_id having state1=2)b on a.flowcard_id=b.flowcard_id where b.state1=2")
    List<TemperingGlassInfo> SelectOutGlass();
}
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml
@@ -2,23 +2,10 @@
  port: 8084
spring:
  datasource:
    dynamic:
      primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master
      strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源.
      datasource:
        hangzhoumes:
          url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
        slave_1:
          #配置数据源类型
          type: com.zaxxer.hikari.HikariDataSource
          #配置连接数据库的信息
          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
          url: jdbc:sqlserver://10.153.19.150:1433;databasename=mybatisTest
          username: sa
          password: 'beibo.123/'
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false
    username: root
    password: beibo.123/
  cloud:
    nacos:
      discovery:
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml
@@ -12,14 +12,6 @@
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
        slave_1:
          #配置数据源类型
          type: com.zaxxer.hikari.HikariDataSource
          #配置连接数据库的信息
          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
          url: jdbc:sqlserver://10.153.19.150:1433;databasename=mybatisTest
          username: sa
          password: 'beibo.123/'
  cloud:
    nacos:
      discovery:
@@ -34,8 +26,8 @@
mybatis-plus:
  mapper-locations: classpath*:mapper/*.xml
#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    # 设置 MyBatis 日志级别为 ERROR
  #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  # 设置 MyBatis 日志级别为 ERROR
logging:
  level:
    com: