refactor(utils): 将工具类文件从Cs前缀重命名为Kit前缀

This commit is contained in:
2026-02-02 11:12:20 +08:00
parent cc83b291cb
commit 5b457dc47f
51 changed files with 664 additions and 664 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import request from '@/utils/request' import request from '@/utils/request'
import { encrypt } from '@/utils/CsRsaUtil' import { encrypt } from '@/utils/KitRsaUtil'
/** /**
* 默认入口:add、del、edit、get * 默认入口:add、del、edit、get
+1 -1
View File
@@ -1,6 +1,6 @@
import { download, initData } from '@/api/data' import { download, initData } from '@/api/data'
import Vue from 'vue' import Vue from 'vue'
import { DownloadFile } from '@/utils/CsDomUtil' import { DownloadFile } from '@/utils/KitDomUtil'
/** /**
* CRUD配置 * CRUD配置
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -4,7 +4,7 @@
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
@@ -10,7 +10,7 @@
</template> </template>
<script> <script>
import { AddClass, RemoveClass } from '@/utils/CsDomUtil' import { AddClass, RemoveClass } from '@/utils/KitDomUtil'
export default { export default {
name: 'RightPanel', name: 'RightPanel',
@@ -7,7 +7,7 @@
<script> <script>
// doc: https://panjiachen.github.io/vue-element-admin-site/feature/component/svg-icon.html#usage // doc: https://panjiachen.github.io/vue-element-admin-site/feature/component/svg-icon.html#usage
import { IsExternal } from '@/utils/CsValidateUtil' import { IsExternal } from '@/utils/KitValidateUtil'
export default { export default {
name: 'SvgIcon', name: 'SvgIcon',
@@ -7,7 +7,7 @@
</template> </template>
<script> <script>
import { IsExternal } from '@/utils/CsValidateUtil' import { IsExternal } from '@/utils/KitValidateUtil'
export default { export default {
props: { props: {
@@ -26,7 +26,7 @@
<script> <script>
import path from 'path' import path from 'path'
import { IsExternal } from '@/utils/CsValidateUtil' import { IsExternal } from '@/utils/KitValidateUtil'
import Item from './Item' import Item from './Item'
import AppLink from './Link' import AppLink from './Link'
import FixiOSBug from './FixiOSBug' import FixiOSBug from './FixiOSBug'
+1 -1
View File
@@ -2,7 +2,7 @@ import {
initData, initData,
download download
} from '@/api/data' } from '@/api/data'
import { DownloadFile } from '@/utils/CsDomUtil' import { DownloadFile } from '@/utils/KitDomUtil'
export default { export default {
data() { data() {
@@ -1,4 +1,4 @@
import { FormatDateTimeShortStr } from '@/utils/CsUtil' import { FormatDateTimeShortStr } from '@/utils/KitUtil'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import axios from 'axios' import axios from 'axios'
@@ -1,17 +1,17 @@
import JSEncrypt from 'jsencrypt/bin/jsencrypt.min' import JSEncrypt from 'jsencrypt/bin/jsencrypt.min'
// 密钥对生成 http://web.chacuo.net/netrsakeypair // 密钥对生成 http://web.chacuo.net/netrsakeypair
const publicKey = 'MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAg975XAOL1zg5EOcSSGPIcxwx5DxcvPD2rBRQa0/o1HTF25cnsU9uSHfzP+qohkDG76kDk+1FA/cuQda4CDAmK2fWW' + const publicKey = 'MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAg975XAOL1zg5EOcSSGPIcxwx5DxcvPD2rBRQa0/o1HTF25cnsU9uSHfzP+qohkDG76kDk+1FA/cuQda4CDAmK2fWW' +
'q7KgglKd08hRkByjLuRsXu5WVApAAG15ItNM0CrXI7P47aOan+6YPU0Ni1+4WYQnwxfRYdUaKgY5G5gb3S+hx6VO1iN1KuRMBJ7y5FMh1WNJOM9bQb3X1pvaJ73drTpy1wJHAvfP80iG2+sSh0FfcOxCoRNEff' + 'q7KgglKd08hRkByjLuRsXu5WVApAAG15ItNM0CrXI7P47aOan+6YPU0Ni1+4WYQnwxfRYdUaKgY5G5gb3S+hx6VO1iN1KuRMBJ7y5FMh1WNJOM9bQb3X1pvaJ73drTpy1wJHAvfP80iG2+sSh0FfcOxCoRNEff' +
'CUsU2bYNH6dG6mXIDvo6XZStspwUfSitfgOER207uvBCCVyFlas+2Xs09yyAoJNjaWmeCPfA7uJvJrXUft/SMy8JNIXBY40vlwk4d4FE6OKOG9Wn0oRlofRKZ7NGvpUxEA5zOW6g2LsHKUUXpgOfu59M6ZHxviGM' + 'CUsU2bYNH6dG6mXIDvo6XZStspwUfSitfgOER207uvBCCVyFlas+2Xs09yyAoJNjaWmeCPfA7uJvJrXUft/SMy8JNIXBY40vlwk4d4FE6OKOG9Wn0oRlofRKZ7NGvpUxEA5zOW6g2LsHKUUXpgOfu59M6ZHxviGM' +
't26WxJiq/ifVKJE3yVgx0MVIGEFTrG+spOCVsDYMSHnVsPEUdL6g5FV2YLyqNHljBqUqwyOEfUinp7hPRxrLJDMyX6GWy7y48Djg0wyh2hXro/ygVrZ6jcSd7MUAd2lYueUKK8Bey7OzIcOJ6GveHdLzGrspbbkn' + 't26WxJiq/ifVKJE3yVgx0MVIGEFTrG+spOCVsDYMSHnVsPEUdL6g5FV2YLyqNHljBqUqwyOEfUinp7hPRxrLJDMyX6GWy7y48Djg0wyh2hXro/ygVrZ6jcSd7MUAd2lYueUKK8Bey7OzIcOJ6GveHdLzGrspbbkn' +
'DuRsbcInR5bD6l7YA4vpnLsbiOH2wbKJWXNnxRwN5KuWSpwHDHhARB8f4wWrewUKIOxcFI/eJ6ke6D52JMOKhiGeZKn+2/giHwrPGkTREe47Ose6UvTMCAwEAAQ==' 'DuRsbcInR5bD6l7YA4vpnLsbiOH2wbKJWXNnxRwN5KuWSpwHDHhARB8f4wWrewUKIOxcFI/eJ6ke6D52JMOKhiGeZKn+2/giHwrPGkTREe47Ose6UvTMCAwEAAQ=='
// 加密 // 加密
export function encrypt(txt) { export function encrypt(txt) {
const encryptor = new JSEncrypt() const encryptor = new JSEncrypt()
encryptor.setPublicKey(publicKey) // 设置公钥 encryptor.setPublicKey(publicKey) // 设置公钥
return encryptor.encrypt(txt) // 对需要加密的数据进行加密 return encryptor.encrypt(txt) // 对需要加密的数据进行加密
} }
@@ -1,387 +1,387 @@
import store from '@/store' import store from '@/store'
import dayjs from 'dayjs' import dayjs from 'dayjs'
/** /**
* 权限校验 * 权限校验
* @param value * @param value
* @returns {boolean|*} * @returns {boolean|*}
*/ */
export function CheckPermissions(value) { export function CheckPermissions(value) {
if (value && value instanceof Array && value.length > 0) { if (value && value instanceof Array && value.length > 0) {
// 拥有的权限 // 拥有的权限
const roles = store.getters && store.getters.roles const roles = store.getters && store.getters.roles
// 需要的权限 // 需要的权限
const permissionRoles = value const permissionRoles = value
return roles.some(role => { return roles.some(role => {
return permissionRoles.includes(role) return permissionRoles.includes(role)
}) })
} else { } else {
console.error(`need roles! Like v-permission="['admin','editor']"`) console.error(`need roles! Like v-permission="['admin','editor']"`)
return false return false
} }
} }
/** /**
* 字符串转数字 * 字符串转数字
* @param value * @param value
* @returns {Number|*} * @returns {Number|*}
*/ */
export function StringToNumber(value) { export function StringToNumber(value) {
try { try {
return value ? Number(value) : value return value ? Number(value) : value
} catch (e) { } catch (e) {
return value return value
} }
} }
/** /**
* 保留几位小数 * 保留几位小数
* @param num Number * @param num Number
* @param accuracy 精度 * @param accuracy 精度
* @returns {string|number} * @returns {string|number}
*/ */
export function NumberToFixed(num, accuracy) { export function NumberToFixed(num, accuracy) {
return num instanceof Number ? num.toFixed(accuracy) : num return num instanceof Number ? num.toFixed(accuracy) : num
} }
/** /**
* 浅拷贝 * 浅拷贝
* @param source 源对象 * @param source 源对象
* @param target 目标对象 * @param target 目标对象
* @returns {*} * @returns {*}
*/ */
export function CopyObject(source, target) { export function CopyObject(source, target) {
return Object.assign(target, source) return Object.assign(target, source)
} }
/** /**
* 深拷贝对象 * 深拷贝对象
* @param obj * @param obj
*/ */
export function DeepCopyObject(obj) { export function DeepCopyObject(obj) {
return JSON.parse(JSON.stringify(obj)) return JSON.parse(JSON.stringify(obj))
} }
/** /**
* 统计对象属性等于targetValue的数量 * 统计对象属性等于targetValue的数量
* @param arr 对象数组 * @param arr 对象数组
* @param propKey 属性名称 * @param propKey 属性名称
* @param targetValue 目标值 * @param targetValue 目标值
* @returns {*|number} * @returns {*|number}
*/ */
export function CountArraysObjectByPropKey(arr, propKey, targetValue) { export function CountArraysObjectByPropKey(arr, propKey, targetValue) {
if (!Array.isArray(arr)) { if (!Array.isArray(arr)) {
return 0 return 0
} }
let cnt = 0 let cnt = 0
for (const element of arr) { for (const element of arr) {
if (element.hasOwnProperty(propKey)) { if (element.hasOwnProperty(propKey)) {
// console.error('that.pipelineInstance.propKey', propKey) // console.error('that.pipelineInstance.propKey', propKey)
// console.error('that.pipelineInstance.element[propKey]', element[propKey]) // console.error('that.pipelineInstance.element[propKey]', element[propKey])
// console.error('that.pipelineInstance.targetValue', targetValue) // console.error('that.pipelineInstance.targetValue', targetValue)
if (element[propKey] === targetValue) { if (element[propKey] === targetValue) {
cnt = cnt + 1 cnt = cnt + 1
} }
} }
} }
return cnt return cnt
} }
/** /**
* 根据value获取label * 根据value获取label
* @param options / * @param options /
* @param value / * @param value /
* @returns {*} * @returns {*}
*/ */
export function GetOptionLabelByValue(options, value) { export function GetOptionLabelByValue(options, value) {
if (options instanceof Array) { if (options instanceof Array) {
const find = options.find(f => f.value === value) const find = options.find(f => f.value === value)
if (find) { if (find) {
return find.label return find.label
} }
return '' return ''
} }
} }
/** /**
* 格式化字节数字符串 * 格式化字节数字符串
* @param value * @param value
* @returns {string} * @returns {string}
* @constructor * @constructor
*/ */
export function FormatBytesStr(value) { export function FormatBytesStr(value) {
if (typeof value !== 'number' || isNaN(value) || value <= 0) { if (typeof value !== 'number' || isNaN(value) || value <= 0) {
return '0 Bytes' return '0 Bytes'
} }
const units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] const units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
const index = Math.floor(Math.log(value) / Math.log(1024)) const index = Math.floor(Math.log(value) / Math.log(1024))
const unit = units[Math.min(index, units.length - 1)] const unit = units[Math.min(index, units.length - 1)]
const result = (value / Math.pow(1024, index)).toFixed(2) const result = (value / Math.pow(1024, index)).toFixed(2)
return `${result} ${unit}` return `${result} ${unit}`
} }
/** /**
* 格式化日期字符串 * 格式化日期字符串
* @param originVal * @param originVal
* @returns {string} * @returns {string}
* @constructor * @constructor
*/ */
export function FormatDateStr(originVal) { export function FormatDateStr(originVal) {
if (originVal === undefined) { if (originVal === undefined) {
return '' return ''
} }
const dt = new Date(originVal) const dt = new Date(originVal)
const y = dt.getFullYear() const y = dt.getFullYear()
const m = (dt.getMonth() + 1 + '').padStart(2, '0') const m = (dt.getMonth() + 1 + '').padStart(2, '0')
const d = (dt.getDate() + '').padStart(2, '0') const d = (dt.getDate() + '').padStart(2, '0')
return `${y}-${m}-${d}` return `${y}-${m}-${d}`
} }
/** /**
* 格式化日期时间字符串 * 格式化日期时间字符串
* @param originVal * @param originVal
* @returns {string} * @returns {string}
* @constructor * @constructor
*/ */
export function FormatDateTimeStr(originVal) { export function FormatDateTimeStr(originVal) {
if (originVal) { if (originVal) {
return dayjs(originVal).format('YYYY-MM-DD HH:mm:ss') return dayjs(originVal).format('YYYY-MM-DD HH:mm:ss')
} }
return '' return ''
} }
/** /**
* 格式化日期时间字符串,不带分割符号 * 格式化日期时间字符串,不带分割符号
* @param originVal * @param originVal
* @returns {string} * @returns {string}
* @constructor * @constructor
*/ */
export function FormatDateTimeShortStr(originVal) { export function FormatDateTimeShortStr(originVal) {
if (originVal) { if (originVal) {
return dayjs(originVal).format('YYYYMMDDHHmmss') return dayjs(originVal).format('YYYYMMDDHHmmss')
} }
return '' return ''
} }
/** /**
* 格式化表格行列中的日期时间字符串 * 格式化表格行列中的日期时间字符串
* @param row * @param row
* @param column * @param column
* @param cellValue * @param cellValue
* @param index * @param index
* @returns {string} * @returns {string}
* @constructor * @constructor
*/ */
export function FormatRowDateTimeStr(row, column, cellValue, index) { export function FormatRowDateTimeStr(row, column, cellValue, index) {
if (cellValue === undefined) { if (cellValue === undefined) {
return '' return ''
} }
const dt = new Date(cellValue) const dt = new Date(cellValue)
const y = dt.getFullYear() const y = dt.getFullYear()
const m = (dt.getMonth() + 1 + '').padStart(2, '0') const m = (dt.getMonth() + 1 + '').padStart(2, '0')
const d = (dt.getDate() + '').padStart(2, '0') const d = (dt.getDate() + '').padStart(2, '0')
const hh = (dt.getHours() + '').padStart(2, '0') const hh = (dt.getHours() + '').padStart(2, '0')
const mm = (dt.getMinutes() + '').padStart(2, '0') const mm = (dt.getMinutes() + '').padStart(2, '0')
const ss = (dt.getSeconds() + '').padStart(2, '0') const ss = (dt.getSeconds() + '').padStart(2, '0')
return `${y}-${m}-${d} ${hh}:${mm}:${ss}` return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
} }
/** /**
* 获取变量类型 * 获取变量类型
* @param value * @param value
* @returns {string} * @returns {string}
* @constructor * @constructor
*/ */
export function GetValueType(value) { export function GetValueType(value) {
return Object.prototype.toString.call(value).slice(8, -1).toLowerCase() return Object.prototype.toString.call(value).slice(8, -1).toLowerCase()
} }
/** /**
* 数组去重 * 数组去重
* @param arr * @param arr
* @returns {any[]} * @returns {any[]}
* @constructor * @constructor
*/ */
export function UniqueArrays(arr) { export function UniqueArrays(arr) {
return [...new Set(arr)] return [...new Set(arr)]
} }
/** /**
* 手机号掩码 * 手机号掩码
* @param mobile * @param mobile
* @returns {*|string} * @returns {*|string}
* @constructor * @constructor
*/ */
export function MaskMobile(mobile) { export function MaskMobile(mobile) {
if (mobile.length > 7) { if (mobile.length > 7) {
return mobile.substr(0, 3) + '****' + mobile.substr(7) return mobile.substr(0, 3) + '****' + mobile.substr(7)
} }
return mobile return mobile
} }
/** /**
* 邮箱掩码 * 邮箱掩码
* @param email * @param email
* @returns {string} * @returns {string}
* @constructor * @constructor
*/ */
export function MaskEmail(email) { export function MaskEmail(email) {
if (String(email).indexOf('@') > 0) { if (String(email).indexOf('@') > 0) {
const str = email.split('@') const str = email.split('@')
let _s = '' let _s = ''
if (str[0].length > 3) { if (str[0].length > 3) {
for (let i = 0; i < str[0].length - 3; i++) { for (let i = 0; i < str[0].length - 3; i++) {
_s += '*' _s += '*'
} }
} }
return str[0].substr(0, 3) + _s + '@' + str[1] return str[0].substr(0, 3) + _s + '@' + str[1]
} }
return email return email
} }
/** /**
* 获取Url中的查询参数 * 获取Url中的查询参数
* @param {string} url * @param {string} url
* @returns {Object} * @returns {Object}
*/ */
export function GetUrlQueryArgs(url) { export function GetUrlQueryArgs(url) {
url = url == null ? window.location.href : url url = url == null ? window.location.href : url
const search = url.substring(url.lastIndexOf('?') + 1) const search = url.substring(url.lastIndexOf('?') + 1)
const obj = {} const obj = {}
const reg = /([^?&=]+)=([^?&=]*)/g const reg = /([^?&=]+)=([^?&=]*)/g
search.replace(reg, (rs, $1, $2) => { search.replace(reg, (rs, $1, $2) => {
const name = decodeURIComponent($1) const name = decodeURIComponent($1)
let val = decodeURIComponent($2) let val = decodeURIComponent($2)
val = String(val) val = String(val)
obj[name] = val obj[name] = val
return rs return rs
}) })
return obj return obj
} }
/** /**
* 将Url中的查询参数转成对象 * 将Url中的查询参数转成对象
* @param {string} url * @param {string} url
* @returns {Object} * @returns {Object}
*/ */
export function ParseUrlQueryArgsToObject(url) { export function ParseUrlQueryArgsToObject(url) {
const search = url.split('?')[1] const search = url.split('?')[1]
if (!search) { if (!search) {
return {} return {}
} }
return JSON.parse( return JSON.parse(
'{"' + '{"' +
decodeURIComponent(search) decodeURIComponent(search)
.replace(/"/g, '\\"') .replace(/"/g, '\\"')
.replace(/&/g, '","') .replace(/&/g, '","')
.replace(/=/g, '":"') .replace(/=/g, '":"')
.replace(/\+/g, ' ') + .replace(/\+/g, ' ') +
'"}' '"}'
) )
} }
/** /**
* 合并两个属性不一致的对象 * 合并两个属性不一致的对象
* @param {Object} target * @param {Object} target
* @param {(Object|Array)} source * @param {(Object|Array)} source
* @returns {Object} * @returns {Object}
*/ */
export function MergeObject(target, source) { export function MergeObject(target, source) {
if (typeof target !== 'object') { if (typeof target !== 'object') {
target = {} target = {}
} }
if (Array.isArray(source)) { if (Array.isArray(source)) {
return source.slice() return source.slice()
} }
Object.keys(source).forEach(property => { Object.keys(source).forEach(property => {
const sourceProperty = source[property] const sourceProperty = source[property]
if (typeof sourceProperty === 'object') { if (typeof sourceProperty === 'object') {
target[property] = MergeObject(target[property], sourceProperty) target[property] = MergeObject(target[property], sourceProperty)
} else { } else {
target[property] = sourceProperty target[property] = sourceProperty
} }
}) })
return target return target
} }
/** /**
* 防抖动 * 防抖动
* @param {Function} func * @param {Function} func
* @param {number} wait * @param {number} wait
* @param {boolean} immediate * @param {boolean} immediate
* @return {*} * @return {*}
*/ */
export function DeBounce(func, wait, immediate = false) { export function DeBounce(func, wait, immediate = false) {
let timeout, args, context, timestamp, result let timeout, args, context, timestamp, result
const later = function() { const later = function() {
// 据上一次触发时间间隔 // 据上一次触发时间间隔
const last = +new Date() - timestamp const last = +new Date() - timestamp
// 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
if (last < wait && last > 0) { if (last < wait && last > 0) {
timeout = setTimeout(later, wait - last) timeout = setTimeout(later, wait - last)
} else { } else {
timeout = null timeout = null
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
if (!immediate) { if (!immediate) {
result = func.apply(context, args) result = func.apply(context, args)
context = args = null context = args = null
} }
} }
} }
return function(...args) { return function(...args) {
context = this context = this
timestamp = +new Date() timestamp = +new Date()
const callNow = immediate && !timeout const callNow = immediate && !timeout
// 如果延时不存在,重新设定延时 // 如果延时不存在,重新设定延时
if (!timeout) timeout = setTimeout(later, wait) if (!timeout) timeout = setTimeout(later, wait)
if (callNow) { if (callNow) {
result = func.apply(context, args) result = func.apply(context, args)
context = args = null context = args = null
} }
return result return result
} }
} }
/** /**
* 格式化表格行列中的环境字符串 * 格式化表格行列中的环境字符串
* @param row * @param row
* @param column * @param column
* @param cellValue * @param cellValue
* @param index * @param index
* @returns {string} * @returns {string}
* @constructor * @constructor
*/ */
export function FormatRowEnvStr(row, column, cellValue, index) { export function FormatRowEnvStr(row, column, cellValue, index) {
if (cellValue === undefined) { if (cellValue === undefined) {
return '' return ''
} }
const data = { const data = {
daily: '日常环境', daily: '日常环境',
stage: '预发环境', stage: '预发环境',
gray: '灰度环境', gray: '灰度环境',
production: '生产环境' production: '生产环境'
} }
const title = data[cellValue] const title = data[cellValue]
if (title) { if (title) {
return title return title
} }
return '' return ''
} }
export function IsEmpty(obj) { export function IsEmpty(obj) {
if (obj === undefined) { if (obj === undefined) {
// console.error('is undefined') // console.error('is undefined')
return true return true
} }
if (obj === '') { if (obj === '') {
// console.error('is ""') // console.error('is ""')
return true return true
} }
if (obj === 'undefined') { if (obj === 'undefined') {
// console.error('is "undefined"') // console.error('is "undefined"')
return true return true
} }
// console.error('is null') // console.error('is null')
return obj === null return obj === null
} }
@@ -1,171 +1,171 @@
/** /**
* 是否链接 * 是否链接
* @param {string} path * @param {string} path
* @returns {Boolean} * @returns {Boolean}
*/ */
export function IsExternal(path) { export function IsExternal(path) {
return /^(https?:|mailto:|tel:)/.test(path) return /^(https?:|mailto:|tel:)/.test(path)
} }
// /** // /**
// * 是否有效用户名 // * 是否有效用户名
// * @param {string} str // * @param {string} str
// * @returns {Boolean} // * @returns {Boolean}
// */ // */
// export function IsValidUsername(str) { // export function IsValidUsername(str) {
// const validMap = ['admin', 'editor'] // const validMap = ['admin', 'editor']
// return validMap.indexOf(str.trim()) >= 0 // return validMap.indexOf(str.trim()) >= 0
// } // }
/** /**
* 是否有效链接 * 是否有效链接
* @param {string} url * @param {string} url
* @returns {Boolean} * @returns {Boolean}
*/ */
export function IsValidURL(url) { export function IsValidURL(url) {
const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/ const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
return reg.test(url) return reg.test(url)
} }
/** /**
* 是否小写字母 * 是否小写字母
* @param {string} str * @param {string} str
* @returns {Boolean} * @returns {Boolean}
*/ */
export function IsValidLowerCaseLetter(str) { export function IsValidLowerCaseLetter(str) {
const reg = /^[a-z]+$/ const reg = /^[a-z]+$/
return reg.test(str) return reg.test(str)
} }
/** /**
* 是否大写字母 * 是否大写字母
* @param {string} str * @param {string} str
* @returns {Boolean} * @returns {Boolean}
*/ */
export function IsValidUpperCase(str) { export function IsValidUpperCase(str) {
const reg = /^[A-Z]+$/ const reg = /^[A-Z]+$/
return reg.test(str) return reg.test(str)
} }
/** /**
* 是否包含大、小写字母 * 是否包含大、小写字母
* @param {string} str * @param {string} str
* @returns {Boolean} * @returns {Boolean}
*/ */
export function IsValidLetter(str) { export function IsValidLetter(str) {
const reg = /^[A-Za-z]+$/ const reg = /^[A-Za-z]+$/
return reg.test(str) return reg.test(str)
} }
/** /**
* 是否邮箱 * 是否邮箱
* @param {string} email * @param {string} email
* @returns {Boolean} * @returns {Boolean}
*/ */
export function IsValidEmail(email) { export function IsValidEmail(email) {
const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
return reg.test(email) return reg.test(email)
} }
// /** // /**
// * 是否手机号 // * 是否手机号
// * @param phone // * @param phone
// * @returns {boolean} // * @returns {boolean}
// * @constructor // * @constructor
// */ // */
// export function IsValidPhone(phone) { // export function IsValidPhone(phone) {
// const reg = /^1([38][0-9]|4[014-9]|[59][0-35-9]|6[2567]|7[0-8])\d{8}$/ // const reg = /^1([38][0-9]|4[014-9]|[59][0-35-9]|6[2567]|7[0-8])\d{8}$/
// return reg.test(phone) // return reg.test(phone)
// } // }
/** /**
* 是否是字符串 * 是否是字符串
* @param {string} str * @param {string} str
* @returns {Boolean} * @returns {Boolean}
*/ */
export function IsString(str) { export function IsString(str) {
return typeof str === 'string' || str instanceof String return typeof str === 'string' || str instanceof String
} }
/** /**
* 是否数组 * 是否数组
* @param {Array} arg * @param {Array} arg
* @returns {Boolean} * @returns {Boolean}
*/ */
export function IsArray(arg) { export function IsArray(arg) {
if (typeof Array.isArray === 'undefined') { if (typeof Array.isArray === 'undefined') {
return Object.prototype.toString.call(arg) === '[object Array]' return Object.prototype.toString.call(arg) === '[object Array]'
} }
return Array.isArray(arg) return Array.isArray(arg)
} }
/** /**
* 是否合法IP地址 * 是否合法IP地址
* @param rule * @param rule
* @param value * @param value
* @param callback * @param callback
*/ */
export function IsValidIP(rule, value, callback) { export function IsValidIP(rule, value, callback) {
if (value === '' || value === undefined || value == null) { if (value === '' || value === undefined || value == null) {
callback() callback()
} else { } else {
const reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/ const reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
if ((!reg.test(value)) && value !== '') { if ((!reg.test(value)) && value !== '') {
callback(new Error('请输入正确的IP地址')) callback(new Error('请输入正确的IP地址'))
} else { } else {
callback() callback()
} }
} }
} }
/* 是否手机号码或者固话*/ /* 是否手机号码或者固话*/
export function IsValidPhoneTwo(rule, value, callback) { export function IsValidPhoneTwo(rule, value, callback) {
const reg = /^((0\d{2,3}-\d{7,8})|(1([38][0-9]|4[014-9]|[59][0-35-9]|6[2567]|7[0-8])\d{8}))$/ const reg = /^((0\d{2,3}-\d{7,8})|(1([38][0-9]|4[014-9]|[59][0-35-9]|6[2567]|7[0-8])\d{8}))$/
if (value === '' || value === undefined || value == null) { if (value === '' || value === undefined || value == null) {
callback() callback()
} else { } else {
if ((!reg.test(value)) && value !== '') { if ((!reg.test(value)) && value !== '') {
callback(new Error('请输入正确的电话号码或者固话号码')) callback(new Error('请输入正确的电话号码或者固话号码'))
} else { } else {
callback() callback()
} }
} }
} }
/* 是否固话*/ /* 是否固话*/
export function IsValidTelephone(rule, value, callback) { export function IsValidTelephone(rule, value, callback) {
const reg = /0\d{2}-\d{7,8}/ const reg = /0\d{2}-\d{7,8}/
if (value === '' || value === undefined || value == null) { if (value === '' || value === undefined || value == null) {
callback() callback()
} else { } else {
if ((!reg.test(value)) && value !== '') { if ((!reg.test(value)) && value !== '') {
callback(new Error('请输入正确的固话(格式:区号+号码,如010-1234567)')) callback(new Error('请输入正确的固话(格式:区号+号码,如010-1234567)'))
} else { } else {
callback() callback()
} }
} }
} }
/* 是否手机号码*/ /* 是否手机号码*/
export function IsValidPhone(value) { export function IsValidPhone(value) {
const reg = /^1([38][0-9]|4[014-9]|[59][0-35-9]|6[2567]|7[0-8])\d{8}$/ const reg = /^1([38][0-9]|4[014-9]|[59][0-35-9]|6[2567]|7[0-8])\d{8}$/
if (value === '' || value === undefined || value == null) { if (value === '' || value === undefined || value == null) {
return false return false
} else { } else {
return !((!reg.test(value)) && value !== '') return !((!reg.test(value)) && value !== '')
} }
} }
/* 是否身份证号码*/ /* 是否身份证号码*/
export function IsValidIdNumber(rule, value, callback) { export function IsValidIdNumber(rule, value, callback) {
const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/ const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
if (value === '' || value === undefined || value == null) { if (value === '' || value === undefined || value == null) {
callback() callback()
} else { } else {
if ((!reg.test(value)) && value !== '') { if ((!reg.test(value)) && value !== '') {
callback(new Error('请输入正确的身份证号码')) callback(new Error('请输入正确的身份证号码'))
} else { } else {
callback() callback()
} }
} }
} }
@@ -1,41 +1,41 @@
import store from '@/store' import store from '@/store'
/** /**
* WebSocket客户端 * WebSocket客户端
*/ */
function CsWsClient(sid) { function KitWsClient(sid) {
this.wsUri = store.getters && store.getters.websocketApi.replace('{sid}', sid) this.wsUri = store.getters && store.getters.websocketApi.replace('{sid}', sid)
this.client = null this.client = null
/** /**
* 初始化WebSocket连接 * 初始化WebSocket连接
* @param handleError -> function (e) { e是异常本身 } * @param handleError -> function (e) { e是异常本身 }
* @param handleMessage -> function (e) { e.data是message } * @param handleMessage -> function (e) { e.data是message }
*/ */
this.connect = function(handleError, handleMessage) { this.connect = function(handleError, handleMessage) {
this.client = new WebSocket(this.wsUri) this.client = new WebSocket(this.wsUri)
// 连接发生错误 // 连接发生错误
this.client.onerror = handleError this.client.onerror = handleError
// 收到消息 // 收到消息
this.client.onmessage = handleMessage this.client.onmessage = handleMessage
return this return this
} }
/** /**
* 发送客户端数据 * 发送客户端数据
* @param data 客户端数据 * @param data 客户端数据
*/ */
this.sendData = function(data) { this.sendData = function(data) {
this.client.send(JSON.stringify(data)) this.client.send(JSON.stringify(data))
} }
/** /**
* 用于关闭ws连接 * 用于关闭ws连接
*/ */
this.close = function() { this.close = function() {
console.info('关闭连接') console.info('关闭连接')
if (this.client.readyState === 1) { if (this.client.readyState === 1) {
this.sendData([{}]) this.sendData([{}])
this.client.close() this.client.close()
} }
} }
} }
export default CsWsClient export default KitWsClient
@@ -3,7 +3,7 @@ import Vue from 'vue'
/** /**
* 全屏锁定加载动画 * 全屏锁定加载动画
*/ */
// export default function CsLoading() { // export default function KitLoading() {
// this.instance = null // this.instance = null
// this.show = function() { // this.show = function() {
// this.instance = Vue.prototype.$loading({ // this.instance = Vue.prototype.$loading({
@@ -20,7 +20,7 @@ import Vue from 'vue'
// } // }
// } // }
export default class CsLoading { export default class KitLoading {
constructor() { constructor() {
this.instance = null this.instance = null
} }
+1 -1
View File
@@ -19,7 +19,7 @@ service.interceptors.request.use(
// 让每个请求携带自定义token 请根据实际情况自行修改 // 让每个请求携带自定义token 请根据实际情况自行修改
config.headers['Authorization'] = getToken() config.headers['Authorization'] = getToken()
} }
config.headers['Content-Type'] = 'application/json' config.headers['Content-Type'] = 'application/json;charset=utf-8'
return config return config
}, },
error => { error => {
@@ -11,7 +11,7 @@
</el-card> </el-card>
</template> </template>
<script> <script>
import CsWsClient from '@/utils/CsWsClient' import KitWsClient from '@/utils/KitWsClient'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
@@ -36,7 +36,7 @@ export default {
onConnectClick() { onConnectClick() {
const that = this const that = this
// console.error('userInfo', that.user) // console.error('userInfo', that.user)
that.client = new CsWsClient(that.user.username) that.client = new KitWsClient(that.user.username)
that.client.connect(function(event) { that.client.connect(function(event) {
console.info('=============== MyWebSocket:event', event) console.info('=============== MyWebSocket:event', event)
}, function(msgEvent) { }, function(msgEvent) {
@@ -25,7 +25,7 @@
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import CsMessage from '@/utils/elementui/CsMessage' import CsMessage from '@/utils/elementui/KitMessage'
export default { export default {
name: 'CuteFileUpload', name: 'CuteFileUpload',
@@ -23,7 +23,7 @@
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import CsMessage from '@/utils/elementui/CsMessage' import CsMessage from '@/utils/elementui/KitMessage'
export default { export default {
name: 'CuteFileUpload', name: 'CuteFileUpload',
@@ -26,7 +26,7 @@
<script> <script>
import { listMetadata } from '@/api/application/cute-product-line-select' import { listMetadata } from '@/api/application/cute-product-line-select'
import CsMessage from '@/utils/elementui/CsMessage' import CsMessage from '@/utils/elementui/KitMessage'
export default { export default {
name: 'CuteProductLineSelect', name: 'CuteProductLineSelect',
@@ -18,7 +18,7 @@
<script> <script>
import { listMetadata } from '@/api/application/cute-product-line-select-pro' import { listMetadata } from '@/api/application/cute-product-line-select-pro'
import CsMessage from '@/utils/elementui/CsMessage' import CsMessage from '@/utils/elementui/KitMessage'
export default { export default {
name: 'CuteProductLineSelectPro', name: 'CuteProductLineSelectPro',
@@ -29,7 +29,7 @@ import 'codemirror/mode/ruby/ruby'
import 'codemirror/mode/sql/sql' import 'codemirror/mode/sql/sql'
import 'codemirror/mode/vue/vue' import 'codemirror/mode/vue/vue'
import 'codemirror/mode/xml/xml' import 'codemirror/mode/xml/xml'
import CsMessage from '@/utils/elementui/CsMessage' import CsMessage from '@/utils/elementui/KitMessage'
const SupportModeList = ['yaml', 'java', 'go', 'swift', 'dockerfile', 'groovy', 'lua', 'perl', 'python', 'ruby', 'sql', 'xml', 'vue'] const SupportModeList = ['yaml', 'java', 'go', 'swift', 'dockerfile', 'groovy', 'lua', 'perl', 'python', 'ruby', 'sql', 'xml', 'vue']
export default { export default {
@@ -25,7 +25,7 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { mavonEditor } from 'mavon-editor' import { mavonEditor } from 'mavon-editor'
import 'mavon-editor/dist/css/index.css' import 'mavon-editor/dist/css/index.css'
import { UploadFile } from '@/utils/CsDomUtil' import { UploadFile } from '@/utils/KitDomUtil'
const dynamicHeight = 160 const dynamicHeight = 160
export default { export default {
@@ -32,8 +32,8 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import '@wangeditor/editor/dist/css/style.css' import '@wangeditor/editor/dist/css/style.css'
import { Editor, Toolbar } from '@wangeditor/editor-for-vue' import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { UploadFile } from '@/utils/CsDomUtil' import { UploadFile } from '@/utils/KitDomUtil'
import CsMessage from '@/utils/elementui/CsMessage' import CsMessage from '@/utils/elementui/KitMessage'
export default { export default {
name: 'CuteRichTextEditor', name: 'CuteRichTextEditor',
@@ -25,8 +25,8 @@
<script> <script>
import CsMessage from '@/utils/elementui/CsMessage' import CsMessage from '@/utils/elementui/KitMessage'
import { FormatDateTimeShortStr } from '@/utils/CsUtil' import { FormatDateTimeShortStr } from '@/utils/KitUtil'
import html2canvas from 'html2canvas' import html2canvas from 'html2canvas'
export default { export default {
@@ -54,7 +54,7 @@
<script> <script>
import DictService from '@/api/system/dict' import DictService from '@/api/system/dict'
import CuteDragTable from '@/views/components/dev/CuteDragTable.vue' import CuteDragTable from '@/views/components/dev/CuteDragTable.vue'
import { FormatRowDateTimeStr } from '@/utils/CsUtil' import { FormatRowDateTimeStr } from '@/utils/KitUtil'
export default { export default {
name: 'CuteDragTableDemo', name: 'CuteDragTableDemo',
@@ -10,7 +10,7 @@
<script> <script>
import Clipboard from 'clipboard' import Clipboard from 'clipboard'
import CuteOneKeyCopy from '@/views/components/dev/CuteOneKeyCopy' import CuteOneKeyCopy from '@/views/components/dev/CuteOneKeyCopy'
import CsMessage from '@/utils/elementui/CsMessage' import CsMessage from '@/utils/elementui/KitMessage'
export default { export default {
components: { CuteOneKeyCopy }, components: { CuteOneKeyCopy },
@@ -108,7 +108,7 @@ import CuteSimpleTable from '@/views/components/dev/CuteSimpleTable'
import DictService from '@/api/system/dict' import DictService from '@/api/system/dict'
import CuteFormDialog from '@/views/components/dev/CuteFormDialog' import CuteFormDialog from '@/views/components/dev/CuteFormDialog'
import CuteFormDrawer from '@/views/components/dev/CuteFormDrawer' import CuteFormDrawer from '@/views/components/dev/CuteFormDrawer'
import { FormatRowDateTimeStr } from '@/utils/CsUtil' import { FormatRowDateTimeStr } from '@/utils/KitUtil'
import CuteButton from '@/views/components/dev/CuteButton.vue' import CuteButton from '@/views/components/dev/CuteButton.vue'
import CuteTransfer from '@/views/components/dev/CuteTransfer.vue' import CuteTransfer from '@/views/components/dev/CuteTransfer.vue'
@@ -1,4 +1,4 @@
import { DeBounce } from '@/utils/CsUtil' import { DeBounce } from '@/utils/KitUtil'
export default { export default {
data() { data() {
+1 -1
View File
@@ -69,7 +69,7 @@
</template> </template>
<script> <script>
import { encrypt } from '@/utils/CsRsaUtil' import { encrypt } from '@/utils/KitRsaUtil'
import Config from '@/settings' import Config from '@/settings'
import { getCodeImg } from '@/api/login' import { getCodeImg } from '@/api/login'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
@@ -24,7 +24,7 @@
import { send } from '@/api/system/email' import { send } from '@/api/system/email'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import E from 'wangeditor' import E from 'wangeditor'
import { UploadFile } from '@/utils/CsDomUtil' import { UploadFile } from '@/utils/KitDomUtil'
export default { export default {
name: 'Index', name: 'Index',
@@ -216,7 +216,7 @@ import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation' import udOperation from '@crud/UD.operation'
import DateRangePicker from '@/components/DateRangePicker' import DateRangePicker from '@/components/DateRangePicker'
import CsMessage from '@/utils/elementui/CsMessage' import CsMessage from '@/utils/elementui/KitMessage'
// crud交由presenter持有 // crud交由presenter持有
const defaultForm = { const defaultForm = {
@@ -101,7 +101,7 @@ import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker' import DateRangePicker from '@/components/DateRangePicker'
import Clipboard from 'clipboard' import Clipboard from 'clipboard'
import CsMessage from '@/utils/elementui/CsMessage' import CsMessage from '@/utils/elementui/KitMessage'
const defaultForm = { id: null } const defaultForm = { id: null }
export default { export default {
@@ -149,7 +149,7 @@ import updatePass from './center/updatePass'
import updateEmail from './center/updateEmail' import updateEmail from './center/updateEmail'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import store from '@/store' import store from '@/store'
import { IsValidPhone } from '@/utils/CsValidateUtil' import { IsValidPhone } from '@/utils/KitValidateUtil'
import crud from '@/mixins/crud' import crud from '@/mixins/crud'
import { updateUserCenterInfoById } from '@/api/system/user' import { updateUserCenterInfoById } from '@/api/system/user'
import Avatar from '@/assets/images/avatar.png' import Avatar from '@/assets/images/avatar.png'
@@ -34,7 +34,7 @@
<script> <script>
import store from '@/store' import store from '@/store'
import { IsValidEmail } from '@/utils/CsValidateUtil' import { IsValidEmail } from '@/utils/KitValidateUtil'
import { updateUserEmailByUsername } from '@/api/system/user' import { updateUserEmailByUsername } from '@/api/system/user'
import { sendResetEmailCode } from '@/api/system/code' import { sendResetEmailCode } from '@/api/system/code'
@@ -195,7 +195,7 @@
<script> <script>
import crudUser from '@/api/system/user' import crudUser from '@/api/system/user'
import { IsValidPhone } from '@/utils/CsValidateUtil' import { IsValidPhone } from '@/utils/KitValidateUtil'
import { searchDept, searchDeptTree } from '@/api/system/dept' import { searchDept, searchDeptTree } from '@/api/system/dept'
import { getCurrentUserRoleLevel, listAllRole } from '@/api/system/role' import { getCurrentUserRoleLevel, listAllRole } from '@/api/system/role'
import { searchJob } from '@/api/system/job' import { searchJob } from '@/api/system/job'