Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
76aaac5b
Commit
76aaac5b
authored
Sep 23, 2020
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理部分功能
parent
8f091636
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
204 additions
and
114 deletions
+204
-114
quasar.conf.js
quasar.conf.js
+1
-1
App.vue
src/App.vue
+1
-1
personCenter.js
src/api/personCenter/personCenter.js
+3
-3
permission.js
src/boot/permission.js
+4
-0
MainLayout.vue
src/layouts/MainLayout.vue
+99
-83
manager.vue
src/pages/school/manager.vue
+22
-0
routes.js
src/router/routes.js
+10
-4
getters.js
src/store/getters.js
+8
-7
index.js
src/store/index.js
+3
-1
app.js
src/store/modules/app.js
+32
-0
permission.js
src/store/modules/permission.js
+1
-0
user.js
src/store/modules/user.js
+17
-12
auth.js
src/utils/auth.js
+1
-1
cache.js
src/utils/cache.js
+2
-1
No files found.
quasar.conf.js
View file @
76aaac5b
...
...
@@ -47,7 +47,7 @@ module.exports = function(ctx) {
build
:
{
vueRouterMode
:
'hash'
,
// available values: 'hash', 'history'
env
:
ctx
.
dev
?
{
API
:
'http
://192.168.1.214:8300
/api'
API
:
'http
s://localhost:5001
/api'
}
:
{
API
:
'https://prod.api.com'
},
...
...
src/App.vue
View file @
76aaac5b
...
...
@@ -12,7 +12,7 @@ export default {
<
style
>
@import
url('~assets/css/font.css')
;
@import
url('//at.alicdn.com/t/font_2077629_
9oybkwrr9es
.css')
;
@import
url('//at.alicdn.com/t/font_2077629_
t78k31ibux
.css')
;
html
,
body
,
...
...
src/api/personCenter/personCenter.js
View file @
76aaac5b
...
...
@@ -4,10 +4,10 @@ import request from '../../utils/request'
* 查询个人详情
*
*/
export
function
adminUsersRead
(
data
)
{
export
function
adminUsersRead
()
{
return
request
({
url
:
'
system/user/queryLoginUser
'
,
url
:
'
login/GetUserInfo
'
,
method
:
'post'
,
data
:
data
data
:
{}
})
}
\ No newline at end of file
src/boot/permission.js
View file @
76aaac5b
...
...
@@ -25,6 +25,7 @@ router.beforeEach((to, from, next) => {
if
(
!
loadAsyncRouter
)
{
// 判断当前用户是否获取权限
loadAsyncRouter
=
true
;
console
.
log
(
store
.
getters
.
allAuth
)
if
(
store
.
getters
.
allAuth
)
{
store
.
dispatch
(
"GenerateRoutes"
,
store
.
getters
.
allAuth
).
then
(()
=>
{
// 根据auths权限生成可访问的路由表
...
...
@@ -39,6 +40,7 @@ router.beforeEach((to, from, next) => {
...
to
,
replace
:
true
});
LoadingBar
.
stop
();
}
});
}
else
{
...
...
@@ -54,11 +56,13 @@ router.beforeEach((to, from, next) => {
path
:
to
.
redirectedFrom
||
"/"
,
replace
:
true
});
LoadingBar
.
stop
();
}
else
{
next
({
...
to
,
replace
:
true
});
LoadingBar
.
stop
();
}
});
})
...
...
src/layouts/MainLayout.vue
View file @
76aaac5b
...
...
@@ -3,18 +3,13 @@
<q-header
bordered
reveal
height-hint=
"98"
>
<q-toolbar
style=
"height:60px;"
class=
"q-pr-lg q-pl-lg"
>
<q-avatar>
<img
src=
"~assets/images/logo.png
"
>
<img
:src=
"logo
"
>
</q-avatar>
<q-toolbar-title
style=
"font-family:perfectFont"
>
甲鹤日语学院
{{
name
}}
</q-toolbar-title>
<q-tabs
inline-label
style=
"margin:0 auto; font-family:perfectFont;height:60px"
class=
"text-white"
shrink
stretch
>
<q-route-tab
name=
"navs_1"
to=
"/home"
label=
"首页"
icon=
"iconfont icon-shangdian-copy"
/>
<q-route-tab
name=
"navs_2"
to=
""
label=
"校园"
icon=
"iconfont icon-xiaoyuan"
/>
<q-route-tab
name=
"navs_3"
to=
""
label=
"课程"
icon=
"iconfont icon-kecheng"
/>
<q-route-tab
name=
"navs_4"
to=
""
label=
"教务"
icon=
"iconfont icon-jiaowuguanli"
/>
<q-route-tab
name=
"navs_5"
to=
""
label=
"网课"
icon=
"iconfont icon-yunying"
/>
<q-route-tab
name=
"navs_6"
to=
""
label=
"设置"
icon=
"iconfont icon-shezhi"
/>
<q-tabs
inline-label
style=
"margin:0 auto; font-family:perfectFont;height:60px"
class=
"text-white"
shrink
stretch
v-if=
"userInfo"
>
<q-route-tab
v-for=
"(x, i) in userInfo.MenuList"
:key=
"i"
:name=
"`navs_$
{i}`" :to="x.MenuUrl" :label="x.MenuName" :icon="x.MenuIcon" />
</q-tabs>
<div
class=
"q-pl-lg"
>
<q-btn-dropdown
flat
color=
"primary"
>
...
...
@@ -120,7 +115,7 @@
</q-item>
</q-list>
</q-btn-dropdown>
<q-btn-dropdown
flat
color=
"primary"
@
click=
"onMainClick"
>
<q-btn-dropdown
flat
color=
"primary"
>
<
template
v-slot:label
>
<q-avatar
size=
"28px"
>
<img
src=
"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600423326738&di=ec1433b0230f5e4d56273271e8bcaa0b&imgtype=0&src=http%3A%2F%2Fp0.ifengimg.com%2Fpmop%2F2017%2F0907%2F1507748D95DA5B2BE480B783227F8A153CEF1BF3_size38_w867_h533.jpeg"
>
...
...
@@ -129,8 +124,8 @@
<div
class=
"row no-wrap q-pa-md"
>
<div
class=
"column"
>
<div
class=
"text-h6 q-mb-md"
>
Settings
</div>
<q-toggle
v-model=
"mobileData"
label=
"Use Mobile Data"
/>
<q-toggle
v-model=
"bluetooth"
label=
"Bluetooth"
/>
<q-toggle
label=
"Use Mobile Data"
/>
<q-toggle
label=
"Bluetooth"
/>
</div>
<q-separator
vertical
inset
class=
"q-mx-lg"
/>
...
...
@@ -142,88 +137,83 @@
<div
class=
"text-subtitle1 q-mt-md q-mb-xs"
>
John Doe
</div>
<q-btn
color=
"primary"
label=
"Logout"
push
size=
"sm"
v-close-popup
/>
<q-btn
color=
"primary"
label=
"Logout"
push
size=
"sm"
v-close-popup
@
click=
"logout"
/>
</div>
</div>
</q-btn-dropdown>
</div>
</q-toolbar>
</q-header>
<q-page-container
class=
"window-height"
>
<div
class=
"row items-stretch full-height"
>
<div
style=
"width:242px;border-right:1px solid #e6e6e6;font-family:perfectFont"
class=
"text-subtitle2"
>
<q-list>
<q-item
to=
"/school/manager"
clickable
v-ripple
:active=
"currentPath=='/school/manager'"
>
<q-item-section
avatar
>
<q-icon
name=
"iconfont icon-xuexiaoxiaoquguanli"
size=
"20px"
/>
</q-item-section>
<q-item-section>
校区管理
</q-item-section>
</q-item>
<q-expansion-item
expand-separator
icon=
"iconfont icon-jiangshi"
label=
"讲师管理"
>
<q-item
clickable
v-ripple
>
<q-item-section
avatar
>
<q-icon
name=
"iconfont icon-xuexiaoxiaoquguanli"
size=
"20px"
/>
</q-item-section>
<q-item-section>
校区管理
</q-item-section>
</q-item>
<q-item
clickable
v-ripple
>
<q-item-section
avatar
>
<q-icon
name=
"iconfont icon-xuexiaoxiaoquguanli"
size=
"20px"
/>
</q-item-section>
<q-item-section>
校区管理
</q-item-section>
</q-item>
</q-expansion-item>
<q-item
to=
"/home"
clickable
v-ripple
:active=
"currentPath=='/home'"
>
<q-item-section
avatar
>
<q-icon
name=
"iconfont icon-jiedujiaoyu-fuzhujiaoyu"
size=
"20px"
/>
</q-item-section>
<q-item-section>
助教管理
</q-item-section>
</q-item>
<q-item
clickable
v-ripple
>
<q-item-section
avatar
>
<q-icon
name=
"iconfont icon-banji"
size=
"20px"
/>
</q-item-section>
<q-item-section>
班级管理
</q-item-section>
</q-item>
<q-item
clickable
v-ripple
>
<q-item-section
avatar
>
<q-icon
name=
"iconfont icon-xueyuan"
size=
"20px"
/>
</q-item-section>
<q-item-section>
学员管理
</q-item-section>
</q-item>
<q-item
clickable
v-ripple
>
<q-item-section
avatar
>
<q-icon
name=
"iconfont icon-yiyuanguanliyuan"
size=
"20px"
/>
</q-item-section>
<q-item-section>
后台用户管理
</q-item-section>
</q-item>
<q-item
clickable
v-ripple
>
<q-item-section
avatar
>
<q-icon
name=
"iconfont icon-jiaoseguanli"
size=
"20px"
/>
</q-item-section>
<q-item-section>
角色管理
</q-item-section>
</q-item>
</q-list>
</div>
<div
class=
"col"
>
<router-view
/>
</div>
</div>
<!-- <q-drawer
v-model="leftDrawerOpen"
show-if-above
bordered
content-class="bg-grey-1"
>
<q-list>
<q-item-label
header
class="text-grey-8"
>
Essential Links
</q-item-label>
<EssentialLink
v-for="link in essentialLinks"
:key="link.title"
v-bind="link"
/>
</q-list>
</q-drawer> -->
<q-page-container>
<router-view
/>
</q-page-container>
</q-layout>
</template>
<
script
>
import
EssentialLink
from
'components/EssentialLink.vue'
// const linksData = [{
// title: 'Docs',
// caption: 'quasar.dev',
// icon: 'school',
// link: 'https://quasar.dev'
// },
// {
// title: 'Github',
// caption: 'github.com/quasarframework',
// icon: 'code',
// link: 'https://github.com/quasarframework'
// },
// {
// title: 'Discord Chat Channel',
// caption: 'chat.quasar.dev',
// icon: 'chat',
// link: 'https://chat.quasar.dev'
// },
// {
// title: 'Forum',
// caption: 'forum.quasar.dev',
// icon: 'record_voice_over',
// link: 'https://forum.quasar.dev'
// },
// {
// title: 'Twitter',
// caption: '@quasarframework',
// icon: 'rss_feed',
// link: 'https://twitter.quasar.dev'
// },
// {
// title: 'Facebook',
// caption: '@QuasarFramework',
// icon: 'public',
// link: 'https://facebook.quasar.dev'
// },
// {
// title: 'Quasar Awesome',
// caption: 'Community Quasar projects',
// icon: 'favorite',
// link: 'https://awesome.quasar.dev'
// }
// ]
import
{
mapGetters
}
from
'vuex'
export
default
{
name
:
'MainLayout'
,
components
:
{
...
...
@@ -233,8 +223,34 @@ export default {
return
{
leftDrawerOpen
:
false
,
//essentialLinks: linksData
tab
:
"navs_1"
tab
:
"navs_1"
,
currentPath
:
""
}
},
watch
:
{
$route
:
{
handler
:
function
(
route
)
{
this
.
currentPath
=
route
.
path
},
immediate
:
true
}
}
},
computed
:
{
...
mapGetters
([
'userInfo'
,
'logo'
,
'name'
]),
},
methods
:
{
logout
()
{
this
.
$store
.
dispatch
(
'LogOut'
)
.
then
(()
=>
{
this
.
$router
.
push
(
'/login'
)
})
.
catch
(()
=>
{})
}
},
}
</
script
>
src/pages/school/manager.vue
0 → 100644
View file @
76aaac5b
<
template
>
<div>
This is school
{{
currentUrl
}}
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
currentUrl
:
""
}
},
mounted
()
{
this
.
currentUrl
=
this
.
$route
.
path
},
}
</
script
>
<
style
>
</
style
>
src/router/routes.js
View file @
76aaac5b
...
...
@@ -13,10 +13,16 @@ const routes = [{
component
:
()
=>
import
(
'layouts/MainLayout.vue'
),
children
:
[{
path
:
''
,
component
:
()
=>
import
(
'pages/Index.vue'
)
}]
path
:
''
,
component
:
()
=>
import
(
'pages/Index.vue'
)
},
{
path
:
'/school/manager'
,
component
:
()
=>
import
(
'pages/school/manager.vue'
)
}
]
},
// Always leave this as last one,
...
...
src/store/getters.js
View file @
76aaac5b
const
getters
=
{
userInfo
:
state
=>
state
.
user
.
userInfo
,
logo
:
state
=>
{
//TODO 根据登录信息返回
return
''
//require('@/assets/img/logo.png')
if
(
state
.
app
.
name
)
{
return
state
.
app
.
name
}
return
require
(
'../assets/images/logo.png'
)
},
name
:
state
=>
{
// if (state.app.name) {
// return state.app.name
// }
//TODO 根据登录信息返回
return
'悟空CRM系统'
if
(
state
.
app
.
name
)
{
return
state
.
app
.
name
}
return
'羚羊教育系统'
},
// 权限
allAuth
:
state
=>
state
.
user
.
allAuth
,
...
...
src/store/index.js
View file @
76aaac5b
...
...
@@ -2,6 +2,7 @@ import Vue from 'vue'
import
Vuex
from
'vuex'
import
user
from
'./modules/user'
import
permission
from
'./modules/permission'
import
app
from
'./modules/app'
import
getters
from
'./getters'
Vue
.
use
(
Vuex
)
...
...
@@ -23,7 +24,8 @@ Vue.use(Vuex)
const
store
=
new
Vuex
.
Store
({
modules
:
{
user
,
permission
permission
,
app
},
getters
,
strict
:
process
.
env
.
DEV
...
...
src/store/modules/app.js
0 → 100644
View file @
76aaac5b
import
Lockr
from
'lockr'
/** 记录 侧边索引 */
const
app
=
{
state
:
{
logo
:
''
,
name
:
''
},
mutations
:
{
SET_APPLOGO
:
(
state
,
logo
)
=>
{
state
.
logo
=
logo
},
SET_APPNAME
:
(
state
,
name
)
=>
{
state
.
name
=
name
}
},
actions
:
{
// 登录
SystemLogoAndName
({
commit
},
{
GroupName
,
GroupLogo
})
{
commit
(
'SET_APPNAME'
,
GroupName
)
commit
(
'SET_APPLOGO'
,
GroupLogo
)
Lockr
.
set
(
'systemLogo'
,
GroupName
)
Lockr
.
set
(
'systemName'
,
GroupLogo
)
}
}
}
export
default
app
\ No newline at end of file
src/store/modules/permission.js
View file @
76aaac5b
...
...
@@ -72,6 +72,7 @@ const permission = {
},
data
)
{
return
new
Promise
(
resolve
=>
{
// TODO 实现权限验证
console
.
log
(
'测试进入'
)
resolve
()
})
}
...
...
src/store/modules/user.js
View file @
76aaac5b
...
...
@@ -7,7 +7,7 @@ const user = {
state
:
{
userInfo
:
null
,
// 用户信息
//TODO 用户权限
allAuth
:
[
'/home'
],
allAuth
:
[
'/home'
,
'/school/manager'
],
},
mutations
:
{
...
...
@@ -36,7 +36,7 @@ const user = {
//Lockr.set("authList", data.auth);
addAuth
(
token
);
// commit("SET_USERINFO", data.use
r);
commit
(
"SET_USERINFO"
,
r
);
// commit('SET_ALLAUTH', data.auth)
// TODO 完成登录 读取权限
resolve
(
data
);
...
...
@@ -60,27 +60,32 @@ const user = {
return
new
Promise
((
resolve
,
reject
)
=>
{
adminUsersRead
()
.
then
(
response
=>
{
commit
(
"SET_USERINFO"
,
response
.
data
);
let
r
=
response
.
Data
delete
r
.
Token
commit
(
"SET_USERINFO"
,
r
);
resolve
(
response
);
})
.
catch
(
error
=>
{
reject
(
error
);
});
});
},
// 登出
LogOut
({
commit
})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
logout
()
.
then
(()
=>
{
/** flush 清空localStorage .rm('authKey') 按照key清除 */
removeAuth
();
resolve
();
})
.
catch
(
error
=>
{
reject
(
error
);
});
// logout()
// .then(() => {
// /** flush 清空localStorage .rm('authKey') 按照key清除 */
// })
// .catch(error => {
// reject(error);
// });
removeAuth
();
resolve
();
});
}
}
...
...
src/utils/auth.js
View file @
76aaac5b
...
...
@@ -7,7 +7,7 @@ import store from '../store'
export
function
removeAuth
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
cache
.
rmAxiosCache
()
store
.
commit
(
'SET_ALLAUTH'
,
null
)
//
store.commit('SET_ALLAUTH', null)
delete
axios
.
defaults
.
headers
[
'Token'
]
resolve
(
true
)
})
...
...
src/utils/cache.js
View file @
76aaac5b
...
...
@@ -24,7 +24,7 @@ const cache = {
updateAxiosCache
:
function
()
{
axios
.
defaults
.
headers
[
'Token'
]
=
Lockr
.
get
(
'Token'
)
//TODO 更新用户信息
//
store.dispatch('GetUserInfo')
store
.
dispatch
(
'GetUserInfo'
)
},
/**
* 移除登录信息
...
...
@@ -32,6 +32,7 @@ const cache = {
*/
rmAxiosCache
:
function
()
{
Lockr
.
rm
(
'Token'
)
Lockr
.
rm
(
'loginUserInfo'
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment