Compare commits

...

3 Commits

Author SHA1 Message Date
haozq 59a9cd2f90 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	src/utils/aescbc.js
2025-02-11 11:15:28 +08:00
haozq 8135b9c086 文件预览加解密默认修改 2025-02-11 11:14:50 +08:00
haozq f55e78ae82 添加错误提示 2025-02-11 10:46:35 +08:00
3 changed files with 57 additions and 38 deletions

View File

@ -1,5 +1,6 @@
import { login, logout, getInfo, refreshToken } from '@/api/login'
import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth'
import { Notification, MessageBox, Message, Loading } from 'element-ui'
import router, { resetRouter } from '@/router'
import Router from '@/router'
@ -80,6 +81,7 @@ const user = {
login(username, password, code, uuid).then(res => {
let data = res.data
if(data.code && data.code===500){
Message.error(data.msg)
reject(data);
}else {
setToken(data.access_token)

View File

@ -6,42 +6,58 @@ const cbc_iv = CryptoJS.enc.Utf8.parse('1234567812345678')
* 默认参数需要加密
* @type {boolean}
*/
const jia_mi = false
const jia_mi=false;
/**
* 默认后台会自动加密
* @type {boolean}
*/
const jie_mi = false
const jie_mi=false;
/**
* 加密
* @param word
* @returns {string}
*/
export const encryptCBC = function (word) {
if (!jia_mi) {
return word
export const encryptCBC = function(word) {
if(!jia_mi){
return word;
}
const srcs = CryptoJS.enc.Utf8.parse(word)
const encrypted = CryptoJS.AES.encrypt(srcs, cbc_key, {
iv: cbc_iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7,
padding: CryptoJS.pad.Pkcs7
})
return encrypted.toString()
}
/**
* 解密
* @param word
* @returns {*}
*/
export const decryptCBC = function (word) {
if (!jie_mi) {
return word
export const decryptCBC = function(word) {
if(!jie_mi){
return word;
}
const encrypted = CryptoJS.AES.decrypt(word, cbc_key, {
iv: cbc_iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7,
padding: CryptoJS.pad.Pkcs7
})
return encrypted.toString(CryptoJS.enc.Utf8)
}
/**
* 文件预览专用
* @param word
* @returns {string}
*/
export const encryptCBCTime= function(word) {
const srcs = CryptoJS.enc.Utf8.parse(word)
const encrypted = CryptoJS.AES.encrypt(srcs, cbc_key, {
iv: cbc_iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
})
return encrypted.toString()
}

View File

@ -63,14 +63,15 @@
</template>
</el-table-column>
<el-table-column label="社会统一征信代码" show-overflow-tooltip align="center" prop="socialUnifiedCreditCode"/>
<el-table-column label="总监" align="center" prop="directorsName"/>
<el-table-column label="总监联系方式" width="120" align="center">
<template slot-scope="scope">
<!-- 检查是否存在身份证号 -->
<span v-if="scope.row.directorsPhone">{{ hideSensitiveInfo(scope.row.directorsPhone) }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="总监" show-overflow-tooltip align="center" prop="userNum"/>
<!-- <el-table-column label="总监" align="center" prop="directorsName"/>-->
<!-- <el-table-column label="总监联系方式" width="120" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- &lt;!&ndash; 检查是否存在身份证号 &ndash;&gt;-->
<!-- <span v-if="scope.row.directorsPhone">{{ hideSensitiveInfo(scope.row.directorsPhone) }}</span>-->
<!-- <span v-else>-</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -143,24 +144,24 @@
:style="{width: '100%'}"
:disabled="view"></el-input>
</el-form-item>
<el-form-item label="总监" prop="directorsName" label-width="140px">
<el-input v-model="unitForm.directorsName" placeholder="请输入总监姓名" show-word-limit :maxlength="20"
clearable v-no-whitespace
:style="{width: '100%'}"
:disabled="edit"></el-input>
</el-form-item>
<el-form-item label="总监联系方式" prop="directorsPhone" label-width="140px">
<el-input v-model="unitForm.directorsPhone" placeholder="请输入总监联系方式" show-word-limit :maxlength="11"
clearable v-no-whitespace
:style="{width: '100%'}"
:disabled="edit"></el-input>
</el-form-item>
<el-form-item v-if="unitForm.supId == undefined" label="总监身份证" prop="directorsIdCard" label-width="140px">
<el-input v-model="unitForm.directorsIdCard" placeholder="请输入总监总监身份证" show-word-limit :maxlength="18"
clearable v-no-whitespace
:style="{width: '100%'}"
></el-input>
</el-form-item>
<!-- <el-form-item label="总监" prop="directorsName" label-width="140px">-->
<!-- <el-input v-model="unitForm.directorsName" placeholder="请输入总监姓名" show-word-limit :maxlength="20"-->
<!-- clearable v-no-whitespace-->
<!-- :style="{width: '100%'}"-->
<!-- :disabled="edit"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="总监联系方式" prop="directorsPhone" label-width="140px">-->
<!-- <el-input v-model="unitForm.directorsPhone" placeholder="请输入总监联系方式" show-word-limit :maxlength="11"-->
<!-- clearable v-no-whitespace-->
<!-- :style="{width: '100%'}"-->
<!-- :disabled="edit"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-if="unitForm.supId == undefined" label="总监身份证" prop="directorsIdCard" label-width="140px">-->
<!-- <el-input v-model="unitForm.directorsIdCard" placeholder="请输入总监总监身份证" show-word-limit :maxlength="18"-->
<!-- clearable v-no-whitespace-->
<!-- :style="{width: '100%'}"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer" v-if="showOrNot">
<el-button type="primary" @click="submitForm" v-preventReClick="5000"> </el-button>
@ -171,7 +172,7 @@
</template>
<script>
import {addSupervisoryUnit, checkIsExistUnitName} from "@/api/pro/proList";
import { addSupervisoryUnit, addSupervisoryUnitUser, checkIsExistUnitName } from '@/api/pro/proList'
import {
delSupervisionUnit,
listSupervisionUnit,
@ -380,7 +381,7 @@ export default {
//
return;
}
addSupervisoryUnit(this.unitForm).then(response => {
addSupervisoryUnitUser(this.unitForm).then(response => {
if (response.code === 200) {
this.$message({
message: '新建成功',