Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
ka-op-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
ka-op-ui
Commits
f066fbf9
Commit
f066fbf9
authored
Aug 08, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试版本
parent
ee8e2e36
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
28 deletions
+50
-28
login.js
src/api/login.js
+6
-6
index.js
src/router/index.js
+1
-1
user.js
src/store/modules/user.js
+4
-3
index.vue
src/views/channel/index.vue
+30
-15
Navbar.vue
src/views/layout/components/Navbar.vue
+9
-3
No files found.
src/api/login.js
View file @
f066fbf9
...
...
@@ -2,8 +2,8 @@ import request from '@/utils/request'
export
function
login
(
username
,
password
)
{
return
request
({
//
url: '/mock/229/login',
url
:
'
/user/login
'
,
url
:
'
/mock/229/login
'
,
//
url: '/user/login',
method
:
'
post
'
,
data
:
{
username
,
...
...
@@ -14,8 +14,8 @@ export function login(username, password) {
export
function
getInfo
(
token
)
{
return
request
({
url
:
'
/user/info
'
,
//
url: '/mock/229/user/detail/info',
//
url: '/user/info',
url
:
'
/mock/229/user/detail/info
'
,
method
:
'
get
'
,
params
:
{
token
}
})
...
...
@@ -23,7 +23,7 @@ export function getInfo(token) {
export
function
logout
()
{
return
request
({
url
:
'
/
user
/logout
'
,
method
:
'
post
'
url
:
'
/
mock/229
/logout
'
,
method
:
'
delete
'
})
}
src/router/index.js
View file @
f066fbf9
...
...
@@ -61,7 +61,7 @@ export const constantRouterMap = [
path
:
''
,
name
:
'
User
'
,
component
:
()
=>
import
(
'
@/views/user/index
'
),
meta
:
{
title
:
'
常用操作
'
,
icon
:
'
eye
'
}
meta
:
{
title
:
'
常用操作
'
,
icon
:
'
user
'
}
}
]
},
...
...
src/store/modules/user.js
View file @
f066fbf9
...
...
@@ -31,7 +31,7 @@ const user = {
return
new
Promise
((
resolve
,
reject
)
=>
{
login
(
username
,
userInfo
.
password
).
then
(
response
=>
{
const
data
=
response
.
data
setToken
(
data
.
token
||
'
admin-token
'
)
setToken
(
data
.
token
)
commit
(
'
SET_TOKEN
'
,
data
.
token
)
resolve
()
}).
catch
(
error
=>
{
...
...
@@ -45,13 +45,14 @@ const user = {
return
new
Promise
((
resolve
,
reject
)
=>
{
getInfo
(
state
.
token
).
then
(
response
=>
{
const
data
=
response
.
data
// data.roles = ['test']
// data.roles = data.roleInfo.role
data
.
roles
=
data
.
userInfo
.
userName
.
length
>
10
?
[
'
admin
'
]
:
[
'
channel
'
]
if
(
data
.
roles
&&
data
.
roles
.
length
>
0
)
{
// 验证返回的roles是否是一个非空数组
commit
(
'
SET_ROLES
'
,
data
.
roles
)
}
else
{
reject
(
'
getInfo: roles must be a non-null array !
'
)
}
commit
(
'
SET_NAME
'
,
data
.
n
ame
)
commit
(
'
SET_NAME
'
,
data
.
userInfo
.
userN
ame
)
commit
(
'
SET_AVATAR
'
,
data
.
avatar
)
resolve
(
response
)
}).
catch
(
error
=>
{
...
...
src/views/channel/index.vue
View file @
f066fbf9
<
template
>
<div
class=
"app-container"
>
<div
class=
"filter-container"
style=
"padding-bottom:20px"
>
<el-input
v-model=
"listQuery.channelId"
placeholder=
"渠道"
clearable
style=
"width: 200px;"
class=
"filter-item"
@
keyup.enter.native=
"getChannels"
/>
<el-input
v-permission=
"['admin']"
v-model=
"listQuery.channelId"
placeholder=
"渠道"
clearable
style=
"width: 200px;"
class=
"filter-item"
@
keyup.enter.native=
"getChannels"
/>
<el-select
v-permission=
"['channel']"
v-model=
"listQuery.channelId"
placeholder=
"渠道"
clearable
style=
"width: 200px"
class=
"filter-item"
>
<el-option
v-for=
"item in channels"
:key=
"item.channelId"
:label=
"item.channelName"
:value=
"item.channelId"
/>
</el-select>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"getChannels"
>
查询
</el-button>
<!--
<el-button
class=
"filter-item"
style=
"margin-left: 10px;"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleCreate"
>
添加
</el-button>
-->
</div>
...
...
@@ -37,7 +41,7 @@
<el-card
class=
"box-card"
>
<el-card
v-show=
"channel.basicInfo.channelId"
class=
"box-card"
style=
"margin-bottom:20px;float:left;width:45%;margin-right:1%"
>
<el-card
v-
permission=
"['admin']"
v-
show=
"channel.basicInfo.channelId"
class=
"box-card"
style=
"margin-bottom:20px;float:left;width:45%;margin-right:1%"
>
<div
slot=
"header"
>
<span>
基础配置
</span>
</div>
...
...
@@ -51,28 +55,30 @@
<el-form-item
label=
"渠道名称"
style=
"width:30%"
>
<el-input
v-model=
"channel.basicInfo.channelName"
/>
</el-form-item>
<el-form-item
label=
"环境"
style=
"width:30%"
>
<el-input
v-model=
"channel.basicInfo.env"
/>
</el-form-item>
<el-form-item
label=
"存管资金方"
style=
"width:30%"
>
<el-input
v-model=
"channel.basicInfo.fundId"
/>
</el-form-item>
<el-form-item
label=
"非存管资金方"
style=
"width:30%"
>
<el-input
v-model=
"channel.basicInfo.p2pFundId"
/>
</el-form-item>
<el-form-item
label=
"业务类型"
style=
"width:30%"
>
<el-input
v-model=
"channel.basicInfo.bizType"
/>
</el-form-item>
<el-form-item
label=
"授信code"
style=
"width:30%"
>
<el-input
v-model=
"channel.basicInfo.authCode"
/>
</el-form-item>
<el-form-item
label=
"爬虫code"
style=
"width:30%"
>
<el-input
v-model=
"channel.basicInfo.riskCode"
/>
</el-form-item>
<el-form-item
label=
"存管资金方"
style=
"width:30%"
>
<el-input
v-model=
"channel.basicInfo.fundId"
/>
</el-form-item>
<el-form-item
label=
"非存管资金方"
style=
"width:30%"
>
<el-input
v-model=
"channel.basicInfo.p2pFundId"
/>
</el-form-item>
</el-form>
<el-form
size=
"medium"
label-width=
"50px"
>
<el-form-item
label=
"环境"
>
<el-input
v-model=
"channel.basicInfo.env"
/>
</el-form-item>
<el-form-item
label=
"AES"
>
<el-input
v-model=
"channel.basicInfo.aesKey"
:autosize=
"{ minRows: 2, maxRows: 4}"
type=
"textarea"
/>
</el-form-item>
...
...
@@ -82,14 +88,15 @@
</el-form>
</el-card>
<el-card
class=
"box-card"
style=
"width:54%"
>
<!-- <el-card :style="boxStyle" class="box-card" > -->
<el-card
style=
"overflow:hidden"
class=
"box-card"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
渠道自定义配置
</span>
<!-- <el-button style="float: right; padding: 2px 0" type="text" @click="savevData">保存 </el-button> -->
</div>
<el-form
size=
"medium"
label-width=
"130px"
>
<el-form-item
label=
"域名"
>
<el-input
v-model=
"channel.addInfo.envUrl"
/>
<el-input
v-model=
"channel.addInfo.envUrl"
disabled=
""
/>
</el-form-item>
<el-form-item
label=
"审核状态通知地址"
>
<el-input
v-model=
"channel.addInfo.approveCallBackUrl"
/>
...
...
@@ -117,6 +124,7 @@
<
script
>
import
{
getChannels
,
getChannelDetail
,
saveChannel
}
from
'
@/api/channel
'
import
store
from
'
@/store
'
import
Pagination
from
'
@/components/Pagination
'
import
permission
from
'
@/directive/permission/index.js
'
// 权限判断指令
...
...
@@ -133,11 +141,13 @@ export default {
channels
:
[],
channel
:
{
basicInfo
:
{},
addInfo
:
{}},
count
:
undefined
,
page
:
1
page
:
1
,
roles
:
undefined
}
},
created
()
{
this
.
getChannels
()
this
.
roles
=
store
.
getters
.
roles
},
methods
:
{
getChannels
()
{
...
...
@@ -162,6 +172,11 @@ export default {
})
},
boxStyle
()
{
const
boxStyle
=
this
.
roles
.
include
(
'
admin
'
)
?
{
width
:
'
54%
'
}
:
{
width
:
'
100%
'
}
return
boxStyle
},
// handleCreate() {
// this.resetTemp()
// this.dialogStatus = 'create'
...
...
src/views/layout/components/Navbar.vue
View file @
f066fbf9
...
...
@@ -2,9 +2,11 @@
<div
class=
"navbar"
>
<hamburger
:toggle-click=
"toggleSideBar"
:is-active=
"sidebar.opened"
class=
"hamburger-container"
/>
<breadcrumb
/>
<el-dropdown
class=
"avatar-container"
trigger=
"click"
>
<div
class=
"avatar-wrapper"
>
<img
:src=
"avatar+'?imageView2/1/w/80/h/80'"
class=
"user-avatar"
>
<div
class=
"avatar-wrapper"
style=
"font-size:large;padding:10px 0"
>
{{
loginName
}}
<!--
<img
:src=
"avatar+'?imageView2/1/w/80/h/80'"
class=
"user-avatar"
>
-->
<i
class=
"el-icon-caret-bottom"
/>
</div>
<el-dropdown-menu
slot=
"dropdown"
class=
"user-dropdown"
>
...
...
@@ -31,6 +33,11 @@ export default {
Breadcrumb
,
Hamburger
},
data
()
{
return
{
loginName
:
this
.
$store
.
getters
.
name
}
},
computed
:
{
...
mapGetters
([
'
sidebar
'
,
...
...
@@ -92,4 +99,3 @@ export default {
}
}
</
style
>
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