工作流表单+模型代码提交

This commit is contained in:
2024-05-09 14:18:39 +08:00
parent eeef608ccd
commit 06611f527a
266 changed files with 18227 additions and 22039 deletions

View File

@@ -0,0 +1,28 @@
const config: {
base_url: string
result_code: number | string
default_headers: AxiosHeaders
request_timeout: number
} = {
/**
* api请求基础路径
*/
base_url: import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL,
/**
* 接口成功返回状态码
*/
result_code: 200,
/**
* 接口请求超时时间
*/
request_timeout: 30000,
/**
* 默认接口请求类型
* 可选值application/x-www-form-urlencoded multipart/form-data
*/
default_headers: 'application/json'
}
export { config }

View File

@@ -0,0 +1,6 @@
export default {
'401': '认证失败,无法访问系统资源',
'403': '当前操作没有权限',
'404': '访问资源不存在',
default: '系统未知错误,请反馈给管理员'
}

51
src/config/axios/index.ts Normal file
View File

@@ -0,0 +1,51 @@
import { service } from './service'
import { config } from './config'
const { default_headers } = config
const request = (option: any) => {
const { url, method, params, data, headersType, responseType, ...config } = option
return service({
url: url,
method,
params,
data,
...config,
responseType: responseType,
headers: {
'Content-Type': headersType || default_headers
}
})
}
export default {
get: async <T = any>(option: any) => {
const res = await request({ method: 'GET', ...option })
return res.data as unknown as T
},
post: async <T = any>(option: any) => {
const res = await request({ method: 'POST', ...option })
return res.data as unknown as T
},
postOriginal: async (option: any) => {
const res = await request({ method: 'POST', ...option })
return res
},
delete: async <T = any>(option: any) => {
const res = await request({ method: 'DELETE', ...option })
return res.data as unknown as T
},
put: async <T = any>(option: any) => {
const res = await request({ method: 'PUT', ...option })
return res.data as unknown as T
},
download: async <T = any>(option: any) => {
const res = await request({ method: 'GET', responseType: 'blob', ...option })
return res as unknown as Promise<T>
},
upload: async <T = any>(option: any) => {
option.headersType = 'multipart/form-data'
const res = await request({ method: 'POST', ...option })
return res as unknown as Promise<T>
}
}

228
src/config/axios/service.ts Normal file
View File

@@ -0,0 +1,228 @@
import axios, {
AxiosError,
AxiosInstance,
AxiosRequestHeaders,
AxiosResponse,
InternalAxiosRequestConfig
} from 'axios'
import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
import qs from 'qs'
import { config } from '@/config/axios/config'
import { getAccessToken, getRefreshToken, getTenantId, removeToken, setToken } from '@/utils/auth'
import errorCode from './errorCode'
import { deleteUserCache } from '@/hooks/web/useCache'
const tenantEnable = import.meta.env.VITE_APP_TENANT_ENABLE
const { result_code, base_url, request_timeout } = config
// 需要忽略的提示。忽略后,自动 Promise.reject('error')
const ignoreMsgs = [
'无效的刷新令牌', // 刷新令牌被删除时,不用提示
'刷新令牌已过期' // 使用刷新令牌,刷新获取新的访问令牌时,结果因为过期失败,此时需要忽略。否则,会导致继续 401无法跳转到登出界面
]
// 是否显示重新登录
export const isRelogin = { show: false }
// Axios 无感知刷新令牌,参考 https://www.dashingdog.cn/article/11 与 https://segmentfault.com/a/1190000020210980 实现
// 请求队列
let requestList: any[] = []
// 是否正在刷新中
let isRefreshToken = false
// 请求白名单无须token的接口
const whiteList: string[] = ['/login', '/refresh-token']
// 创建axios实例
const service: AxiosInstance = axios.create({
baseURL: base_url, // api 的 base_url
timeout: request_timeout, // 请求超时时间
withCredentials: false // 禁用 Cookie 等信息
})
// request拦截器
service.interceptors.request.use(
(config: InternalAxiosRequestConfig) => {
// 是否需要设置 token
let isToken = (config!.headers || {}).isToken === false
whiteList.some((v) => {
if (config.url) {
config.url.indexOf(v) > -1
return (isToken = false)
}
})
if (getAccessToken() && !isToken) {
;(config as Recordable).headers.Authorization = 'Bearer ' + getAccessToken() // 让每个请求携带自定义token
}
// 设置租户
if (tenantEnable && tenantEnable === 'true') {
const tenantId = getTenantId()
if (tenantId) (config as Recordable).headers['tenant-id'] = tenantId
}
const params = config.params || {}
const data = config.data || false
if (
config.method?.toUpperCase() === 'POST' &&
(config.headers as AxiosRequestHeaders)['Content-Type'] ===
'application/x-www-form-urlencoded'
) {
config.data = qs.stringify(data)
}
// get参数编码
if (config.method?.toUpperCase() === 'GET' && params) {
config.params = {}
const paramsStr = qs.stringify(params, { allowDots: true })
if (paramsStr) {
config.url = config.url + '?' + paramsStr
}
}
return config
},
(error: AxiosError) => {
// Do something with request error
console.log(error) // for debug
Promise.reject(error)
}
)
// response 拦截器
service.interceptors.response.use(
async (response: AxiosResponse<any>) => {
let { data } = response
const config = response.config
if (!data) {
// 返回“[HTTP]请求没有返回值”;
throw new Error()
}
const { t } = useI18n()
// 未设置状态码则默认成功状态
// 二进制数据则直接返回,例如说 Excel 导出
if (
response.request.responseType === 'blob' ||
response.request.responseType === 'arraybuffer'
) {
// 注意:如果导出的响应为 json说明可能失败了不直接返回进行下载
if (response.data.type !== 'application/json') {
return response.data
}
data = await new Response(response.data).json()
}
const code = data.code || result_code
// 获取错误信息
const msg = data.msg || errorCode[code] || errorCode['default']
if (ignoreMsgs.indexOf(msg) !== -1) {
// 如果是忽略的错误码,直接返回 msg 异常
return Promise.reject(msg)
} else if (code === 401) {
// 如果未认证,并且未进行刷新令牌,说明可能是访问令牌过期了
if (!isRefreshToken) {
isRefreshToken = true
// 1. 如果获取不到刷新令牌,则只能执行登出操作
if (!getRefreshToken()) {
return handleAuthorized()
}
// 2. 进行刷新访问令牌
try {
const refreshTokenRes = await refreshToken()
// 2.1 刷新成功,则回放队列的请求 + 当前请求
setToken((await refreshTokenRes).data.data)
config.headers!.Authorization = 'Bearer ' + getAccessToken()
requestList.forEach((cb: any) => {
cb()
})
requestList = []
return service(config)
} catch (e) {
// 为什么需要 catch 异常呢?刷新失败时,请求因为 Promise.reject 触发异常。
// 2.2 刷新失败,只回放队列的请求
requestList.forEach((cb: any) => {
cb()
})
// 提示是否要登出。即不回放当前请求!不然会形成递归
return handleAuthorized()
} finally {
requestList = []
isRefreshToken = false
}
} else {
// 添加到队列,等待刷新获取到新的令牌
return new Promise((resolve) => {
requestList.push(() => {
config.headers!.Authorization = 'Bearer ' + getAccessToken() // 让每个请求携带自定义token 请根据实际情况自行修改
resolve(service(config))
})
})
}
} else if (code === 500) {
ElMessage.error(t('sys.api.errMsg500'))
return Promise.reject(new Error(msg))
} else if (code === 901) {
ElMessage.error({
offset: 300,
dangerouslyUseHTMLString: true,
message:
'<div>' +
t('sys.api.errMsg901') +
'</div>' +
'<div> &nbsp; </div>' +
'<div>参考 https://doc.iocoder.cn/ 教程</div>' +
'<div> &nbsp; </div>' +
'<div>5 分钟搭建本地环境</div>'
})
return Promise.reject(new Error(msg))
} else if (code !== 200) {
if (msg === '无效的刷新令牌') {
// hard coding忽略这个提示直接登出
console.log(msg)
} else {
ElNotification.error({ title: msg })
}
return Promise.reject('error')
} else {
return data
}
},
(error: AxiosError) => {
console.log('err' + error) // for debug
let { message } = error
const { t } = useI18n()
if (message === 'Network Error') {
message = t('sys.api.errorMessage')
} else if (message.includes('timeout')) {
message = t('sys.api.apiTimeoutMessage')
} else if (message.includes('Request failed with status code')) {
message = t('sys.api.apiRequestFailed') + message.substr(message.length - 3)
}
ElMessage.error(message)
return Promise.reject(error)
}
)
const refreshToken = async () => {
axios.defaults.headers.common['tenant-id'] = getTenantId()
return await axios.post(base_url + '/system/auth/refresh-token?refreshToken=' + getRefreshToken())
}
const handleAuthorized = () => {
const { t } = useI18n()
if (!isRelogin.show) {
// 如果已经到重新登录页面则不进行弹窗提示
if (window.location.href.includes('login?redirect=')) {
return
}
isRelogin.show = true
ElMessageBox.confirm(t('sys.api.timeoutMessage'), t('common.confirmTitle'), {
showCancelButton: false,
closeOnClickModal: false,
showClose: false,
confirmButtonText: t('login.relogin'),
type: 'warning'
}).then(() => {
deleteUserCache() // 删除用户缓存
removeToken()
isRelogin.show = false
// 干掉token后再走一次路由让它过router.beforeEach的校验
window.location.href = window.location.href
})
}
return Promise.reject(t('sys.api.timeoutMessage'))
}
export { service }

View File

@@ -1,827 +0,0 @@
/**
* Copyright [2022] [https://www.xiaonuo.vip]
* Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
* 1.请不要删除和修改根目录下的LICENSE文件。
* 2.请不要删除和修改Snowy源码头部的版权声明。
* 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
* 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作。
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
/**
* 图标选择器基础数据
* 推荐前往https://icones.js.org下载图标的Vue文件然后放在src/assets/icons文件夹里面
* 这个网址有118个图标集包括antd、font awesome、bootstrap、eleme等累计140456个图标
*/
const uiwIconComponentMap = import.meta.glob('../assets/icons/uiw/*.vue') // 异步方式
const uiwIcons = Object.keys(uiwIconComponentMap).map((key) => {
return key.slice(key.lastIndexOf('/') + 1, key.lastIndexOf('.'))
})
export default {
icons: [
{
name: '基础',
key: 'default',
iconItem: [
{
name: '线框风格',
key: 'default',
item: [
'step-backward-outlined',
'step-forward-outlined',
'fast-backward-outlined',
'fast-forward-outlined',
'shrink-outlined',
'arrows-alt-outlined',
'down-outlined',
'up-outlined',
'left-outlined',
'right-outlined',
'caret-up-outlined',
'caret-down-outlined',
'caret-left-outlined',
'caret-right-outlined',
'up-circle-outlined',
'down-circle-outlined',
'left-circle-outlined',
'right-circle-outlined',
'double-right-outlined',
'double-left-outlined',
'vertical-left-outlined',
'vertical-right-outlined',
'vertical-align-top-outlined',
'vertical-align-middle-outlined',
'vertical-align-bottom-outlined',
'forward-outlined',
'backward-outlined',
'rollback-outlined',
'enter-outlined',
'retweet-outlined',
'swap-outlined',
'swap-left-outlined',
'swap-right-outlined',
'arrow-up-outlined',
'arrow-down-outlined',
'arrow-left-outlined',
'arrow-right-outlined',
'play-circle-outlined',
'up-Square-outlined',
'down-square-outlined',
'left-square-outlined',
'right-square-outlined',
'login-outlined',
'logout-outlined',
'menu-fold-outlined',
'menu-unfold-outlined',
'border-bottom-outlined',
'border-horizontal-outlined',
'border-inner-outlined',
'border-outer-outlined',
'border-left-outlined',
'border-right-outlined',
'border-top-outlined',
'border-verticle-outlined',
'pic-center-outlined',
'pic-left-outlined',
'pic-right-outlined',
'radius-bottomleft-outlined',
'radius-bottomright-outlined',
'radius-upleft-outlined',
'radius-upright-outlined',
'fullscreen-outlined',
'fullscreen-exit-outlined',
'question-outlined',
'question-circle-outlined',
'plus-outlined',
'plus-circle-outlined',
'pause-outlined',
'pause-circle-outlined',
'minus-outlined',
'minus-circle-outlined',
'plus-square-outlined',
'minus-square-outlined',
'info-outlined',
'info-circle-outlined',
'exclamation-outlined',
'exclamation-circle-outlined',
'close-outlined',
'close-circle-outlined',
'close-square-outlined',
'check-outlined',
'check-circle-outlined',
'check-square-outlined',
'clock-circle-outlined',
'warning-outlined',
'issues-close-outlined',
'stop-outlined',
'edit-outlined',
'form-outlined',
'copy-outlined',
'scissor-outlined',
'delete-outlined',
'snippets-outlined',
'diff-outlined',
'highlight-outlined',
'align-center-outlined',
'align-left-outlined',
'align-right-outlined',
'bg-colors-outlined',
'bold-outlined',
'italic-outlined',
'underline-outlined',
'strikethrough-outlined',
'redo-outlined',
'undo-outlined',
'zoom-in-outlined',
'zoom-out-outlined',
'font-colors-outlined',
'font-size-outlined',
'line-height-outlined',
'dash-outlined',
'small-dash-outlined',
'sort-ascending-outlined',
'sort-descending-outlined',
'drag-outlined',
'ordered-list-outlined',
'unordered-list-outlined',
'radius-setting-outlined',
'column-width-outlined',
'column-height-outlined',
'account-book-outlined',
'aim-outlined',
'alert-outlined',
'apartment-outlined',
'api-outlined',
'appstore-add-outlined',
'appstore-outlined',
'audio-outlined',
'audio-muted-outlined',
'audit-outlined',
'bank-outlined',
'barcode-outlined',
'bars-outlined',
'bell-outlined',
'block-outlined',
'book-outlined',
'border-outlined',
'borderless-table-outlined',
'branches-outlined',
'bug-outlined',
'build-outlined',
'bulb-outlined',
'calculator-outlined',
'calendar-outlined',
'camera-outlined',
'car-outlined',
'carry-out-outlined',
'ci-circle-outlined',
'ci-outlined',
'clear-outlined',
'cloud-download-outlined',
'cloud-outlined',
'cloud-server-outlined',
'cloud-sync-outlined',
'cloud-upload-outlined',
'cluster-outlined',
'code-outlined',
'coffee-outlined',
'comment-outlined',
'compass-outlined',
'compress-outlined',
'console-sql-outlined',
'contacts-outlined',
'container-outlined',
'control-outlined',
'copyright-circle-outlined',
'copyright-outlined',
'credit-card-outlined',
'crown-outlined',
'customer-service-outlined',
'dashboard-outlined',
'database-outlined',
'delete-column-outlined',
'delete-row-outlined',
'delivered-procedure-outlined',
'deployment-unit-outlined',
'desktop-outlined',
'dingtalk-outlined',
'disconnect-outlined',
'dislike-outlined',
'dollar-circle-outlined',
'dollar-outlined',
'download-outlined',
'ellipsis-outlined',
'environment-outlined',
'euro-circle-outlined',
'euro-outlined',
'exception-outlined',
'expand-alt-outlined',
'expand-outlined',
'experiment-outlined',
'export-outlined',
'eye-outlined',
'eye-invisible-outlined',
'field-binary-outlined',
'field-number-outlined',
'field-string-outlined',
'field-time-outlined',
'file-add-outlined',
'file-done-outlined',
'file-excel-outlined',
'file-exclamation-outlined',
'file-outlined',
'file-gif-outlined',
'file-image-outlined',
'file-jpg-outlined',
'file-markdown-outlined',
'file-pdf-outlined',
'file-ppt-outlined',
'file-protect-outlined',
'file-search-outlined',
'file-sync-outlined',
'file-text-outlined',
'file-unknown-outlined',
'file-word-outlined',
'file-zip-outlined',
'filter-outlined',
'fire-outlined',
'flag-outlined',
'folder-add-outlined',
'folder-outlined',
'folder-open-outlined',
'folder-view-outlined',
'fork-outlined',
'format-painter-outlined',
'frown-outlined',
'function-outlined',
'fund-projection-screen-outlined',
'fund-view-outlined',
'funnel-plot-outlined',
'gateway-outlined',
'gif-outlined',
'gift-outlined',
'global-outlined',
'gold-outlined',
'group-outlined',
'hdd-outlined',
'heart-outlined',
'history-outlined',
'holder-outlined',
'home-outlined',
'hourglass-outlined',
'idcard-outlined',
'import-outlined',
'inbox-outlined',
'insert-row-above-outlined',
'insert-row-below-outlined',
'insert-row-left-outlined',
'insert-row-right-outlined',
'insurance-outlined',
'interaction-outlined',
'key-outlined',
'laptop-outlined',
'layout-outlined',
'like-outlined',
'line-outlined',
'link-outlined',
'loading3-quarters-outlined',
'loading-outlined',
'lock-outlined',
'mac-command-outlined',
'mail-outlined',
'man-outlined',
'medicine-box-outlined',
'meh-outlined',
'menu-outlined',
'merge-cells-outlined',
'message-outlined',
'mobile-outlined',
'money-collect-outlined',
'monitor-outlined',
'more-outlined',
'node-collapse-outlined',
'node-expand-outlined',
'node-index-outlined',
'notification-outlined',
'number-outlined',
'one-to-one-outlined',
'paper-clip-outlined',
'partition-outlined',
'pay-circle-outlined',
'percentage-outlined',
'phone-outlined',
'picture-outlined',
'play-square-outlined',
'pound-circle-outlined',
'pound-outlined',
'poweroff-outlined',
'printer-outlined',
'profile-outlined',
'project-outlined',
'property-safety-outlined',
'pull-request-outlined',
'pushpin-outlined',
'qrcode-outlined',
'read-outlined',
'reconciliation-outlined',
'red-envelope-outlined',
'reload-outlined',
'rest-outlined',
'robot-outlined',
'rocket-outlined',
'rotate-left-outlined',
'rotate-right-outlined',
'safety-certificate-outlined',
'safety-outlined',
'save-outlined',
'scan-outlined',
'schedule-outlined',
'search-outlined',
'security-scan-outlined',
'select-outlined',
'send-outlined',
'setting-outlined',
'shake-outlined',
'share-alt-outlined',
'shop-outlined',
'shopping-cart-outlined',
'shopping-outlined',
'sisternode-outlined',
'skin-outlined',
'smile-outlined',
'solution-outlined',
'sound-outlined',
'split-cells-outlined',
'star-outlined',
'subnode-outlined',
'switcher-outlined',
'sync-outlined',
'table-outlined',
'tablet-outlined',
'tag-outlined',
'tags-outlined',
'team-outlined',
'thunderbolt-outlined',
'to-top-outlined',
'tool-outlined',
'trademark-circle-outlined',
'trademark-outlined',
'transaction-outlined',
'translation-outlined',
'trophy-outlined',
'ungroup-outlined',
'unlock-outlined',
'upload-outlined',
'usb-outlined',
'user-add-outlined',
'user-delete-outlined',
'user-outlined',
'user-switch-outlined',
'usergroup-add-outlined',
'usergroup-delete-outlined',
'verified-outlined',
'video-camera-add-outlined',
'video-camera-outlined',
'wallet-outlined',
'whats-app-outlined',
'wifi-outlined',
'woman-outlined'
]
},
{
name: '实底风格',
key: 'filled',
item: [
'step-backward-filled',
'step-forward-filled',
'fast-backward-filled',
'fast-forward-filled',
'caret-up-filled',
'caret-down-filled',
'caret-left-filled',
'caret-right-filled',
'up-circle-filled',
'down-circle-filled',
'left-circle-filled',
'right-circle-filled',
'forward-filled',
'backward-filled',
'play-circle-filled',
'up-square-filled',
'down-square-filled',
'left-square-filled',
'right-square-filled',
'question-circle-filled',
'plus-circle-filled',
'pause-circle-filled',
'minus-circle-filled',
'plus-square-filled',
'minus-square-filled',
'info-circle-filled',
'exclamation-circle-filled',
'close-circle-filled',
'close-square-filled',
'check-circle-filled',
'check-square-filled',
'clock-circle-filled',
'warning-filled',
'stop-filled',
'edit-filled',
'copy-filled',
'delete-filled',
'snippets-filled',
'diff-filled',
'highlight-filled',
'pie-chart-filled',
'box-plot-filled',
'fund-filled',
'sliders-filled',
'android-filled',
'apple-filled',
'windows-filled',
'chrome-filled',
'github-filled',
'aliwangwang-filled',
'weibo-square-filled',
'weibo-circle-filled',
'taobao-circle-filled',
'html5-filled',
'wechat-filled',
'youtube-filled',
'alipay-circle-filled',
'skype-filled',
'gitlab-filled',
'linkedin-filled',
'facebook-filled',
'code-sandbox-circle-filled',
'codepen-circle-filled',
'slack-square-filled',
'behance-square-filled',
'dribbble-square-filled',
'instagram-filled',
'yuque-filled',
'yahoo-filled',
'account-book-filled',
'alert-filled',
'alipay-square-filled',
'amazon-circle-filled',
'amazon-square-filled',
'api-filled',
'appstore-filled',
'audio-filled',
'bank-filled',
'behance-circle-filled',
'bell-filled',
'book-filled',
'bug-filled',
'build-filled',
'bulb-filled',
'calculator-filled',
'calendar-filled',
'camera-filled',
'car-filled',
'carry-out-filled',
'ci-circle-filled',
'cloud-filled',
'code-filled',
'code-sandbox-square-filled',
'codepen-square-filled',
'compass-filled',
'contacts-filled',
'container-filled',
'control-filled',
'copyright-circle-filled',
'credit-card-filled',
'crown-filled',
'customer-service-filled',
'dashboard-filled',
'database-filled',
'dingtalk-circle-filled',
'dingtalk-square-filled',
'dislike-filled',
'dollar-circle-filled',
'dribbble-circle-filled',
'dropbox-circle-filled',
'dropbox-square-filled',
'environment-filled',
'euro-circle-filled',
'experiment-filled',
'eye-filled',
'eye-invisible-filled',
'file-add-filled',
'file-excel-filled',
'file-exclamation-filled',
'file-filled',
'file-image-filled',
'file-markdown-filled',
'file-pdf-filled',
'file-ppt-filled',
'file-text-filled',
'file-unknown-filled',
'file-word-filled',
'file-zip-filled',
'filter-filled',
'fire-filled',
'flag-filled',
'folder-add-filled',
'folder-filled',
'folder-open-filled',
'format-painter-filled',
'frown-filled',
'funnel-plot-filled',
'gift-filled',
'gold-filled',
'golden-filled',
'google-circle-filled',
'google-plus-circle-filled',
'google-plus-square-filled',
'google-square-filled',
'hdd-filled',
'heart-filled',
'home-filled',
'hourglass-filled',
'idcard-filled',
'ie-circle-filled',
'ie-square-filled',
'insurance-filled',
'interaction-filled',
'layout-filled',
'like-filled',
'lock-filled',
'mac-command-filled',
'mail-filled',
'medicine-box-filled',
'medium-circle-filled',
'medium-square-filled',
'meh-filled',
'message-filled',
'mobile-filled',
'money-collect-filled',
'notification-filled',
'pay-circle-filled',
'phone-filled',
'picture-filled',
'play-square-filled',
'pound-circle-filled',
'printer-filled',
'profile-filled',
'project-filled',
'property-safety-filled',
'pushpin-filled',
'qq-circle-filled',
'qq-square-filled',
'read-filled',
'reconciliation-filled',
'red-envelope-filled',
'reddit-circle-filled',
'reddit-square-filled',
'rest-filled',
'robot-filled',
'rocket-filled',
'safety-certificate-filled',
'save-filled',
'schedule-filled',
'security-scan-filled',
'setting-filled',
'shop-filled',
'shopping-filled',
'signal-filled',
'sketch-circle-filled',
'sketch-square-filled',
'skin-filled',
'slack-circle-filled',
'smile-filled',
'sound-filled',
'star-filled',
'switcher-filled',
'tablet-filled',
'tag-filled',
'tags-filled',
'taobao-square-filled',
'thunderbolt-filled',
'tool-filled',
'trademark-circle-filled',
'trophy-filled',
'twitter-circle-filled',
'twitter-square-filled',
'unlock-filled',
'usb-filled',
'video-camera-filled',
'wallet-filled',
'zhihu-circle-filled',
'zhihu-square-filled'
]
},
{
name: '双色风格',
key: 'twotone',
item: [
'up-circle-two-tone',
'down-circle-two-tone',
'left-circle-two-tone',
'right-circle-two-tone',
'play-circle-two-tone',
'up-square-two-tone',
'down-square-two-tone',
'left-square-two-tone',
'right-square-two-tone',
'question-circle-two-tone',
'plus-circle-two-tone',
'pause-circle-two-tone',
'minus-circle-two-tone',
'plus-square-two-tone',
'minus-square-two-tone',
'info-circle-two-tone',
'exclamation-circle-two-tone',
'close-circle-two-tone',
'close-square-two-tone',
'check-circle-two-tone',
'check-square-two-tone',
'clock-circle-two-tone',
'warning-two-tone',
'stop-two-tone',
'edit-two-tone',
'copy-two-tone',
'delete-two-tone',
'snippets-two-tone',
'diff-two-tone',
'highlight-two-tone',
'pie-chart-two-tone',
'box-plot-two-tone',
'fund-two-tone',
'sliders-two-tone',
'account-book-two-tone',
'alert-two-tone',
'api-two-tone',
'appstore-two-tone',
'audio-two-tone',
'bank-two-tone',
'bell-two-tone',
'book-two-tone',
'bug-two-tone',
'build-two-tone',
'bulb-two-tone',
'calculator-two-tone',
'calendar-two-tone',
'camera-two-tone',
'car-two-tone',
'carry-out-two-tone',
'ci-circle-two-tone',
'ci-two-tone',
'cloud-two-tone',
'code-two-tone',
'compass-two-tone',
'contacts-two-tone',
'container-two-tone',
'control-two-tone',
'copyright-circle-two-tone',
'copyright-two-tone',
'credit-card-two-tone',
'crown-two-tone',
'customer-service-two-tone',
'dashboard-two-tone',
'database-two-tone',
'dislike-two-tone',
'dollar-circle-two-tone',
'dollar-two-tone',
'environment-two-tone',
'euro-circle-two-tone',
'account-book-two-tone',
'alert-two-tone',
'api-two-tone',
'appstore-two-tone',
'audio-two-tone',
'bank-two-tone',
'bell-two-tone',
'book-two-tone',
'bug-two-tone',
'build-two-tone',
'bulb-two-tone',
'calculator-two-tone',
'calendar-two-tone',
'camera-two-tone',
'car-two-tone',
'carry-out-two-tone',
'ci-circle-two-tone',
'ci-two-tone',
'cloud-two-tone',
'code-two-tone',
'compass-two-tone',
'contacts-two-tone',
'container-two-tone',
'control-two-tone',
'copyright-circle-two-tone',
'copyright-two-tone',
'credit-card-two-tone',
'crown-two-tone',
'customer-service-two-tone',
'dashboard-two-tone',
'database-two-tone',
'dislike-two-tone',
'dollar-circle-two-tone',
'dollar-two-tone',
'environment-two-tone',
'euro-circle-two-tone',
'euro-two-tone',
'experiment-two-tone',
'eye-two-tone',
'eye-invisible-two-tone',
'file-add-two-tone',
'file-excel-two-tone',
'file-exclamation-two-tone',
'file-two-tone',
'file-image-two-tone',
'file-markdown-two-tone',
'file-pdf-two-tone',
'file-ppt-two-tone',
'file-text-two-tone',
'file-unknown-two-tone',
'file-word-two-tone',
'file-zip-two-tone',
'filter-two-tone',
'fire-two-tone',
'flag-two-tone',
'folder-add-two-tone',
'folder-two-tone',
'folder-open-two-tone',
'frown-two-tone',
'funnel-plot-two-tone',
'gift-two-tone',
'gold-two-tone',
'hdd-two-tone',
'heart-two-tone',
'home-two-tone',
'hourglass-two-tone',
'idcard-two-tone',
'insurance-two-tone',
'interaction-two-tone',
'layout-two-tone',
'like-two-tone',
'lock-two-tone',
'mail-two-tone',
'medicine-box-two-tone',
'meh-two-tone',
'message-two-tone',
'mobile-two-tone',
'money-collect-two-tone',
'notification-two-tone',
'phone-two-tone',
'picture-two-tone',
'play-square-two-tone',
'pound-circle-two-tone',
'printer-two-tone',
'profile-two-tone',
'project-two-tone',
'property-safety-two-tone',
'pushpin-two-tone',
'reconciliation-two-tone',
'red-envelope-two-tone',
'rest-two-tone',
'rocket-two-tone',
'safety-certificate-two-tone',
'save-two-tone',
'schedule-two-tone',
'security-scan-two-tone',
'setting-two-tone',
'shop-two-tone',
'shopping-two-tone',
'skin-two-tone',
'smile-two-tone',
'sound-two-tone',
'star-two-tone',
'switcher-two-tone',
'tablet-two-tone',
'tag-two-tone',
'tags-two-tone',
'thunderbolt-two-tone',
'tool-two-tone',
'trademark-circle-two-tone',
'trophy-two-tone',
'unlock-two-tone',
'usb-two-tone',
'video-camera-two-tone',
'wallet-two-tone'
]
}
]
},
{
name: '扩展',
key: 'extend',
iconItem: [
{
name: '常用',
key: 'default',
item: uiwIcons
},
{
name: '其他',
key: 'other',
item: ['GiteeIcon']
}
]
}
]
}

View File

@@ -1,101 +0,0 @@
/**
* Copyright [2022] [https://www.xiaonuo.vip]
* Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
* 1.请不要删除和修改根目录下的LICENSE文件。
* 2.请不要删除和修改Snowy源码头部的版权声明。
* 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
* 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作。
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
const DEFAULT_CONFIG = {
// 首页地址
DASHBOARD_URL: '/index',
// 接口地址
API_URL: import.meta.env.VITE_API_BASEURL,
// 请求超时
TIMEOUT: 60000,
// TokenName // Authorization
TOKEN_NAME: 'token',
// Token前缀注意最后有个空格如不需要需设置空字符串 // Bearer
TOKEN_PREFIX: '',
// 追加其他头
HEADERS: {},
// 请求是否开启缓存
REQUEST_CACHE: false,
// 布局 经典classical双排菜单doublerow
SNOWY_LAYOUT: 'doublerow',
// 菜单是否折叠
SNOWY_MENU_COLLAPSE: false,
// 模块坞
SNOWY_MODULE_UNFOLD_OPEN: true,
// 是否开启多标签
SNOWY_LAYOUT_TAGS_OPEN: true,
// 是否开启展示面包屑
SNOWY_BREADCRUMD_OPEN: false,
// 顶栏是否应用主题色
SNOWY_TOP_HEADER_THEME_COLOR_OPEN: false,
// 顶栏主题色通栏
SNOWY_TOP_HEADER_THEME_COLOR_SPREAD: false,
// 侧边菜单是否排他展开
SNOWY_SIDE_UNIQUE_OPEN: true,
// 语言
LANG: 'zh-cn',
// 主题颜色
COLOR: '#1890FF',
// 默认整体主题
SNOWY_THEME: 'dark',
// 整体表单风格
SNOWY_FORM_STYLE: 'drawer',
// 成功色
success: '#52c41a',
// 警告色
warning: '#faad14',
// 错误色
error: '#f5222f',
// 系统基础配置,这些是数据库中保存起来的
SYS_BASE_CONFIG: {
// 默认logo
SNOWY_SYS_LOGO: '/img/logo.png',
// 背景图
SNOWY_SYS_BACK_IMAGE: '',
// 系统名称
SNOWY_SYS_NAME: 'Snowy',
// 版本
SNOWY_SYS_VERSION: '2.0',
// 版权
SNOWY_SYS_COPYRIGHT: 'Snowy ©2022 Created by xiaonuo.vip',
// 版权跳转URL
SNOWY_SYS_COPYRIGHT_URL: 'https://www.xiaonuo.vip',
// 默认文件存储
SNOWY_SYS_DEFAULT_FILE_ENGINE: 'LOCAL',
// 是否开启验证码
SNOWY_SYS_DEFAULT_CAPTCHA_OPEN: 'false',
// 默认重置密码
SNOWY_SYS_DEFAULT_PASSWORD: '123456'
}
}
export default DEFAULT_CONFIG

View File

@@ -1,44 +0,0 @@
/**
* Copyright [2022] [https://www.xiaonuo.vip]
* Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
* 1.请不要删除和修改根目录下的LICENSE文件。
* 2.请不要删除和修改Snowy源码头部的版权声明。
* 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
* 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作。
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
// 静态路由配置
const routes = {
// 默认模块,仅限于后端未添加任何单页配置,用此路由
module: [
{
id: '01',
name: 'homeModule',
path: '/homeModule',
component: '',
meta: {
title: '默认',
type: 'module',
icon: 'bank-outlined'
},
children: []
}
],
// 默认谁都有个人中心
menu: [
{
id: '001',
name: 'usercenter',
path: '/usercenter',
component: 'sys/user/userCenter',
meta: {
title: '个人中心',
type: 'menu',
hidden: true
}
}
]
}
export default routes

View File

@@ -1,64 +0,0 @@
/**
* Copyright [2022] [https://www.xiaonuo.vip]
* Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
* 1.请不要删除和修改根目录下的LICENSE文件。
* 2.请不要删除和修改Snowy源码头部的版权声明。
* 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
* 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作。
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
const colorList = [
{
key: '薄暮',
color: '#F5222D'
},
{
key: '火山',
color: '#FA541C'
},
{
key: '胭脂粉',
color: '#EB2F96'
},
{
key: '日暮',
color: '#FAAD14'
},
{
key: '明青',
color: '#13C2C2'
},
{
key: '极光绿',
color: '#52C41A'
},
{
key: '深绿',
color: '#009688'
},
{
key: '拂晓蓝(默认)',
color: '#1890FF'
},
{
key: '极客蓝',
color: '#2F54EB'
},
{
key: '酱紫',
color: '#722ED1'
},
{
key: '主题黑',
color: '#001529'
}
]
const updateColorWeak = (colorWeak) => {
// document.body.className = colorWeak ? 'colorWeak' : '';
const app = document.body.querySelector('#app')
colorWeak ? app.classList.add('colorWeak') : app.classList.remove('colorWeak')
}
export { colorList, updateColorWeak }

View File

@@ -1,10 +0,0 @@
/**
* Copyright [2022] [https://www.xiaonuo.vip]
* Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
* 1.请不要删除和修改根目录下的LICENSE文件。
* 2.请不要删除和修改Snowy源码头部的版权声明。
* 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
* 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
* 5.不可二次分发开源参与同类竞品如有想法可联系团队xiaonuobase@qq.com商议合作。
* 6.若您的项目无法满足以上几点需要更多功能代码获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/