diff --git a/src/api/login.js b/src/api/login.js
index 8d036d4..2625395 100644
--- a/src/api/login.js
+++ b/src/api/login.js
@@ -1,14 +1,14 @@
import request from '@/utils/request'
// 登录方法
-export function login(username, password, code, uuid) {
+export function login(encrypt, code, uuid) {
return request({
url: '/auth/login',
headers: {
isToken: false
},
method: 'post',
- data: { username, password, code, uuid }
+ data: { encrypt, code, uuid }
})
}
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 3243255..b173c36 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -1,5 +1,6 @@
import {login, logout, getInfo, refreshToken, validate} from '@/api/login'
import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth'
+import {encrypt} from "@/utils/jsencrypt";
const user = {
state: {
@@ -38,8 +39,14 @@ const user = {
const password = userInfo.password
const code = userInfo.code
const uuid = userInfo.uuid
+ const data = {
+ username: username,
+ password: password,
+ };
+ const encryptData = encrypt(JSON.stringify(data));
return new Promise((resolve, reject) => {
- login(username, password, code, uuid).then(res => {
+ // login(username, password, code, uuid).then(res => {
+ login(encryptData, code, uuid).then(res => {
let data = res.data
setToken(data.access_token)
commit('SET_TOKEN', data.access_token)
diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue
index 19e25a0..e6616ae 100644
--- a/src/views/system/notice/index.vue
+++ b/src/views/system/notice/index.vue
@@ -83,6 +83,11 @@
+
+
+
+
+
@@ -133,7 +138,8 @@
-
+
-
+
+
+
+
+
+
+
+
@@ -174,7 +192,7 @@ import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api
export default {
name: "Notice",
- dicts: ['sys_notice_status', 'sys_notice_type'],
+ dicts: ['sys_notice_status', 'sys_notice_type', 'sys_park_group'],
data() {
return {
// 遮罩层
@@ -211,8 +229,9 @@ export default {
{ required: true, message: "公告标题不能为空", trigger: "blur" }
],
noticeType: [
- { required: true, message: "公告类型不能为空", trigger: "change" }
- ]
+ {required: true, message: "公告类型不能为空", trigger: "change"}
+ ],
+ dictValue: [],
}
};
},
@@ -241,7 +260,9 @@ export default {
noticeTitle: undefined,
noticeType: undefined,
noticeContent: undefined,
- status: "0"
+ status: "0",
+ dictValue: undefined,
+ dictType: undefined,
};
this.resetForm("form");
},
@@ -271,6 +292,9 @@ export default {
handleUpdate(row) {
this.reset();
const noticeId = row.noticeId || this.ids
+ if (row.noticeType === '3') {
+ this.rules.dictValue.push({required: true, message: "园区不能为空", trigger: "change"});
+ }
getNotice(noticeId).then(response => {
this.form = response.data;
this.open = true;
@@ -281,6 +305,9 @@ export default {
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
+ if (this.form.noticeType === '3') {
+ this.form.dictType = 'sys_park_group';
+ }
if (this.form.noticeId != undefined) {
updateNotice(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
@@ -300,13 +327,22 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const noticeIds = row.noticeId || this.ids
- this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function() {
+ this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function () {
return delNotice(noticeIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
- }).catch(() => {});
- }
+ }).catch(() => {
+ });
+ },
+
+ noticeTypeChange(data) {
+ console.log(data === '3')
+ if (data === '3') {
+ this.rules.dictValue.push({required: true, message: "园区不能为空", trigger: "change"});
+ }
+ },
+
}
};
-
\ No newline at end of file
+