Commit 817a9133 by zhoujunpeng

Merge branch 'develop' of http://192.168.0.110:11080/isc-v3.1/isc-web-vue into develop

parents 1a6b0b28 3da50e0a
......@@ -9,6 +9,8 @@
"fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit"
},
"dependencies": {
"@wangeditor/editor": "5.1.23",
"@wangeditor/editor-for-vue": "1.0.2",
"async-validator": "^4.2.5",
"babel-polyfill": "6.26.0",
"bignumber.js": "^9.1.1",
......@@ -18,7 +20,7 @@
"camunda-bpmn-moddle": "4.4.0",
"codemirror": "5.54.0",
"core-js": "2.6.12",
"crypto-js": "4.2.0",
"crypto-js": "^4.2.0",
"diff-match-patch": "1.0.5",
"echarts": "4.6.0",
"ejs": "3.1.7",
......@@ -32,6 +34,7 @@
"js-yaml": "3.14.0",
"min-dash": "3.8.1",
"minireset.css": "0.0.6",
"moment": "2.29.4",
"print-js": "1.1.1",
"qr.js": "0.0.0",
"quill": "^1.3.7",
......@@ -42,18 +45,15 @@
"vis": "4.21.0-EOL",
"vue": "2.6.11",
"vue-codemirror": "4.0.6",
"vue-draggable-resizable": "2.3.0",
"vue-i18n": "8.21.0",
"vue-infinite-scroll": "2.0.2",
"vue-json-editor": "1.4.3",
"vue-router": "3.1.5",
"vuedraggable": "^2.24.3",
"vuex": "3.1.2",
"zrender": "5.3.1",
"moment": "2.29.4",
"@wangeditor/editor": "5.1.23",
"@wangeditor/editor-for-vue": "1.0.2",
"vue-draggable-resizable": "2.3.0",
"xlsx": "0.18.5"
"xlsx": "0.18.5",
"zrender": "5.3.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "3.7.0",
......
......@@ -11,6 +11,7 @@
clearable
ref="add"
v-bind:disabled="isDisable"
:placeholder="placeholderEnable || placeholder || $t('components.请选择')"
></el-input>
<i class="date-pick-btn el-icon-date" >
<el-date-picker
......@@ -67,6 +68,10 @@ export default {
type: String,
default: undefined
},
placeholder:{
type: String,
default: null
},
// 此对象为markset或者modifySet所在的对象,如果传了此对象可以标记当前对象下的字段为红色下划线
markSetData: {
type: Object,
......@@ -102,6 +107,14 @@ export default {
return this.mode === 'display' || this.disabled
}
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请选择') + ' ' + this.$t('components.' + label) : this.$t('components.请选择') + this.$t('components.' + label)
}
return curLabel
},
highlight() {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
......
......@@ -7,6 +7,7 @@
type="datetime"
v-bind:disabled="isDisable"
v-on="$listeners"
:placeholder="placeholderEnable || placeholder || $t('components.请选择')"
:value-format="valueFormat" :format="format"
@change="handleChange"
></el-date-picker>
......@@ -42,6 +43,10 @@ export default {
type: String,
default: undefined
},
placeholder:{
type: String,
default: null
},
// 此对象为markset或者modifySet所在的对象,如果传了此对象可以标记当前对象下的字段为红色下划线
markSetData: {
type: Object,
......@@ -69,6 +74,14 @@ export default {
return this.mode === 'display' || this.disabled
}
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请选择') + ' ' + this.$t('components.' + label) : this.$t('components.请选择') + this.$t('components.' + label)
}
return curLabel
},
highlight() {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
......
<template>
<el-date-picker :id="id" :class="{'highlight': highlight}" placeholder="选择日期" type="date" :picker-options="pickerOptions" v-model="model" v-bind="$attrs"
<el-date-picker
:id="id" :class="{'highlight': highlight}"
:placeholder="placeholderEnable || placeholder || $t('components.请选择')"
type="date" :picker-options="pickerOptions" v-model="model" v-bind="$attrs"
v-on="$listeners" v-bind:disabled="isDisable" value-format="yyyyMMdd" format="yyyy-MM-dd"></el-date-picker>
</template>
......@@ -17,6 +20,10 @@
id: {
type: String,
default: undefined
},
placeholder:{
type: String,
default: null
}
},
computed: {
......@@ -36,6 +43,14 @@
return this.mode === 'display' || this.disabled
}
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请选择') + ' ' + this.$t('components.' + label) : this.$t('components.请选择') + this.$t('components.' + label)
}
return curLabel
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
}
......
......@@ -11,8 +11,8 @@
v-bind:disabled="isDisable"
:maxlength="maxlength"
:show-word-limit="isLimitChar ? false : showWordLimit"
:placeholder="placeholderEnable || placeholder || $t('components.请输入')"
@change="handleChange"
:placeholder="placeholderEnable"
>
<template v-slot:suffix>
<slot name="suffix"></slot>
......@@ -100,7 +100,12 @@ export default {
return this.mode === 'display' || this.disabled
},
placeholderEnable(){
return this.isDisable?"":this.placeholder
let label = this.$parent.label || this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请输入') + ' ' + this.$t('components.' + label) : this.$t('components.请输入') + this.$t('components.' + label)
}
return curLabel
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
......
......@@ -10,6 +10,7 @@
v-on="$listeners"
v-bind:disabled="isDisable"
:maxlength="maxlength"
:placeholder="placeholderEnable || placeholder || $t('components.请输入')"
@blur="onBlur"
@focus="focus"
@change="handleChange"
......@@ -67,6 +68,10 @@ export default {
type: String,
default: ""
},
placeholder:{
type: String,
default: null
},
// 此对象为markset或者modifySet所在的对象,如果传了此对象可以标记当前对象下的字段为红色下划线
markSetData: {
type: Object,
......@@ -115,6 +120,14 @@ export default {
isDisable() {
return this.mode === "display" || this.disabled;
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请输入') + ' ' + this.$t('components.' + label) : this.$t('components.请输入') + this.$t('components.' + label)
}
return curLabel
},
curPrecision() {
if (this.currency === "KRW" || this.currency === "JPY") {
return 0
......
<template>
<el-input :id="id" ref="form-item" v-model="model" type="textarea" v-bind="$attrs" v-on="$listeners" v-bind:disabled="isDisable" :rows="maxRows" resize="none" />
<el-input
:id="id" ref="form-item"
v-model="model" type="textarea"
v-bind="$attrs"
v-on="$listeners"
v-bind:disabled="isDisable"
:rows="maxRows"
resize="none"
:placeholder="placeholderEnable || placeholder || $t('components.请输入')"
/>
</template>
<script>
......@@ -24,25 +33,37 @@ export default {
id: {
type: String,
default: undefined
}
},
placeholder: {
type: String,
default: null
},
},
computed: {
model: {
get () {
get() {
let value = this.format(this.value)
return value
},
set (newVal) {
set(newVal) {
this.$emit('input', newVal)
}
},
mode () {
mode() {
return this.$store.state.Status.mode
},
isDisable() {
return this.mode === 'display' || this.disabled
},
highlight () {
return this.mode === 'display' || this.disabled
},
placeholderEnable() {
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请输入') + ' ' + this.$t('components.' + label) : this.$t('components.请输入') + this.$t('components.' + label)
}
return curLabel
},
highlight() {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
}
},
......
......@@ -9,6 +9,7 @@
v-bind="$attrs"
v-on="$listeners"
v-bind:disabled="isDisable"
:placeholder="placeholderEnable || placeholder || $t('components.请输入')"
@blur="blurEvent"
@change="handleChange"
/>
......@@ -38,6 +39,10 @@ export default {
type: String,
default: undefined
},
placeholder:{
type: String,
default: null
},
// 此对象为markset或者modifySet所在的对象,如果传了此对象可以标记当前对象下的字段为红色下划线
markSetData: {
type: Object,
......@@ -63,6 +68,14 @@ export default {
isDisable() {
return this.mode === 'display' || this.disabled
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请输入') + ' ' + this.$t('components.' + label) : this.$t('components.请输入') + this.$t('components.' + label)
}
return curLabel
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
......
......@@ -10,6 +10,7 @@
v-bind:disabled="isDisable"
:rows="maxRows"
resize="none"
:placeholder="placeholderEnable || placeholder || $t('components.请输入')"
@blur="blurEvent"
@change="handleChange"
/>
......@@ -42,6 +43,10 @@ export default {
type: Number,
default: 3
},
placeholder:{
type: String,
default: null
},
// 此对象为markset或者modifySet所在的对象,如果传了此对象可以标记当前对象下的字段为红色下划线
markSetData: {
type: Object,
......@@ -67,6 +72,14 @@ export default {
isDisable() {
return this.mode === 'display' || this.disabled
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请输入') + ' ' + this.$t('components.' + label) : this.$t('components.请输入') + this.$t('components.' + label)
}
return curLabel
},
},
watch: {
disabled(newVal) {
......
......@@ -16,7 +16,7 @@
v-on="$listeners"
v-bind:disabled="isDisable"
:autosize="autosize"
:placeholder="placeholder"
:placeholder="placeholderEnable || placeholder || $t('components.请输入')"
:show-word-limit="!isLimitChar && !isIgnoreLine"
:maxlength="rows * cols"
@blur="onBlur"
......@@ -196,6 +196,14 @@ export default {
isDisable() {
return this.mode === 'display' || this.disabled
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请输入') + ' ' + this.$t('components.' + label) : this.$t('components.请输入') + this.$t('components.' + label)
}
return curLabel
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
......
......@@ -8,7 +8,7 @@
v-bind:disabled="isDisable"
:clearable="clearable"
v-on="$listeners"
:placeholder="placeholderEnable"
:placeholder="placeholderEnable || placeholder || $t('components.请选择')"
@change="handleChange"
@keyup.delete.native="deleteValue"
>
......@@ -146,9 +146,14 @@ export default {
isDisable() {
return this.mode === "display" || this.disabled;
},
placeholderEnable(){
return this.isDisable?"":this.placeholder
},
placeholderEnable(){
let label = this.$parent.label
let curLabel = ''
if (label) {
curLabel = this.$i18n.locale === 'en' ? this.$t('components.请选择') + ' ' + this.$t('components.' + label) : this.$t('components.请选择') + this.$t('components.' + label)
}
return curLabel
},
highlight() {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1;
},
......
......@@ -44,6 +44,7 @@ export default class Crtcri {
msgref: "", // 前手付汇业务编号 .crdgrp.rec.msgref
rcvobjtyp: "", // 业务种类 .crdgrp.rec.rcvobjtyp
rcvbchinr: "", // 业务所属机构 .crdgrp.rec.rcvbchinr
crttyp: '',
},
cbs: {
max: {
......
<template>
<div class="eibs-tab">
<c-col :span="12">
<el-form-item label="Drag Drop Sender" prop="crtp.recget.sdamod.dadsnd">
<c-input v-model="model.crtp.recget.sdamod.dadsnd"></c-input>
</el-form-item>
</c-col>
<!-- S0000023 : 业务编号 -->
<c-col :span="12">
<el-form-item :label="$t('crtp.业务编号')" prop="crdgrp.rec.ownref">
<c-input v-model="model.crdgrp.rec.ownref" maxlength="16"></c-input>
</el-form-item>
</c-col>
<c-col :span="12">
<el-form-item label="" prop="crtp.recget.sdamod.seainf">
<c-input v-model="model.crtp.recget.sdamod.seainf"></c-input>
</el-form-item>
</c-col>
<!-- S0000024 : 名称 -->
<c-col :span="12">
<el-form-item :label="$t('crtp.名称')" prop="crdgrp.rec.nam">
<c-input v-model="model.crdgrp.rec.nam" maxlength="40"></c-input>
</el-form-item>
</c-col>
<!-- S0000031 : 收报行 -->
<!-- S0000032 : Ref. -->
<!-- S0000025 : 经办柜员 -->
<c-col :span="12">
<el-form-item :label="$t('crtp.经办柜员')" prop="crtp.usr.extkey">
<c-input v-model="model.crtp.usr.extkey" maxlength="8"></c-input>
</el-form-item>
</c-col>
<c-col :span="12">
<c-ptap
:model="model"
:isAdrblk="false"
:haveAdrLabel="true"
:requiredExtkey="true"
:argadr="{title: '收报行', grp: 'crdgrp', rol: 'rcv'}"
ptytyp="C"
></c-ptap>
</c-col>
<c-col :span="12">
<el-form-item label="" prop="crtp.usrget.sdamod.seainf">
<c-input v-model="model.crtp.usrget.sdamod.seainf"></c-input>
</el-form-item>
</c-col>
<c-col :span="12">
<el-form-item label="Drag Drop Sender" prop="crtp.rcvp.ptsget.sdamod.dadsnd">
<c-input v-model="model.crtp.rcvp.ptsget.sdamod.dadsnd"></c-input>
</el-form-item>
</c-col>
<c-col :span="12">
<el-form-item label="" prop="crtp.rcvp.ptsget.sdamod.seainf">
<c-input v-model="model.crtp.rcvp.ptsget.sdamod.seainf"></c-input>
</el-form-item>
</c-col>
<!-- S0000026 : 清算币种及金额 -->
<c-col :span="12">
<el-form-item :label="$t('crtp.清算币种及金额')" prop="crdgrp.cbs.max.cur">
<c-select v-model="model.crdgrp.cbs.max.cur" style="width:100%" dbCode="curtxt">
</c-select>
</el-form-item>
</c-col>
<c-col :span="12">
<el-form-item :label="$t('crtp.清算币种及金额')" prop="crdgrp.cbs.max.amt">
<c-input v-model="model.crdgrp.cbs.max.amt"></c-input>
</el-form-item>
</c-col>
<!-- S0000027 : 前手付汇业务编号 -->
<c-col :span="12">
<el-form-item :label="$t('crtp.前手付汇业务编号')" prop="crdgrp.rec.msgref">
<c-input v-model="model.crdgrp.rec.msgref" maxlength="16"></c-input>
</el-form-item>
</c-col>
<!-- S0000028 : 业务种类 -->
<c-col :span="12">
<el-form-item :label="$t('crtp.业务种类')" prop="crdgrp.rec.rcvobjtyp">
<c-select dbCode="RMB122" v-model="model.crdgrp.rec.rcvobjtyp" style="width:100%">
</c-select>
</el-form-item>
</c-col>
<!-- S0000029 : 业务所属机构 -->
<c-col :span="12">
<el-form-item :label="$t('crtp.业务所属机构')" prop="crdgrp.rec.rcvbchinr">
<c-select v-model="model.crdgrp.rec.rcvbchinr" style="width:100%">
</c-select>
</el-form-item>
</c-col>
<!-- S0000033 : 账户行 -->
<!-- S0000034 : Ref. -->
<c-col :span="12">
<c-ptap
:model="model"
:isAdrblk="false"
:haveAdrLabel="true"
:requiredExtkey="true"
:isAdrVisible="false"
:argadr="{title: '账户行', grp: 'crdgrp', rol: 'acc'}"
ptytyp="C"
></c-ptap>
</c-col>
<c-col :span="12">
<el-form-item label="Drag Drop Sender" prop="crtp.accp.ptsget.sdamod.dadsnd">
<c-input v-model="model.crtp.accp.ptsget.sdamod.dadsnd"></c-input>
</el-form-item>
</c-col>
<c-col :span="12">
<el-form-item label="" prop="crtp.accp.ptsget.sdamod.seainf">
<c-input v-model="model.crtp.accp.ptsget.sdamod.seainf"></c-input>
</el-form-item>
<!-- ==================左边================ -->
<c-col :span="12" style="padding-right: 20px">
<c-col :span="24">
<el-form-item :label="$t('crtp.业务编号')" prop="crdgrp.rec.ownref">
<c-input v-model="model.crdgrp.rec.ownref" maxlength="16"></c-input>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item :label="$t('crtp.经办柜员')" prop="crtp.usr.extkey">
<c-input v-model="model.crtp.usr.extkey" maxlength="8"></c-input>
</el-form-item>
</c-col>
<!-- S0000026 : 清算币种及金额 -->
<c-col :span="24" class="custom-box-wrap">
<el-form-item :label="$t('crtp.清算币种及金额')" prop="crdgrp.cbs.max.cur">
<c-select-cur
v-model="model.crdgrp.cbs.max.cur"
style="width: 115px"
placeholder="请选择币种"
dbCode="curtxt"
disabled>
</c-select-cur>
</el-form-item>
<div class="box-3">
<el-form-item label-width="5px" prop="crdgrp.cbs.max.amt">
<c-input-currency
v-model="model.crdgrp.cbs.max.amt"
:currency="model.crdgrp.cbs.max.cur"
style="width: 100%">
</c-input-currency>
</el-form-item>
</div>
</c-col>
<!-- S0000028 : 业务种类 -->
<c-col :span="24">
<el-form-item :label="$t('crtp.业务种类')" prop="crdgrp.rec.rcvobjtyp">
<c-select dbCode="RMB122" v-model="model.crdgrp.rec.rcvobjtyp" style="width:100%">
</c-select>
</el-form-item>
</c-col>
<!-- S0000033 : 账户行 -->
<!-- S0000034 : Ref. -->
<c-col :span="24">
<c-ptap
:model="model"
:isAdrblk="false"
:haveAdrLabel="true"
:requiredExtkey="true"
:isAdrVisible="false"
:argadr="{title: '账户行', grp: 'crdgrp', rol: 'acc'}"
ptytyp="C"
></c-ptap>
</c-col>
</c-col>
<!-- ============右边================= -->
<c-col :span="12" style="padding-left: 20px">
<c-col :span="24">
<el-form-item label="清算类型" prop="crdgrp.rec.crttyp">
<c-select :code="crttyp" v-model="model.crdgrp.rec.crttyp" style="width:100%">
</c-select>
</el-form-item>
</c-col>
<!-- S0000027 : 前手付汇业务编号 -->
<c-col :span="24">
<el-form-item :label="$t('crtp.前手付汇业务编号')" prop="crdgrp.rec.msgref">
<c-input v-model="model.crdgrp.rec.msgref" maxlength="16"></c-input>
</el-form-item>
</c-col>
<!-- S0000029 : 业务所属机构 -->
<c-col :span="24">
<el-form-item :label="$t('crtp.业务所属机构')" prop="crdgrp.rec.rcvbchinr">
<c-select v-model="model.crdgrp.rec.rcvbchinr" style="width:100%">
</c-select>
</el-form-item>
</c-col>
<c-col :span="24">
<c-ptap
:model="model"
:isAdrblk="false"
:haveAdrLabel="true"
:requiredExtkey="true"
:argadr="{title: '收报行', grp: 'crdgrp', rol: 'rcv'}"
ptytyp="C"
></c-ptap>
</c-col>
</c-col>
</div>
</template>
......@@ -138,7 +100,20 @@ export default {
mixins: [Event],
data() {
return {
crttyp: [
{
label: '汇出清算',
value: '汇出清算',
},
{
label: '退汇清算',
value: '退汇清算',
},
{
label: '转汇清算',
value: '转汇清算',
},
]
}
},
methods: {},
......
<template>
<div class="eContainer">
<c-content>
<el-form :model="model" :rules="rules" ref="modelForm" label-width="150px" label-position="right" size="small" :validate-on-rule-change="false">
<c-page title="结售汇平盘确认">
<el-form
:model="model"
:rules="rules"
ref="modelForm"
label-width="150px"
label-position="right"
size="small"
:validate-on-rule-change="false"
>
<c-tabs v-model="tabVal" ref="elment" type="card" @tab-click="myTabClick">
<!--fxtfcm PD000001 Confirmation -->
<el-tab-pane label="概要" name="cnfp">
<m-cnfp :model="model" :codes="codes"/>
</el-tab-pane>
<!--fxtfcm PD000023 MT300 -->
<el-tab-pane label="MT300" name="mt300">
<m-mt300 :model="model" :codes="codes"/>
......@@ -25,7 +35,7 @@
@handleSureWarning="handleSureWarning"
ref="commonBtn"
></c-function-btn>
</c-content>
</c-page>
</div>
</template>
<script>
......
<template>
<div class="eContainer">
<c-page title="结售汇平盘确认">
<c-page title="结售汇平盘登记">
<el-form
:model="model"
:rules="rules"
......@@ -12,7 +12,7 @@
>
<c-tabs v-model="tabVal" ref="elment" type="card" @tab-click="myTabClick">
<!--fxtlop PD000001 Registration -->
<el-tab-pane label="Registration" name="regp">
<el-tab-pane label="概要" name="regp">
<m-regp :model="model" :codes="codes" />
</el-tab-pane>
<!--PD000027 -->
......
......@@ -2,6 +2,7 @@ const publicPath = require('@/config/isc-publicPath.js')
//const webscan=require("./webscan/index.js").default;
import Vue from 'vue'
import Router from 'vue-router'
import { stringifyQuery, parseQuery } from '~/utils/query'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
......@@ -18,6 +19,8 @@ import business, { docpan } from './business'
export default new Router({
mode:'history',
stringifyQuery, // 序列化query参数
parseQuery, // 反序列化query参数
base: publicPath,
routes: [
docpan,
......
import CryptoJS from 'crypto-js'
import CryptoJSCore from 'crypto-js/core'
import AES from 'crypto-js/aes'
import ZeroPadding from 'crypto-js/pad-zeropadding'
import Utf8, { parse } from 'crypto-js/enc-utf8'
import Base64 from 'crypto-js/enc-base64'
/*
* 加密 解密
*/
const keyHex = parse('1111111111111111') // 十六位数作为密钥,自行修改
const ivHex = CryptoJS.lib.WordArray.random(128 / 8) // 十六位数作为密钥偏移量 随机生成
/**
* 加密
* @param {String} key
* @returns {string}
*/
// 加密后的结果通常是一个CipherParams对象,其中包含了加密后的密文数据,而密文数据本身是一个WordArray对象。同样,在解密过程中,解密后的结果也是一个WordArray对象。
export const getEncrypt = (key) => {
try {
key = JSON.stringify(key)
} catch (e) {
console.warn(e)
}
// key需要是WordArray类型
return JSON.stringify({
encrypt: AES.encrypt(key, keyHex, {
mode: CryptoJSCore.mode.CBC,
padding: ZeroPadding,
iv: ivHex,
}).toString(),
iv: ivHex,
})
}
/**
* 加密后转base64
* @param {String}} key
*/
export const getEncryptToBase64 = (key) => {
const encryptStr = getEncrypt(key)
const wordArray = Utf8.parse(encryptStr) //转为WordArray对象
return Base64.stringify(wordArray)
}
/**
* 解密
* @param data
* @returns {string}
*/
export const getDecrypt = (data) => {
let { encrypt, iv } = JSON.parse(data)
let decrypted = AES.decrypt(
{
ciphertext: Base64.parse(encrypt),
},
keyHex,
{
mode: CryptoJSCore.mode.CBC,
padding: ZeroPadding,
iv: iv,
}
).toString(Utf8) //转换为指定编码的字符串
try {
decrypted = JSON.parse(decrypted)
} catch (e) {
console.warn(e)
}
return decrypted
}
/**
* 对base64数据解密 先解析base64,在做解密
* @param {String} data
* @returns {string}
*/
export const getDecryptByBase64 = (data) => {
// 将Base64字符串转换为WordArray
const parsedWordArray = Base64.parse(data)
// WordArray对象转换成一个UTF-8编码的字符串
const decryptStr = Utf8.stringify(parsedWordArray)
return getDecrypt(decryptStr)
}
\ No newline at end of file
import {
getEncryptToBase64 as encrypt,
getDecryptByBase64 as decrypt,
} from './encryption'
const encodeReserveRE = /[!'()*]/g
const encodeReserveReplacer = (c) => '%' + c.charCodeAt(0).toString(16) //获取该字符的 ASCII 码值,再将其转换为十六进制字符串,并在前面加上 '%' 作为替换后的结果
const commaRE = /%2C/g //英文逗号处理
const encode = (str) =>
encodeURIComponent(str)
.replace(encodeReserveRE, encodeReserveReplacer)
.replace(commaRE, ',')
const decode = decodeURIComponent
/**
* 判断字符串是否是base64
* @param { string } str
* @returns { boolean }
*/
function isBase64(str) {
// 检查字符串是否为空或仅包含空白字符
if (!str || str.trim() === '') {
return false
}
// 正则表达式匹配Base64的字符集,允许末尾有0-2个等号用于填充
const base64Pattern = /^[A-Za-z0-9+/]*={0,2}$/
// 首先检查字符串是否符合Base64的字符集规范
if (!base64Pattern.test(str)) {
return false
}
try {
return btoa(atob(str)) === str
} catch (err) {
return false
}
}
/**
* 序列化对象 并加密
* @param {Object} obj
*/
export const stringifyQuery = (obj) => {
const res = obj
? Object.keys(obj)
.map((key) => {
const val = obj[key]
if (val === null || val === undefined) {
return encode(key)
}
if (Array.isArray(val)) {
const result = []
val.forEach((val2) => {
if (val2 === null || val2 === undefined) {
result.push(encode(key))
} else {
result.push(encode(key) + '=' + encode(val2))
}
})
return result.join('&')
}
return encode(key) + '=' + encode(val)
})
.join('&')
: null
return res ? `?${encrypt(res)}` : ''
}
/**
* 解密 反序列化字符串参数
* @param {String}} query
*/
export const parseQuery = (query) => {
const res = {}
query = query.trim().replace(/^(\?|#|&)/, '')
if (!query) {
return res
}
// 解密
query = isBase64(query) ? decrypt(query) : query
query.split('&').forEach((param) => {
const parts = param.split('=')
const key = decode(parts.shift())
const val = parts.length > 0 ? decode(parts.join('')) : null
if (res[key] === undefined) {
res[key] = val
} else if (Array.isArray(res[key])) {
res[key].push(val)
} else {
// 复原数组
res[key] = [res[key], val]
}
})
return res
}
\ No newline at end of file
......@@ -102,7 +102,8 @@ export function isPubJinB(){
let role=JSON.parse(window.sessionStorage.curRole)
let roleId=role.id+"";
let parentRoleId=role.parentRoleId+"";
if (roleId==="10265" || parentRoleId==="10265" ){
console.log("aaaaaa",window.sessionStorage.curRole,"bbbbbbb",role,"ccccccccccc",roleId,"ddddddddd",parentRoleId);
if (roleId==="10265" || roleId==="1502" || roleId==="10231" || parentRoleId==="10265" ){
return true;
}
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment