Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/1.8.0-uniapp

 Conflicts:
	sql/optional/mall/mall.sql
This commit is contained in:
YunaiV
2022-09-04 21:06:28 +08:00
618 changed files with 49151 additions and 1382 deletions

View File

@ -0,0 +1,21 @@
import CryptoJS from 'crypto-js'
/**
* @word 要加密的内容
* @keyWord String 服务器随机返回的关键字
*/
export function aesEncrypt(word, keyWord = 'XwKsGlMcdPMEhR1B') {
const key = CryptoJS.enc.Utf8.parse(keyWord)
const secs = CryptoJS.enc.Utf8.parse(word)
const encrypted = CryptoJS.AES.encrypt(secs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 })
return encrypted.toString()
}
/**
* @word 要解密的内容
* @keyWord String 服务器随机返回的关键字
*/
export function aesDecrypt(word, keyWord = 'XwKsGlMcdPMEhR1B') {
const key = CryptoJS.enc.Utf8.parse(keyWord)
const decrypt = CryptoJS.AES.decrypt(word, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 })
return CryptoJS.enc.Utf8.stringify(decrypt).toString()
}

View File

@ -1,13 +1,32 @@
/**
* 将服务端返回的 fields 字符串数组,解析成 JSON 数组
* 如果指定了 variables 参数可对表单进行初始化
*
* @param fields JSON 字符串数组
* @param variables Object 表单初始值
* @returns {*[]} JSON 数组
*/
export function decodeFields(fields) {
const drawingList = []
fields.forEach(item => {
drawingList.push(JSON.parse(item))
export function decodeFields(fields, variables) {
const drawingList = (fields || []).map(json => {
const item = JSON.parse(json)
if (typeof variables === 'undefined' ) return item
const setDefault = (item, variables) => {
if (typeof variables[item.__vModel__] !== 'undefined') {
item.__config__.defaultValue = variables[item.__vModel__]
}
if (item.__config__.children && item.__config__.children.length) {
item.__config__.children.forEach(child => {
setDefault(child, variables)
})
}
}
setDefault(item, variables)
return item
})
return drawingList
}

View File

@ -185,6 +185,19 @@ export function getTenantEnable() {
return process.env.VUE_APP_TENANT_ENABLE || true;
}
/**
* 获得验证码功能是否开启
*/
export function getCaptchaEnable() {
if (process.env.VUE_APP_CAPTCHA_ENABLE === "true") {
return true;
}
if (process.env.VUE_APP_CAPTCHA_ENABLE === "false") {
return false;
}
return process.env.VUE_APP_CAPTCHA_ENABLE || true;
}
/**
* 获得文档是否开启
*/