修复用户、角色、权限、添加或修改报错时再次添加后关联数据重复的问题
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
<div id="console" :style="'height:'+ height" class="console">
|
<div id="console" :style="'height:'+ height" class="console">
|
||||||
<div v-for="item in data" :key="item.time">
|
<div v-for="item in data" :key="item.time">
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
<span style="color:#CD0066 ">{{ item.timestamp+' ' }}</span>
|
<span style="color:#CD0066 ">{{ time(item.timestamp)+' ' }}</span>
|
||||||
<span style="color: #00CD00">{{ item.threadName+' ' }}</span>
|
<span style="color: #00CD00">{{ item.threadName+' ' }}</span>
|
||||||
<span :style="'color:'+ getColor(item.level) ">
|
<span :style="'color:'+ getColor(item.level) ">
|
||||||
{{ item.level+' ' }}
|
{{ item.level+' ' }}
|
||||||
@@ -58,6 +58,9 @@ export default {
|
|||||||
clearInterval(this.timer)
|
clearInterval(this.timer)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
time(date) {
|
||||||
|
return parseTime(date)
|
||||||
|
},
|
||||||
initWebSocket() {
|
initWebSocket() {
|
||||||
this.connection(this)
|
this.connection(this)
|
||||||
// 断开重连机制,尝试发送消息,捕获异常发生时重连
|
// 断开重连机制,尝试发送消息,捕获异常发生时重连
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ export default {
|
|||||||
doSubmit() {
|
doSubmit() {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
this.form.roles = []
|
||||||
const _this = this
|
const _this = this
|
||||||
this.roleIds.forEach(function(data, index) {
|
this.roleIds.forEach(function(data, index) {
|
||||||
const role = { id: data }
|
const role = { id: data }
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ export default {
|
|||||||
doSubmit() {
|
doSubmit() {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
this.form.roles = []
|
||||||
const _this = this
|
const _this = this
|
||||||
this.roleIds.forEach(function(data, index) {
|
this.roleIds.forEach(function(data, index) {
|
||||||
const role = { id: data }
|
const role = { id: data }
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ export default {
|
|||||||
doSubmit() {
|
doSubmit() {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
this.form.permissions = []
|
||||||
const _this = this
|
const _this = this
|
||||||
this.permissionIds.forEach(function(data, index) {
|
this.permissionIds.forEach(function(data, index) {
|
||||||
const permission = { id: data }
|
const permission = { id: data }
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export default {
|
|||||||
doSubmit() {
|
doSubmit() {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
this.form.permissions = []
|
||||||
const _this = this
|
const _this = this
|
||||||
this.permissionIds.forEach(function(data, index) {
|
this.permissionIds.forEach(function(data, index) {
|
||||||
const permission = { id: data }
|
const permission = { id: data }
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ export default {
|
|||||||
doSubmit() {
|
doSubmit() {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
this.form.roles = []
|
||||||
const _this = this
|
const _this = this
|
||||||
this.roleIds.forEach(function(data, index) {
|
this.roleIds.forEach(function(data, index) {
|
||||||
const role = { id: data }
|
const role = { id: data }
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ export default {
|
|||||||
doSubmit() {
|
doSubmit() {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
this.form.roles = []
|
||||||
const _this = this
|
const _this = this
|
||||||
this.roleIds.forEach(function(data, index) {
|
this.roleIds.forEach(function(data, index) {
|
||||||
const role = { id: data }
|
const role = { id: data }
|
||||||
|
|||||||
Reference in New Issue
Block a user