ehs init
This commit is contained in:
parent
4c60a5fbed
commit
62874af83d
|
@ -5,7 +5,7 @@ NODE_ENV = development
|
||||||
VUE_APP_TITLE = SCUI(DEV)
|
VUE_APP_TITLE = SCUI(DEV)
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VUE_APP_API_BASEURL = https://www.fastmock.site/mock/5039c4361c39a7e3252c5b55971f1bd3/api
|
VUE_APP_API_BASEURL = http://49.232.14.174:2226/api
|
||||||
|
|
||||||
# 本地端口
|
# 本地端口
|
||||||
VUE_APP_PORT = 2800
|
VUE_APP_PORT = 2800
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
请提交`Issue`时填写以下信息,以便我们更快更准确的定位和复现问题,谢谢。
|
|
||||||
|
|
||||||
### 1、SCUI版本号
|
|
||||||
|
|
||||||
### 2、运行浏览器品牌及版本号
|
|
||||||
|
|
||||||
### 3、问题的描述
|
|
||||||
|
|
||||||
### 4、重现步骤
|
|
||||||
|
|
||||||
### 5、期待的结果
|
|
||||||
|
|
||||||
### 6、最小化可复现问题的源码
|
|
|
@ -1,5 +0,0 @@
|
||||||
请在提交PR前阅读以下说明,谢谢。
|
|
||||||
- 提交 PR 前请`rebase`,确保`commit`记录的整洁。
|
|
||||||
- 确保 PR 是提交到`develop`分支,而不是`master`分支。
|
|
||||||
- 在下方填写本次 PR 的目的。
|
|
||||||
|
|
|
@ -3,10 +3,17 @@ import http from "@/utils/request"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
token: {
|
token: {
|
||||||
url: `${config.API_URL}/token`,
|
url: `${config.API_URL}/auth/token/`,
|
||||||
name: "登录获取TOKEN",
|
name: "登录获取TOKEN",
|
||||||
post: async function(data={}){
|
post: async function(data={}){
|
||||||
return await http.post(this.url, data);
|
return await http.post(this.url, data);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
info: {
|
||||||
|
url: `${config.API_URL}/system/user/info/`,
|
||||||
|
name: "获取账户信息",
|
||||||
|
get: async function(data={}){
|
||||||
|
return await http.get(this.url, data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,829 @@
|
||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
|
|
||||||
const routes = []
|
const routes = [
|
||||||
|
{
|
||||||
|
"name": "home",
|
||||||
|
"path": "/home",
|
||||||
|
"meta": {
|
||||||
|
"title": "首页",
|
||||||
|
"icon": "el-icon-eleme-filled",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"name": "dashboard",
|
||||||
|
"path": "/dashboard",
|
||||||
|
"meta": {
|
||||||
|
"title": "控制台",
|
||||||
|
"icon": "el-icon-menu",
|
||||||
|
"affix": true
|
||||||
|
},
|
||||||
|
"component": "home"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userCenter",
|
||||||
|
"path": "/usercenter",
|
||||||
|
"meta": {
|
||||||
|
"title": "帐号信息",
|
||||||
|
"icon": "el-icon-user"
|
||||||
|
},
|
||||||
|
"component": "userCenter"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hrm",
|
||||||
|
"path": "/hrm",
|
||||||
|
"meta": {
|
||||||
|
"title": "人员管理",
|
||||||
|
"icon": "el-icon-user",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"name": "employee",
|
||||||
|
"path": "/employee",
|
||||||
|
"meta": {
|
||||||
|
"title": "人员列表",
|
||||||
|
"icon": "el-icon-menu",
|
||||||
|
"affix": true
|
||||||
|
},
|
||||||
|
"component": "hrm"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vab",
|
||||||
|
"path": "/vab",
|
||||||
|
"meta": {
|
||||||
|
"title": "组件",
|
||||||
|
"icon": "el-icon-takeaway-box",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/vab/mini",
|
||||||
|
"name": "minivab",
|
||||||
|
"meta": {
|
||||||
|
"title": "原子组件",
|
||||||
|
"icon": "el-icon-magic-stick",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/mini"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/iconfont",
|
||||||
|
"name": "iconfont",
|
||||||
|
"meta": {
|
||||||
|
"title": "扩展图标",
|
||||||
|
"icon": "el-icon-orange",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/iconfont"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/data",
|
||||||
|
"name": "vabdata",
|
||||||
|
"meta": {
|
||||||
|
"title": "Data 数据展示",
|
||||||
|
"icon": "el-icon-histogram",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/vab/chart",
|
||||||
|
"name": "chart",
|
||||||
|
"meta": {
|
||||||
|
"title": "图表 Echarts",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/chart"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/statistic",
|
||||||
|
"name": "statistic",
|
||||||
|
"meta": {
|
||||||
|
"title": "统计数值",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/statistic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/video",
|
||||||
|
"name": "scvideo",
|
||||||
|
"meta": {
|
||||||
|
"title": "视频播放器",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/video"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/qrcode",
|
||||||
|
"name": "qrcode",
|
||||||
|
"meta": {
|
||||||
|
"title": "二维码",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/qrcode"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/form",
|
||||||
|
"name": "vabform",
|
||||||
|
"meta": {
|
||||||
|
"title": "Form 数据录入",
|
||||||
|
"icon": "el-icon-edit",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/vab/tableselect",
|
||||||
|
"name": "tableselect",
|
||||||
|
"meta": {
|
||||||
|
"title": "表格选择器",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/tableselect"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/formtable",
|
||||||
|
"name": "formtable",
|
||||||
|
"meta": {
|
||||||
|
"title": "表单表格",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/formtable"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/selectFilter",
|
||||||
|
"name": "selectFilter",
|
||||||
|
"meta": {
|
||||||
|
"title": "分类筛选器",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/selectFilter"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/filterbar",
|
||||||
|
"name": "filterBar",
|
||||||
|
"meta": {
|
||||||
|
"title": "过滤器v2",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/filterBar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/upload",
|
||||||
|
"name": "upload",
|
||||||
|
"meta": {
|
||||||
|
"title": "上传",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/upload"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/select",
|
||||||
|
"name": "scselect",
|
||||||
|
"meta": {
|
||||||
|
"title": "异步选择器",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/select"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/iconselect",
|
||||||
|
"name": "iconSelect",
|
||||||
|
"meta": {
|
||||||
|
"title": "图标选择器",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/iconselect"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/cron",
|
||||||
|
"name": "cron",
|
||||||
|
"meta": {
|
||||||
|
"title": "Cron规则生成器",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/cron"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/editor",
|
||||||
|
"name": "editor",
|
||||||
|
"meta": {
|
||||||
|
"title": "富文本编辑器",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/editor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/codeeditor",
|
||||||
|
"name": "codeeditor",
|
||||||
|
"meta": {
|
||||||
|
"title": "代码编辑器",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/codeeditor"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/feedback",
|
||||||
|
"name": "vabfeedback",
|
||||||
|
"meta": {
|
||||||
|
"title": "Feedback 反馈",
|
||||||
|
"icon": "el-icon-mouse",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/vab/drag",
|
||||||
|
"name": "drag",
|
||||||
|
"meta": {
|
||||||
|
"title": "拖拽排序",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/drag"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/contextmenu",
|
||||||
|
"name": "contextmenu",
|
||||||
|
"meta": {
|
||||||
|
"title": "右键菜单",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/contextmenu"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/cropper",
|
||||||
|
"name": "cropper",
|
||||||
|
"meta": {
|
||||||
|
"title": "图像剪裁",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/cropper"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/fileselect",
|
||||||
|
"name": "fileselect",
|
||||||
|
"meta": {
|
||||||
|
"title": "资源库选择器(弃用)",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/fileselect"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/dialog",
|
||||||
|
"name": "dialogExtend",
|
||||||
|
"meta": {
|
||||||
|
"title": "弹窗扩展",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/dialog"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/others",
|
||||||
|
"name": "vabothers",
|
||||||
|
"meta": {
|
||||||
|
"title": "Others 其他",
|
||||||
|
"icon": "el-icon-more-filled",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/vab/print",
|
||||||
|
"name": "print",
|
||||||
|
"meta": {
|
||||||
|
"title": "打印",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/print"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/watermark",
|
||||||
|
"name": "watermark",
|
||||||
|
"meta": {
|
||||||
|
"title": "水印",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/watermark"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/importexport",
|
||||||
|
"name": "importexport",
|
||||||
|
"meta": {
|
||||||
|
"title": "文件导出导入",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/importexport"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/list",
|
||||||
|
"name": "list",
|
||||||
|
"meta": {
|
||||||
|
"title": "Table 数据列表",
|
||||||
|
"icon": "el-icon-fold",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/vab/table/base",
|
||||||
|
"name": "tableBase",
|
||||||
|
"meta": {
|
||||||
|
"title": "基础数据列表",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/table/base"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/table/thead",
|
||||||
|
"name": "tableThead",
|
||||||
|
"meta": {
|
||||||
|
"title": "多级表头",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/table/thead"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/table/column",
|
||||||
|
"name": "tableCustomColumn",
|
||||||
|
"meta": {
|
||||||
|
"title": "动态列",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/table/column"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/table/remote",
|
||||||
|
"name": "tableRemote",
|
||||||
|
"meta": {
|
||||||
|
"title": "远程排序过滤",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/table/remote"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/workflow",
|
||||||
|
"name": "workflow",
|
||||||
|
"meta": {
|
||||||
|
"title": "工作流设计器",
|
||||||
|
"icon": "el-icon-share",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/workflow"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/vab/formrender",
|
||||||
|
"name": "formRender",
|
||||||
|
"meta": {
|
||||||
|
"title": "动态表单(Beta)",
|
||||||
|
"icon": "el-icon-message-box",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "vab/form"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "template",
|
||||||
|
"path": "/template",
|
||||||
|
"meta": {
|
||||||
|
"title": "模板",
|
||||||
|
"icon": "el-icon-files",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/template/layout",
|
||||||
|
"name": "layoutTemplate",
|
||||||
|
"meta": {
|
||||||
|
"title": "布局",
|
||||||
|
"icon": "el-icon-grid",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/template/layout/blank",
|
||||||
|
"name": "blank",
|
||||||
|
"meta": {
|
||||||
|
"title": "空白模板",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "template/layout/blank"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/template/layout/layoutTCB",
|
||||||
|
"name": "layoutTCB",
|
||||||
|
"meta": {
|
||||||
|
"title": "上中下布局",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "template/layout/layoutTCB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/template/layout/layoutLCR",
|
||||||
|
"name": "layoutLCR",
|
||||||
|
"meta": {
|
||||||
|
"title": "左中右布局",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "template/layout/layoutLCR"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/template/list",
|
||||||
|
"name": "list",
|
||||||
|
"meta": {
|
||||||
|
"title": "列表",
|
||||||
|
"icon": "el-icon-document",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/template/list/crud",
|
||||||
|
"name": "listCrud",
|
||||||
|
"meta": {
|
||||||
|
"title": "CRUD",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "template/list/crud",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/template/list/crud/detail/:id?",
|
||||||
|
"name": "listCrud-detail",
|
||||||
|
"meta": {
|
||||||
|
"title": "新增/编辑",
|
||||||
|
"hidden": true,
|
||||||
|
"active": "/template/list/crud",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "template/list/crud/detail"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/template/list/tree",
|
||||||
|
"name": "listTree",
|
||||||
|
"meta": {
|
||||||
|
"title": "左树右表",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "template/list/tree"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/template/list/tab",
|
||||||
|
"name": "listTab",
|
||||||
|
"meta": {
|
||||||
|
"title": "分类表格",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "template/list/tab"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/template/list/son",
|
||||||
|
"name": "listSon",
|
||||||
|
"meta": {
|
||||||
|
"title": "子母表",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "template/list/son"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/template/list/widthlist",
|
||||||
|
"name": "widthlist",
|
||||||
|
"meta": {
|
||||||
|
"title": "定宽列表",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "template/list/width"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/template/other",
|
||||||
|
"name": "other",
|
||||||
|
"meta": {
|
||||||
|
"title": "其他",
|
||||||
|
"icon": "el-icon-folder",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/template/other/stepform",
|
||||||
|
"name": "stepform",
|
||||||
|
"meta": {
|
||||||
|
"title": "分步表单",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "template/other/stepform"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "other",
|
||||||
|
"path": "/other",
|
||||||
|
"meta": {
|
||||||
|
"title": "其他",
|
||||||
|
"icon": "el-icon-more-filled",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/other/directive",
|
||||||
|
"name": "directive",
|
||||||
|
"meta": {
|
||||||
|
"title": "指令",
|
||||||
|
"icon": "el-icon-price-tag",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "other/directive"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/other/viewTags",
|
||||||
|
"name": "viewTags",
|
||||||
|
"meta": {
|
||||||
|
"title": "标签操作",
|
||||||
|
"icon": "el-icon-files",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "other/viewTags",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/other/fullpage",
|
||||||
|
"name": "fullpage",
|
||||||
|
"meta": {
|
||||||
|
"title": "整页路由",
|
||||||
|
"icon": "el-icon-monitor",
|
||||||
|
"fullpage": true,
|
||||||
|
"hidden": true,
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "other/fullpage"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/other/verificate",
|
||||||
|
"name": "verificate",
|
||||||
|
"meta": {
|
||||||
|
"title": "表单验证",
|
||||||
|
"icon": "el-icon-open",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "other/verificate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/other/loadJS",
|
||||||
|
"name": "loadJS",
|
||||||
|
"meta": {
|
||||||
|
"title": "异步加载JS",
|
||||||
|
"icon": "el-icon-location-information",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "other/loadJS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/link",
|
||||||
|
"name": "link",
|
||||||
|
"meta": {
|
||||||
|
"title": "外部链接",
|
||||||
|
"icon": "el-icon-link",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "https://baidu.com",
|
||||||
|
"name": "百度",
|
||||||
|
"meta": {
|
||||||
|
"title": "百度",
|
||||||
|
"type": "link"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "https://www.google.cn",
|
||||||
|
"name": "谷歌",
|
||||||
|
"meta": {
|
||||||
|
"title": "谷歌",
|
||||||
|
"type": "link"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/iframe",
|
||||||
|
"name": "Iframe",
|
||||||
|
"meta": {
|
||||||
|
"title": "Iframe",
|
||||||
|
"icon": "el-icon-position",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "https://v3.cn.vuejs.org",
|
||||||
|
"name": "vue3",
|
||||||
|
"meta": {
|
||||||
|
"title": "VUE 3",
|
||||||
|
"type": "iframe"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "https://element-plus.gitee.io",
|
||||||
|
"name": "elementplus",
|
||||||
|
"meta": {
|
||||||
|
"title": "Element Plus",
|
||||||
|
"type": "iframe"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "https://lolicode.gitee.io/scui-doc",
|
||||||
|
"name": "scuidoc",
|
||||||
|
"meta": {
|
||||||
|
"title": "SCUI文档",
|
||||||
|
"type": "iframe"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "test",
|
||||||
|
"path": "/test",
|
||||||
|
"meta": {
|
||||||
|
"title": "实验室",
|
||||||
|
"icon": "el-icon-mouse",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/test/autocode",
|
||||||
|
"name": "autocode",
|
||||||
|
"meta": {
|
||||||
|
"title": "代码生成器",
|
||||||
|
"icon": "sc-icon-code",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "test/autocode/index",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/test/autocode/table",
|
||||||
|
"name": "autocode-table",
|
||||||
|
"meta": {
|
||||||
|
"title": "CRUD代码生成",
|
||||||
|
"hidden": true,
|
||||||
|
"active": "/test/autocode",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "test/autocode/table"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/test/codebug",
|
||||||
|
"name": "codebug",
|
||||||
|
"meta": {
|
||||||
|
"title": "异常处理",
|
||||||
|
"icon": "sc-icon-bug-line",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "test/codebug"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "setting",
|
||||||
|
"path": "/setting",
|
||||||
|
"meta": {
|
||||||
|
"title": "配置",
|
||||||
|
"icon": "el-icon-setting",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"path": "/setting/system",
|
||||||
|
"name": "system",
|
||||||
|
"meta": {
|
||||||
|
"title": "系统设置",
|
||||||
|
"icon": "el-icon-tools",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "setting/system"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/setting/user",
|
||||||
|
"name": "user",
|
||||||
|
"meta": {
|
||||||
|
"title": "用户管理",
|
||||||
|
"icon": "el-icon-user-filled",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "setting/user"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/setting/role",
|
||||||
|
"name": "role",
|
||||||
|
"meta": {
|
||||||
|
"title": "角色管理",
|
||||||
|
"icon": "el-icon-notebook",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "setting/role"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/setting/dept",
|
||||||
|
"name": "dept",
|
||||||
|
"meta": {
|
||||||
|
"title": "部门管理",
|
||||||
|
"icon": "sc-icon-organization",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "setting/dept"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/setting/dic",
|
||||||
|
"name": "dic",
|
||||||
|
"meta": {
|
||||||
|
"title": "字典管理",
|
||||||
|
"icon": "el-icon-document",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "setting/dic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/setting/table",
|
||||||
|
"name": "tableSetting",
|
||||||
|
"meta": {
|
||||||
|
"title": "表格列管理",
|
||||||
|
"icon": "el-icon-scale-to-original",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "setting/table"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/setting/menu",
|
||||||
|
"name": "settingMenu",
|
||||||
|
"meta": {
|
||||||
|
"title": "菜单管理",
|
||||||
|
"icon": "el-icon-fold",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "setting/menu"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/setting/task",
|
||||||
|
"name": "task",
|
||||||
|
"meta": {
|
||||||
|
"title": "计划任务",
|
||||||
|
"icon": "el-icon-alarm-clock",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "setting/task"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/setting/client",
|
||||||
|
"name": "client",
|
||||||
|
"meta": {
|
||||||
|
"title": "应用管理",
|
||||||
|
"icon": "el-icon-help-filled",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "setting/client"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/setting/log",
|
||||||
|
"name": "log",
|
||||||
|
"meta": {
|
||||||
|
"title": "系统日志",
|
||||||
|
"icon": "el-icon-warning",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "setting/log"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "/other/about",
|
||||||
|
"name": "about",
|
||||||
|
"meta": {
|
||||||
|
"title": "关于",
|
||||||
|
"icon": "el-icon-info-filled",
|
||||||
|
"type": "menu"
|
||||||
|
},
|
||||||
|
"component": "other/about"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
export default routes;
|
export default routes;
|
||||||
|
|
|
@ -34,25 +34,29 @@ axios.interceptors.response.use(
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
if (error.response.status == 404) {
|
if (error.response.status > 401) {
|
||||||
ElNotification.error({
|
ElNotification.error({
|
||||||
title: '请求错误',
|
title: '请求错误',
|
||||||
message: "Status:404,正在请求不存在的服务器记录!"
|
message: error.response.data.err_msg
|
||||||
});
|
});
|
||||||
} else if (error.response.status == 500) {
|
}
|
||||||
ElNotification.error({
|
else if (error.response.status == 401) {
|
||||||
title: '请求错误',
|
if(error.response.data.err_code == 'no_active_account'){
|
||||||
message: error.response.data.message || "Status:500,服务器发生错误!"
|
ElNotification.error({
|
||||||
});
|
title: '请求错误',
|
||||||
} else if (error.response.status == 401) {
|
message: "账户密码错误或已禁用"
|
||||||
ElMessageBox.confirm('当前用户已被登出或无权限访问当前资源,请尝试重新登录后再操作。', '无权限访问', {
|
});
|
||||||
type: 'error',
|
}else{
|
||||||
closeOnClickModal: false,
|
ElMessageBox.confirm('当前用户已被登出或无权限访问当前资源,请尝试重新登录后再操作。', '无权限访问', {
|
||||||
center: true,
|
type: 'error',
|
||||||
confirmButtonText: '重新登录'
|
closeOnClickModal: false,
|
||||||
}).then(() => {
|
center: true,
|
||||||
router.replace({path: '/login'});
|
confirmButtonText: '重新登录'
|
||||||
}).catch(() => {})
|
}).then(() => {
|
||||||
|
router.replace({path: '/login'});
|
||||||
|
}).catch(() => {})
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ElNotification.error({
|
ElNotification.error({
|
||||||
title: '请求错误',
|
title: '请求错误',
|
||||||
|
@ -65,7 +69,6 @@ axios.interceptors.response.use(
|
||||||
message: "请求服务器无响应!"
|
message: "请求服务器无响应!"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.reject(error.response);
|
return Promise.reject(error.response);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -23,13 +23,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getVer()
|
// this.getVer()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getVer(){
|
// async getVer(){
|
||||||
const ver = await this.$API.demo.ver.get()
|
// const ver = await this.$API.demo.ver.get()
|
||||||
this.ver = ver.data
|
// this.ver = ver.data
|
||||||
},
|
// },
|
||||||
golog(){
|
golog(){
|
||||||
window.open("https://gitee.com/lolicode/scui/releases")
|
window.open("https://gitee.com/lolicode/scui/releases")
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,125 +1,189 @@
|
||||||
<template>
|
<template>
|
||||||
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large">
|
<el-form
|
||||||
<el-form-item prop="user">
|
ref="loginForm"
|
||||||
<el-input v-model="form.user" prefix-icon="el-icon-user" clearable :placeholder="$t('login.userPlaceholder')">
|
:model="form"
|
||||||
<template #append>
|
:rules="rules"
|
||||||
<el-select v-model="userType" style="width: 130px;">
|
label-width="0"
|
||||||
<el-option :label="$t('login.admin')" value="admin"></el-option>
|
size="large"
|
||||||
<el-option :label="$t('login.user')" value="user"></el-option>
|
>
|
||||||
</el-select>
|
<el-form-item prop="user">
|
||||||
</template>
|
<el-input
|
||||||
</el-input>
|
v-model="form.user"
|
||||||
</el-form-item>
|
prefix-icon="el-icon-user"
|
||||||
<el-form-item prop="password">
|
clearable
|
||||||
<el-input v-model="form.password" prefix-icon="el-icon-lock" clearable show-password :placeholder="$t('login.PWPlaceholder')"></el-input>
|
:placeholder="$t('login.userPlaceholder')"
|
||||||
</el-form-item>
|
>
|
||||||
<el-form-item style="margin-bottom: 10px;">
|
<template #append>
|
||||||
<el-col :span="12">
|
<el-select v-model="userType" style="width: 130px">
|
||||||
<el-checkbox :label="$t('login.rememberMe')" v-model="form.autologin"></el-checkbox>
|
<el-option :label="$t('login.admin')" value="admin"></el-option>
|
||||||
</el-col>
|
<el-option :label="$t('login.user')" value="user"></el-option>
|
||||||
<el-col :span="12" class="login-forgot">
|
</el-select>
|
||||||
<router-link to="/reset_password">{{ $t('login.forgetPassword') }}?</router-link>
|
</template>
|
||||||
</el-col>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item prop="password">
|
||||||
<el-button type="primary" style="width: 100%;" :loading="islogin" round @click="login">{{ $t('login.signIn') }}</el-button>
|
<el-input
|
||||||
</el-form-item>
|
v-model="form.password"
|
||||||
<div class="login-reg">
|
prefix-icon="el-icon-lock"
|
||||||
{{$t('login.noAccount')}} <router-link to="/user_register">{{$t('login.createAccount')}}</router-link>
|
clearable
|
||||||
</div>
|
show-password
|
||||||
</el-form>
|
:placeholder="$t('login.PWPlaceholder')"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="margin-bottom: 10px">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-checkbox
|
||||||
|
:label="$t('login.rememberMe')"
|
||||||
|
v-model="form.autologin"
|
||||||
|
></el-checkbox>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" class="login-forgot">
|
||||||
|
<router-link to="/reset_password"
|
||||||
|
>{{ $t("login.forgetPassword") }}?</router-link
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
style="width: 100%"
|
||||||
|
:loading="islogin"
|
||||||
|
round
|
||||||
|
@click="login"
|
||||||
|
>{{ $t("login.signIn") }}</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
<div class="login-reg">
|
||||||
|
{{ $t("login.noAccount") }}
|
||||||
|
<router-link to="/user_register">{{
|
||||||
|
$t("login.createAccount")
|
||||||
|
}}</router-link>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
userType: 'admin',
|
userType: "admin",
|
||||||
form: {
|
form: {
|
||||||
user: "admin",
|
user: "admin",
|
||||||
password: "admin",
|
password: "admin",
|
||||||
autologin: false
|
autologin: false,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
user: [
|
user: [
|
||||||
{required: true, message: this.$t('login.userError'), trigger: 'blur'}
|
{
|
||||||
],
|
required: true,
|
||||||
password: [
|
message: this.$t("login.userError"),
|
||||||
{required: true, message: this.$t('login.PWError'), trigger: 'blur'}
|
trigger: "blur",
|
||||||
]
|
},
|
||||||
},
|
],
|
||||||
islogin: false,
|
password: [
|
||||||
}
|
{
|
||||||
},
|
required: true,
|
||||||
watch:{
|
message: this.$t("login.PWError"),
|
||||||
userType(val){
|
trigger: "blur",
|
||||||
if(val == 'admin'){
|
},
|
||||||
this.form.user = 'admin'
|
],
|
||||||
this.form.password = 'admin'
|
},
|
||||||
}else if(val == 'user'){
|
islogin: false,
|
||||||
this.form.user = 'user'
|
};
|
||||||
this.form.password = 'user'
|
},
|
||||||
}
|
watch: {
|
||||||
}
|
userType(val) {
|
||||||
},
|
if (val == "admin") {
|
||||||
mounted() {
|
this.form.user = "admin";
|
||||||
|
this.form.password = "admin";
|
||||||
|
} else if (val == "user") {
|
||||||
|
this.form.user = "user";
|
||||||
|
this.form.password = "user";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
async login() {
|
||||||
|
var validate = await this.$refs.loginForm.validate().catch(() => {});
|
||||||
|
if (!validate) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
},
|
this.islogin = true;
|
||||||
methods: {
|
var data = {
|
||||||
async login(){
|
username: this.form.user,
|
||||||
|
// password: this.$TOOL.crypto.MD5(this.form.password)
|
||||||
|
password: this.form.password,
|
||||||
|
};
|
||||||
|
//获取token
|
||||||
|
try {
|
||||||
|
var res = await this.$API.auth.token.post(data);
|
||||||
|
this.$TOOL.cookie.set("TOKEN", res.access, {
|
||||||
|
expires: this.form.autologin ? 24 * 60 * 60 : 0,
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
var res1 = await this.$API.auth.info.get();
|
||||||
|
this.$TOOL.data.set("USER_INFO", res1);
|
||||||
|
this.$TOOL.data.set("PERMISSIONS", res1.perms);
|
||||||
|
this.$router.replace({
|
||||||
|
path: "/",
|
||||||
|
});
|
||||||
|
this.$message.success("Login Success 登录成功");
|
||||||
|
this.islogin = false;
|
||||||
|
} catch (err) {console.log(err);}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
// var res = await this.$API.auth.token.post(data)
|
||||||
|
// console.log(res, err)
|
||||||
|
// if(!res){
|
||||||
|
// this.islogin = false
|
||||||
|
// this.$message.warning(res.err_msg)
|
||||||
|
// return false
|
||||||
|
// }else{
|
||||||
|
// this.$TOOL.cookie.set("TOKEN", res.token, {
|
||||||
|
// expires: this.form.autologin? 24*60*60 : 0
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// if(user.code == 200){
|
||||||
|
|
||||||
var validate = await this.$refs.loginForm.validate().catch(()=>{})
|
// this.$TOOL.data.set("USER_INFO", user.data.userInfo)
|
||||||
if(!validate){ return false }
|
// }else{
|
||||||
|
|
||||||
this.islogin = true
|
// }
|
||||||
var data = {
|
//获取菜单
|
||||||
username: this.form.user,
|
// var menu = null
|
||||||
password: this.$TOOL.crypto.MD5(this.form.password)
|
// if(this.form.user == 'admin'){
|
||||||
}
|
// menu = await this.$API.system.menu.myMenus.get()
|
||||||
//获取token
|
// }else{
|
||||||
var user = await this.$API.auth.token.post(data)
|
// menu = await this.$API.demo.menu.get()
|
||||||
if(user.code == 200){
|
// }
|
||||||
this.$TOOL.cookie.set("TOKEN", user.data.token, {
|
// if(menu.code == 200){
|
||||||
expires: this.form.autologin? 24*60*60 : 0
|
// if(menu.data.menu.length==0){
|
||||||
})
|
// this.islogin = false
|
||||||
this.$TOOL.data.set("USER_INFO", user.data.userInfo)
|
// this.$alert("当前用户无任何菜单权限,请联系系统管理员", "无权限访问", {
|
||||||
}else{
|
// type: 'error',
|
||||||
this.islogin = false
|
// center: true
|
||||||
this.$message.warning(user.message)
|
// })
|
||||||
return false
|
// return false
|
||||||
}
|
// }
|
||||||
//获取菜单
|
// this.$TOOL.data.set("MENU", menu.data.menu)
|
||||||
var menu = null
|
// this.$TOOL.data.set("PERMISSIONS", menu.data.permissions)
|
||||||
if(this.form.user == 'admin'){
|
// }else{
|
||||||
menu = await this.$API.system.menu.myMenus.get()
|
// this.islogin = false
|
||||||
}else{
|
// this.$message.warning(menu.message)
|
||||||
menu = await this.$API.demo.menu.get()
|
// return false
|
||||||
}
|
// }
|
||||||
if(menu.code == 200){
|
|
||||||
if(menu.data.menu.length==0){
|
|
||||||
this.islogin = false
|
|
||||||
this.$alert("当前用户无任何菜单权限,请联系系统管理员", "无权限访问", {
|
|
||||||
type: 'error',
|
|
||||||
center: true
|
|
||||||
})
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
this.$TOOL.data.set("MENU", menu.data.menu)
|
|
||||||
this.$TOOL.data.set("PERMISSIONS", menu.data.permissions)
|
|
||||||
}else{
|
|
||||||
this.islogin = false
|
|
||||||
this.$message.warning(menu.message)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$router.replace({
|
// this.$router.replace({
|
||||||
path: '/'
|
// path: '/'
|
||||||
})
|
// })
|
||||||
this.$message.success("Login Success 登录成功")
|
// this.$message.success("Login Success 登录成功")
|
||||||
this.islogin = false
|
// this.islogin = false
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Reference in New Issue