Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cxt104926
Stusystem Web
提交
f49eebe7
S
Stusystem Web
项目概览
cxt104926
/
Stusystem Web
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Stusystem Web
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f49eebe7
编写于
4月 27, 2021
作者:
cxt104926
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
嵌入页面
上级
72f1812d
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
234 addition
and
94 deletion
+234
-94
README.md
README.md
+3
-0
config/index.js
config/index.js
+3
-3
src/api.js
src/api.js
+1
-1
src/router/index.js
src/router/index.js
+37
-17
src/store/store.js
src/store/store.js
+2
-2
src/views/login.vue
src/views/login.vue
+2
-2
src/views/manager/index.vue
src/views/manager/index.vue
+61
-66
src/views/system/stuClass/index.vue
src/views/system/stuClass/index.vue
+3
-1
src/views/system/stuIframe/index.vue
src/views/system/stuIframe/index.vue
+46
-0
src/views/system/stuMenu/index.vue
src/views/system/stuMenu/index.vue
+72
-0
src/views/system/welcome/index.vue
src/views/system/welcome/index.vue
+4
-2
未找到文件。
README.md
浏览文件 @
f49eebe7
...
...
@@ -38,6 +38,9 @@ npm run build --report
注册
菜单加载:
登录成功后去后台查询菜单,在查询完菜单后,在根据用户去查询权限,将权限code也携带在菜单中,可以实现某一些页面中的按钮这个用户没有权限,就不显示。当然在后端的接口也要验证是否有权限,否则通过手动修改按钮显示也是可以实现数据传入后台。
#### 2.软件架构
1.
系统环境
...
...
config/index.js
浏览文件 @
f49eebe7
...
...
@@ -10,18 +10,18 @@ module.exports = {
assetsSubDirectory
:
'
static
'
,
assetsPublicPath
:
'
/
'
,
proxyTable
:
{
'
/
'
:
{
'
/
api
'
:
{
target
:
'
http://localhost:2020
'
,
// 请求的接口地址
changeOrigin
:
true
,
pathRewrite
:
{
'
^/
'
:
'
/
'
'
^/
api
'
:
'
/
'
}
}
},
// Various Dev Server settings
host
:
'
localhost
'
,
// can be overwritten by process.env.HOST
port
:
8088
,
// can be overwritten by process.env.PORT, if port is in use, a free one will be determined
port
:
2021
,
// can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser
:
false
,
errorOverlay
:
true
,
notifyOnErrors
:
true
,
...
...
src/api.js
浏览文件 @
f49eebe7
...
...
@@ -89,7 +89,7 @@ axios.interceptors.response.use(success => {
/**
* 封装请求
*/
let
base
=
''
;
let
base
=
'
api/
'
;
export
const
postApi
=
(
url
,
params
)
=>
{
return
axios
({
method
:
'
post
'
,
...
...
src/router/index.js
浏览文件 @
f49eebe7
...
...
@@ -3,8 +3,7 @@ import Router from 'vue-router'
import
login
from
'
../views/login
'
import
register
from
'
../views/register/register
'
import
manager
from
'
../views/manager/index
'
import
menu
from
'
../views/system/menu
'
import
stuClass
from
'
../views/system/stuClass
'
import
de
from
"
element-ui/src/locale/lang/de
"
;
Vue
.
use
(
Router
)
...
...
@@ -12,7 +11,7 @@ const router = new Router({
routes
:
[
{
path
:
''
,
// 访问的地址
redirect
:
'
/login
'
,
// 重定向
redirect
:
'
/login
'
,
// 重定向
component
:
login
// 组件名称
},
{
...
...
@@ -28,19 +27,33 @@ const router = new Router({
{
path
:
'
/manager
'
,
name
:
'
manager
'
,
component
:
manager
redirect
:
'
/system/welcome
'
,
component
:
manager
,
children
:
[
{
path
:
'
/system/welcome
'
,
name
:
'
welcome
'
,
component
:
()
=>
import
(
"
../views/system/welcome
"
)
},
{
// 嵌入页面
path
:
'
/system/stuIframe
'
,
name
:
'
stuIframe
'
,
component
:
()
=>
import
(
"
../views/system/stuIframe
"
)
},
{
path
:
'
/system/m
enu
'
,
name
:
'
m
enu
'
,
component
:
menu
path
:
'
/system/stuM
enu
'
,
name
:
'
stuM
enu
'
,
component
:
()
=>
import
(
"
../views/system/stuMenu
"
)
},
{
path
:
'
/system/stuClass
'
,
name
:
'
stuClass
'
,
component
:
stuClass
component
:
()
=>
import
(
"
../views/system/stuClass
"
)
}
]
},
]
});
// 导航守卫
...
...
@@ -52,10 +65,17 @@ router.beforeEach((to, from, next) => {
let
token
=
localStorage
.
getItem
(
'
Authorization
'
)
if
(
token
===
'
null
'
||
token
===
''
)
{
next
(
'
/login
'
);
}
else
{
// 看是否是嵌入页面,嵌入页面url前缀有iframe:
let
path
=
to
.
path
;
if
(
path
.
indexOf
(
"
iframe:
"
)
!==
-
1
)
{
// router.push('/system/iframe');
router
.
push
({
path
:
'
/system/stuIframe
'
,
query
:
{
url
:
path
}});
}
else
{
next
();
}
}
}
});
export
default
router
;
src/store/store.js
浏览文件 @
f49eebe7
...
...
@@ -6,7 +6,7 @@ vue.use(vuex)
export
default
new
vuex
.
Store
({
state
:
{
routes
:
[],
userInfo
:
[]
userInfo
:
[]
,
},
// 同步
...
...
@@ -26,7 +26,7 @@ export default new vuex.Store({
userInfo
(
state
,
data
)
{
state
.
userInfo
=
data
;
localStorage
.
setItem
(
"
userInfo
"
,
JSON
.
stringify
(
data
));
}
}
,
},
// 异步
...
...
src/views/login.vue
浏览文件 @
f49eebe7
...
...
@@ -44,7 +44,7 @@
verification
:
""
},
rememberMe
:
true
,
imgSrc
:
"
/getVerify?temp=
"
+
new
Date
(),
imgSrc
:
"
/
api/
getVerify?temp=
"
+
new
Date
(),
message
:
""
,
addAndEditRules
:
{
account
:
{
...
...
@@ -68,7 +68,7 @@
created
()
{},
methods
:
{
getVerification
()
{
this
.
imgSrc
=
"
/getVerify?temp=
"
+
+
new
Date
();
this
.
imgSrc
=
"
/
api/
getVerify?temp=
"
+
+
new
Date
();
},
handleConfirmEvent
()
{
this
.
$refs
.
loginFrom
.
validate
(
valid
=>
{
...
...
src/views/manager/index.vue
浏览文件 @
f49eebe7
<
template
>
<div
style=
"height: 100%"
>
<el-container
style=
"height: 100%; border: 1px solid #eee"
>
<el-aside
:width=
"
menuWith
"
style=
"background-color: rgb(238, 241, 246)"
>
<el-aside
:width=
"
isCollapse?'64px':'200px'
"
style=
"background-color: rgb(238, 241, 246)"
>
<el-scrollbar
style=
"width: 100%"
>
<el-menu
:collapse=
"isCollapse"
class=
"el-menu-vertical-demo"
background-color=
"#545c64"
text-color=
"#fff"
active-text-color=
"#66b1ff
"
>
<i
v-if=
"isCollapse"
@
click=
"
handleOpen
"
class=
"hideIcon el-icon-s-unfold"
></i>
<i
v-else
@
click=
"
handleClos
e"
class=
"hideIcon el-icon-s-fold"
></i>
active-text-color=
"#66b1ff"
:router=
"true"
:collapse-transition=
"false"
:default-active=
"activePath
"
>
<i
v-if=
"isCollapse"
@
click=
"
isCollapse = false
"
class=
"hideIcon el-icon-s-unfold"
></i>
<i
v-else
@
click=
"
isCollapse = tru
e"
class=
"hideIcon el-icon-s-fold"
></i>
<el-submenu
v-for=
"(item,index) in menu"
:key=
"item.id"
:index=
"item.id"
>
<template
slot=
"title"
>
<i
:class=
"item.iconImg"
></i>
...
...
@@ -14,13 +14,15 @@
</
template
>
<!-- 第二层菜单-->
<div
v-for=
"(itemChild,index) in item.child"
:key=
"itemChild.id"
>
<el-menu-item
v-if=
"itemChild.child === undefined"
:index=
"itemChild.id"
>
{{ itemChild.name }}
<el-menu-item
v-if=
"itemChild.child === undefined"
:index=
"itemChild.url"
@
click=
"changeActivePath(itemChild.url)"
>
{{ itemChild.name }}
</el-menu-item>
<!-- 第三层菜单-->
<div
v-else
v-for=
"itChild in itemChild.child"
:key=
"itChild.id"
>
<el-submenu
:index=
"itemChild.id"
>
<
template
slot=
"title"
>
{{
itemChild
.
name
}}
</
template
>
<el-menu-item
:index=
"itChild.id"
>
{{ itChild.name }}
</el-menu-item>
<el-menu-item
:index=
"itChild.url"
@
click=
"changeActivePath(itChild.url)"
>
{{ itChild.name }}
</el-menu-item>
</el-submenu>
</div>
</div>
...
...
@@ -28,14 +30,13 @@
</el-menu>
</el-scrollbar>
</el-aside>
<!-- 系统头部 -->
<el-container>
<el-header
style=
"text-align: right; font-size: 12px;background-color: #a9b3a9"
>
<el-dropdown>
<div
style=
"margin-top: 5px"
>
<el-avatar
:size=
"50"
class=
"imgTitle"
>
<img
:src=
"avatarURL"
/>
<img
:src=
"avatarURL"
/>
</el-avatar>
<span
class=
"nameClass"
>
{{ userInfo.name }}
...
...
@@ -49,20 +50,16 @@
</el-dropdown-menu>
</el-dropdown>
</el-header>
<el-main>
<router-view
/>
</el-main>
</el-container>
</el-container>
<!-- 修改头像模态框 -->
<el-dialog
title=
"修改头像"
:visible.sync=
"editAvatarDialog"
width=
"30%"
>
<el-row
type=
"flex"
justify=
"center"
>
<div
class=
"cropper"
>
<vueCropper
ref=
"cropper"
:img=
"option.img"
:outputSize=
"option.size"
:outputType=
"option.outputType"
:info=
"option.info"
:full=
"option.full"
:canMove=
"option.canMove"
:canMoveBox=
"option.canMoveBox"
:info=
"option.info"
:full=
"option.full"
:canMove=
"option.canMove"
:canMoveBox=
"option.canMoveBox"
:original=
"option.original"
:autoCrop=
"option.autoCrop"
:autoCropWidth=
"option.autoCropWidth"
:autoCropHeight=
"option.autoCropHeight"
:fixedBox=
"option.fixedBox"
@
realTime=
"realTime"
></vueCropper>
:autoCropHeight=
"option.autoCropHeight"
:fixedBox=
"option.fixedBox"
@
realTime=
"realTime"
></vueCropper>
</div>
<div
class=
"previewBox"
>
<div
:style=
"previews.div"
class=
"preview"
>
...
...
@@ -88,6 +85,11 @@
<el-button
@
click=
"editAvatarDialog = false"
>
取 消
</el-button>
</span>
</el-dialog>
<el-main>
<router-view></router-view>
</el-main>
</el-container>
</el-container>
<!-- 密码模态框 -->
<el-dialog
title=
"修改密码"
:closeOnClickModal=
"pwdCloseOnClickModal"
:visible.sync=
"pwdAddAndEditDialogFormVisible"
...
...
@@ -154,7 +156,7 @@
stu
:
[],
tableData
:
[],
isCollapse
:
true
,
menuWith
:
'
64px
'
,
activePath
:
''
,
// 当前激活菜单的index,存储在localStorage中
// 模态框相关
title
:
''
,
closeOnClickModal
:
false
,
...
...
@@ -202,6 +204,7 @@
created
()
{
// 初始化,加载用户信息和菜单
this
.
init
();
this
.
activePath
=
window
.
localStorage
.
getItem
(
"
currentMenu
"
);
},
methods
:
{
init
()
{
...
...
@@ -232,19 +235,10 @@
}
},
// 点开菜单
handleOpen
()
{
this
.
isCollapse
=
false
this
.
menuWith
=
'
218px
'
;
},
// 关闭菜单
handleClose
()
{
this
.
isCollapse
=
true
// 这里为了解决背景灰色框执行太快,体验不好问题
setTimeout
(()
=>
{
this
.
menuWith
=
'
64px
'
;
},
250
);
// 点击的菜单变色
changeActivePath
(
path
)
{
localStorage
.
setItem
(
"
currentMenu
"
,
path
);
this
.
activePath
=
path
;
},
// 修改用户头像
...
...
@@ -262,7 +256,7 @@
submitPwd
()
{
let
url
=
"
/updatePwd?id=
"
+
this
.
userInfo
.
id
+
"
&oldPwd=
"
+
this
.
pwdFormData
.
oldPassword
+
"
&newPwd=
"
+
this
.
pwdFormData
.
password
;
this
.
api
.
getApi
(
url
).
then
(
e
=>
{
if
(
e
.
data
.
code
===
200
){
if
(
e
.
data
.
code
===
200
)
{
this
.
pwdAddAndEditDialogFormVisible
=
false
;
this
.
loginOut
();
}
...
...
@@ -310,8 +304,9 @@
if
(
e
.
data
.
code
===
200
)
{
this
.
$store
.
commit
(
"
removeState
"
)
localStorage
.
removeItem
(
"
Authorization
"
);
localStorage
.
removeItem
(
"
currentMenu
"
);
this
.
$router
.
push
(
"
/login
"
);
}
else
{
}
else
{
Message
.
info
(
"
系统出现问题
"
)
}
});
...
...
src/views/system/stuClass/index.vue
浏览文件 @
f49eebe7
<
template
>
<div>
班
</div>
</
template
>
<
script
>
...
...
src/views/system/stuIframe/index.vue
0 → 100644
浏览文件 @
f49eebe7
<
template
>
<div
class=
"iframe-container"
>
<iframe
id=
"iframeId"
:src=
"src"
frameborder=
"0"
class=
"pc iframe"
scrolling=
"auto"
></iframe>
</div>
</
template
>
<
script
>
export
default
{
name
:
"
stuIframe
"
,
data
()
{
return
{
src
:
''
,
}
},
created
()
{
let
iframe
=
this
.
$route
.
query
.
url
;
let
split
=
iframe
.
split
(
"
:
"
);
this
.
src
=
split
[
1
];
},
methods
:
{},
mounted
()
{
function
changeFrameHeight
()
{
const
oIframe
=
document
.
getElementById
(
'
iframeId
'
);
const
deviceWidth
=
document
.
documentElement
.
clientWidth
;
const
deviceHeight
=
document
.
documentElement
.
clientHeight
;
oIframe
.
style
.
width
=
(
Number
(
deviceWidth
)
-
220
)
+
'
px
'
;
oIframe
.
style
.
height
=
(
Number
(
deviceHeight
)
-
125
)
+
'
px
'
;
}
changeFrameHeight
()
},
}
</
script
>
<
style
scoped
>
.iframe-container
{
text-align
:
center
;
overflow-x
:
hidden
;
overflow-y
:
hidden
;
}
.iframe-container
.iframe
{
width
:
100%
;
height
:
100%
;
}
</
style
>
src/views/system/stuMenu/index.vue
0 → 100644
浏览文件 @
f49eebe7
<
template
>
<div>
<el-form
ref=
"form"
:model=
"form"
label-width=
"80px"
>
<el-form-item
label=
"活动名称"
>
<el-input
v-model=
"form.name"
></el-input>
</el-form-item>
<el-form-item
label=
"活动区域"
>
<el-select
v-model=
"form.region"
placeholder=
"请选择活动区域"
>
<el-option
label=
"区域一"
value=
"shanghai"
></el-option>
<el-option
label=
"区域二"
value=
"beijing"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"活动时间"
>
<el-col
:span=
"11"
>
<el-date-picker
type=
"date"
placeholder=
"选择日期"
v-model=
"form.date1"
style=
"width: 100%;"
></el-date-picker>
</el-col>
<el-col
class=
"line"
:span=
"2"
>
-
</el-col>
<el-col
:span=
"11"
>
<el-time-picker
placeholder=
"选择时间"
v-model=
"form.date2"
style=
"width: 100%;"
></el-time-picker>
</el-col>
</el-form-item>
<el-form-item
label=
"即时配送"
>
<el-switch
v-model=
"form.delivery"
></el-switch>
</el-form-item>
<el-form-item
label=
"活动性质"
>
<el-checkbox-group
v-model=
"form.type"
>
<el-checkbox
label=
"美食/餐厅线上活动"
name=
"type"
></el-checkbox>
<el-checkbox
label=
"地推活动"
name=
"type"
></el-checkbox>
<el-checkbox
label=
"线下主题活动"
name=
"type"
></el-checkbox>
<el-checkbox
label=
"单纯品牌曝光"
name=
"type"
></el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item
label=
"特殊资源"
>
<el-radio-group
v-model=
"form.resource"
>
<el-radio
label=
"线上品牌商赞助"
></el-radio>
<el-radio
label=
"线下场地免费"
></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"活动形式"
>
<el-input
type=
"textarea"
v-model=
"form.desc"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"onSubmit"
>
立即创建
</el-button>
<el-button>
取消
</el-button>
</el-form-item>
</el-form>
</div>
</
template
>
<
script
>
export
default
{
name
:
"
stuMenu
"
,
data
()
{
return
{
form
:
{
name
:
''
,
region
:
''
,
date1
:
''
,
date2
:
''
,
delivery
:
false
,
type
:
[],
resource
:
''
,
desc
:
''
}
}
}
}
</
script
>
<
style
scoped
>
</
style
>
src/views/system/
menu
/index.vue
→
src/views/system/
welcome
/index.vue
浏览文件 @
f49eebe7
<
template
>
<div>
欢迎使用
</div>
</
template
>
<
script
>
export
default
{
name
:
"
menu
"
,
name
:
"
welcome
"
,
data
()
{
return
{}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录