Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue
Conflicts: ruoyi-ui/package.json ruoyi-ui/src/api/login.js ruoyi-ui/src/assets/styles/ruoyi.scss ruoyi-ui/src/layout/components/Navbar.vue ruoyi-ui/src/utils/ruoyi.js ruoyi-ui/src/views/tool/build/index.vue ruoyi-ui/src/views/tool/gen/editTable.vue ruoyi-ui/src/views/tool/gen/index.vue ruoyi/src/main/java/com/ruoyi/project/monitor/domain/SysLogininfor.java ruoyi/src/main/java/com/ruoyi/project/monitor/domain/SysOperLog.java ruoyi/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java ruoyi/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java ruoyi/src/main/resources/mybatis/tool/GenTableMapper.xml
This commit is contained in:
commit
31a2713012
@ -54,6 +54,7 @@
|
|||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"path-to-regexp": "2.4.0",
|
"path-to-regexp": "2.4.0",
|
||||||
"screenfull": "4.2.0",
|
"screenfull": "4.2.0",
|
||||||
|
"sortablejs": "1.8.4",
|
||||||
"vue": "2.6.10",
|
"vue": "2.6.10",
|
||||||
"vue-count-to": "1.0.13",
|
"vue-count-to": "1.0.13",
|
||||||
"vue-quill-editor": "3.0.6",
|
"vue-quill-editor": "3.0.6",
|
||||||
|
@ -11,7 +11,7 @@ export function login(username, password, code, uuid) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/login',
|
url: '/login',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,4 +37,4 @@ export function getCodeImg() {
|
|||||||
url: '/captchaImage',
|
url: '/captchaImage',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@
|
|||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* text color */
|
/* text color */
|
||||||
.text-navy {
|
.text-navy {
|
||||||
color: #1ab394;
|
color: #1ab394;
|
||||||
@ -187,4 +187,12 @@
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
box-shadow: 0 0 4px #ccc;
|
box-shadow: 0 0 4px #ccc;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 拖拽列样式 */
|
||||||
|
.sortable-ghost{
|
||||||
|
opacity: .8;
|
||||||
|
color: #fff!important;
|
||||||
|
background: #42b983!important;
|
||||||
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
<template v-if="device!=='mobile'">
|
<template v-if="device!=='mobile'">
|
||||||
<search id="header-search" class="right-menu-item" />
|
<search id="header-search" class="right-menu-item" />
|
||||||
|
|
||||||
<el-tooltip content="源码地址" effect="dark" placement="bottom">
|
<el-tooltip content="源码地址" effect="dark" placement="bottom">
|
||||||
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
|
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@ -33,8 +33,8 @@
|
|||||||
<router-link to="/user/profile">
|
<router-link to="/user/profile">
|
||||||
<el-dropdown-item>个人中心</el-dropdown-item>
|
<el-dropdown-item>个人中心</el-dropdown-item>
|
||||||
</router-link>
|
</router-link>
|
||||||
<el-dropdown-item>
|
<el-dropdown-item @click.native="setting = true">
|
||||||
<span @click="setting = true">布局设置</span>
|
<span>布局设置</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item divided @click.native="logout">
|
<el-dropdown-item divided @click.native="logout">
|
||||||
<span>退出登录</span>
|
<span>退出登录</span>
|
||||||
|
@ -17,6 +17,8 @@ export function parseTime(time, pattern) {
|
|||||||
} else {
|
} else {
|
||||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||||
time = parseInt(time)
|
time = parseInt(time)
|
||||||
|
} else if (typeof time === 'string') {
|
||||||
|
time = time.replace(new RegExp(/-/gm), '/');
|
||||||
}
|
}
|
||||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||||
time = time * 1000
|
time = time * 1000
|
||||||
@ -102,7 +104,6 @@ export function praseStrEmpty(str) {
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构造树型结构数据
|
* 构造树型结构数据
|
||||||
* @param {*} data 数据源
|
* @param {*} data 数据源
|
||||||
|
@ -135,7 +135,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import draggable from 'vuedraggable'
|
import draggable from 'vuedraggable'
|
||||||
import { saveAs } from 'file-saver'
|
import { saveAs } from 'file-saver'
|
||||||
@ -429,7 +428,7 @@ input, textarea{
|
|||||||
padding: 12px 18px 15px 15px;
|
padding: 12px 18px 15px 15px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.el-scrollbar__wrap {
|
.left-scrollbar .el-scrollbar__wrap {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow-x: hidden !important;
|
overflow-x: hidden !important;
|
||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
@ -503,7 +502,7 @@ input, textarea{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-scrollbar__view{
|
.left-scrollbar .el-scrollbar__view{
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
<basic-info-form ref="basicInfo" :info="info" />
|
<basic-info-form ref="basicInfo" :info="info" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="字段信息" name="cloum">
|
<el-tab-pane label="字段信息" name="cloum">
|
||||||
<el-table :data="cloumns" :max-height="tableHeight">
|
<el-table ref="dragTable" :data="cloumns" row-key="columnId" :max-height="tableHeight">
|
||||||
<el-table-column label="序号" type="index" min-width="5%" />
|
<el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="字段列名"
|
label="字段列名"
|
||||||
prop="columnName"
|
prop="columnName"
|
||||||
@ -126,6 +126,7 @@ import { getGenTable, updateGenTable } from "@/api/tool/gen";
|
|||||||
import { optionselect as getDictOptionselect } from "@/api/system/dict/type";
|
import { optionselect as getDictOptionselect } from "@/api/system/dict/type";
|
||||||
import basicInfoForm from "./basicInfoForm";
|
import basicInfoForm from "./basicInfoForm";
|
||||||
import genInfoForm from "./genInfoForm";
|
import genInfoForm from "./genInfoForm";
|
||||||
|
import Sortable from 'sortablejs'
|
||||||
export default {
|
export default {
|
||||||
name: "GenEdit",
|
name: "GenEdit",
|
||||||
components: {
|
components: {
|
||||||
@ -198,6 +199,19 @@ export default {
|
|||||||
this.$store.dispatch("tagsView/delView", this.$route);
|
this.$store.dispatch("tagsView/delView", this.$route);
|
||||||
this.$router.push({ path: "/tool/gen", query: { t: Date.now()}})
|
this.$router.push({ path: "/tool/gen", query: { t: Date.now()}})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
const el = this.$refs.dragTable.$el.querySelectorAll(".el-table__body-wrapper > table > tbody")[0];
|
||||||
|
const sortable = Sortable.create(el, {
|
||||||
|
handle: ".allowDrag",
|
||||||
|
onEnd: evt => {
|
||||||
|
const targetRow = this.cloumns.splice(evt.oldIndex, 1)[0];
|
||||||
|
this.cloumns.splice(evt.newIndex, 0, targetRow);
|
||||||
|
for (let index in this.cloumns) {
|
||||||
|
this.cloumns[index].sort = parseInt(index) + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
|
|
||||||
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55"></el-table-column>
|
<el-table-column type="selection" width="55"></el-table-column>
|
||||||
<el-table-column label="序号" align="center" prop="tableId" width="50px" />
|
<el-table-column label="序号" align="center" prop="tableId" width="60px" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="表名称"
|
label="表名称"
|
||||||
align="center"
|
align="center"
|
||||||
@ -284,4 +284,4 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.ruoyi.framework.security;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户登录对象
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class LoginBody
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户密码
|
||||||
|
*/
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 唯一标识
|
||||||
|
*/
|
||||||
|
private String uuid = "";
|
||||||
|
|
||||||
|
public String getUsername()
|
||||||
|
{
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username)
|
||||||
|
{
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword()
|
||||||
|
{
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password)
|
||||||
|
{
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode()
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code)
|
||||||
|
{
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUuid()
|
||||||
|
{
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUuid(String uuid)
|
||||||
|
{
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.project.monitor.domain;
|
package com.ruoyi.project.monitor.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
||||||
import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
||||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||||
@ -47,6 +48,7 @@ public class SysLogininfor extends BaseEntity
|
|||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
/** 访问时间 */
|
/** 访问时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date loginTime;
|
private Date loginTime;
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.project.monitor.domain;
|
package com.ruoyi.project.monitor.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
||||||
import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
||||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||||
@ -78,6 +79,7 @@ public class SysOperLog extends BaseEntity
|
|||||||
private String errorMsg;
|
private String errorMsg;
|
||||||
|
|
||||||
/** 操作时间 */
|
/** 操作时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date operTime;
|
private Date operTime;
|
||||||
|
|
||||||
|
@ -5,9 +5,11 @@ import java.util.Set;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.utils.ServletUtils;
|
import com.ruoyi.common.utils.ServletUtils;
|
||||||
|
import com.ruoyi.framework.security.LoginBody;
|
||||||
import com.ruoyi.framework.security.LoginUser;
|
import com.ruoyi.framework.security.LoginUser;
|
||||||
import com.ruoyi.framework.security.service.SysLoginService;
|
import com.ruoyi.framework.security.service.SysLoginService;
|
||||||
import com.ruoyi.framework.security.service.SysPermissionService;
|
import com.ruoyi.framework.security.service.SysPermissionService;
|
||||||
@ -47,11 +49,12 @@ public class SysLoginController
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/login")
|
@PostMapping("/login")
|
||||||
public AjaxResult login(String username, String password, String code, String uuid)
|
public AjaxResult login(@RequestBody LoginBody loginBody)
|
||||||
{
|
{
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
// 生成令牌
|
// 生成令牌
|
||||||
String token = loginService.login(username, password, code, uuid);
|
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||||
|
loginBody.getUuid());
|
||||||
ajax.put(Constants.TOKEN, token);
|
ajax.put(Constants.TOKEN, token);
|
||||||
return ajax;
|
return ajax;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,6 @@ public class GenController extends BaseController
|
|||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult editSave(@Validated @RequestBody GenTable genTable)
|
public AjaxResult editSave(@Validated @RequestBody GenTable genTable)
|
||||||
{
|
{
|
||||||
System.out.println(genTable.getParams().size());
|
|
||||||
genTableService.validateEdit(genTable);
|
genTableService.validateEdit(genTable);
|
||||||
genTableService.updateGenTable(genTable);
|
genTableService.updateGenTable(genTable);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
|
@ -110,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
||||||
FROM gen_table t
|
FROM gen_table t
|
||||||
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
||||||
where t.table_id = #{tableId}
|
where t.table_id = #{tableId} order by c.sort
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
|
<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
|
||||||
@ -118,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
|
||||||
FROM gen_table t
|
FROM gen_table t
|
||||||
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
|
||||||
where t.table_name = #{tableName}
|
where t.table_name = #{tableName} order by c.sort
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId">
|
<insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user