Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
Z
zxn-adputin
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lijin
zxn-adputin
Commits
c35624fb
Commit
c35624fb
authored
May 13, 2025
by
lijin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified
parent
20a3e5ac
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
107 deletions
+55
-107
accountManagement.js
src/api/accountManagement.js
+4
-17
AccountManagement.vue
src/views/promotionManagement/AccountManagement.vue
+51
-90
No files found.
src/api/accountManagement.js
View file @
c35624fb
...
...
@@ -7,7 +7,7 @@ import request from '@/utils/request'
*/
export
function
getAccountList
(
params
)
{
return
request
({
url
:
'/api/account/list
'
,
url
:
process
.
env
.
PUTIN_API
+
'/oauth/google/accounts
'
,
method
:
'get'
,
params
})
...
...
@@ -18,26 +18,13 @@ export function getAccountList(params) {
* @param {Object} data 账号信息
* @returns {Promise}
*/
export
function
deleteAccount
(
data
)
{
export
function
deleteAccount
(
id
)
{
return
request
({
url
:
'/api/account/delete'
,
method
:
'post'
,
data
url
:
process
.
env
.
PUTIN_API
+
`/oauth/google/accounts/
${
id
}
`
,
method
:
'delete'
,
})
}
/**
* 刷新账号授权
* @param {Object} data 账号信息
* @returns {Promise}
*/
export
function
refreshToken
(
data
)
{
return
request
({
url
:
'/api/account/refresh-token'
,
method
:
'post'
,
data
})
}
/**
* 获取Google授权URL
...
...
src/views/promotionManagement/AccountManagement.vue
View file @
c35624fb
...
...
@@ -7,38 +7,37 @@
type=
"primary"
@
click=
"googleAuthorization"
>
Google
</el-button>
<el-button
class=
"authorization-btn"
type=
"primary"
@
click=
"facebookAuthorization"
>
Facebook
</el-button
>
<!--
<el-button-->
<!-- class="authorization-btn"-->
<!-- type="primary"-->
<!-- @click="facebookAuthorization"-->
<!-- >Facebook
</el-button>
--
>
</div>
<!-- 过滤条件区域 -->
<el-form
:inline=
"true"
class=
"filter-container"
>
<el-form-item
label=
"平台"
>
<el-select
v-model=
"condition.platform"
clearable
filterable
@
change=
"getAccountList"
>
<el-option
v-for=
"item in platformList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"账号ID"
>
<el-input
v-model=
"condition.accountId"
placeholder=
"请输入账号ID"
clearable
/>
</el-form-item>
<el-form-item
label=
"账号名称"
>
<el-input
v-model=
"condition.accountName"
placeholder=
"请输入账号名称"
clearable
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"getAccountList"
>
查询
</el-button>
<el-button
@
click=
"resetCondition"
>
重置
</el-button>
</el-form-item>
<!--
<el-form-item
label=
"平台"
>
-->
<!--
<el-select
v-model=
"condition.platform"
clearable
filterable
@
change=
"getAccountList"
>
-->
<!--
<el-option-->
<!-- v-for="item in platformList"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- />-->
<!--
</el-select>
-->
<!--
</el-form-item>
-->
<!--
<el-form-item
label=
"账号ID"
>
-->
<!--
<el-input
v-model=
"condition.accountId"
placeholder=
"请输入账号ID"
clearable
/>
-->
<!--
</el-form-item>
-->
<!--
<el-form-item
label=
"账号名称"
>
-->
<!--
<el-input
v-model=
"condition.accountName"
placeholder=
"请输入账号名称"
clearable
/>
-->
<!--
</el-form-item>
-->
<!--
<el-form-item>
-->
<!--
<el-button
type=
"primary"
@
click=
"getAccountList"
>
查询
</el-button>
-->
<!--
</el-form-item>
-->
</el-form>
<!-- 账户列表表格 -->
...
...
@@ -50,29 +49,28 @@
highlight-current-row
style=
"width: 100%"
>
<el-table-column
prop=
"id"
label=
"序号"
width=
"60"
align=
"center"
/>
<el-table-column
prop=
"accountId"
label=
"账号ID"
align=
"center"
/>
<el-table-column
prop=
"accountName"
label=
"账号名称"
align=
"center"
/>
<el-table-column
prop=
"id"
label=
"ID"
width=
"60"
align=
"center"
/>
<el-table-column
prop=
"username"
label=
"账号名称"
align=
"center"
/>
<el-table-column
prop=
"email"
label=
"账号邮箱"
align=
"center"
/>
<el-table-column
prop=
"platformName"
label=
"平台"
align=
"center"
/
>
<el-table-column
label=
"授权状态"
align=
"center"
>
<template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.status === 1 ? 'success' : 'danger'"
>
{{
scope
.
row
.
status
===
1
?
'正常'
:
'异常'
}}
</el-tag
>
</
template
>
</el-table-column
>
<!--
<el-table-column
prop=
"platformName"
label=
"平台"
align=
"center"
/>
--
>
<!--
<el-table-column
label=
"授权状态"
align=
"center"
>
--
>
<!--
<template
slot-scope=
"scope"
>
--
>
<!--
<el-tag
:type=
"scope.row.status === 1 ? 'success' : 'danger'"
>
--
>
<!--
{{
scope
.
row
.
status
===
1
?
'正常'
:
'异常'
}}
-->
<!--
</el-tag>
--
>
<!--
</
template
>
--
>
<!-- </el-table-column>--
>
<el-table-column
label=
"操作"
width=
"180"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"small"
plain
@
click=
"refreshToken(scope.row)"
:disabled=
"scope.row.status !== 2"
>
刷新授权
</el-button
>
<!--
<el-button-->
<!-- type="primary"-->
<!-- size="small"-->
<!-- plain-->
<!-- @click="refreshToken(scope.row)"-->
<!-- :disabled="scope.row.status !== 2"-->
<!-- >--
>
<!-- 刷新授权-->
<!--
</el-button>
--
>
<el-button
type=
"danger"
size=
"small"
...
...
@@ -85,17 +83,6 @@
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
background
:total=
"totalNum"
:page-size=
"condition.size"
:current-page=
"condition.offset"
style=
"text-align: right; margin-top: 15px"
layout=
"total, prev, pager, next, sizes"
@
current-change=
"handleCurrentChange"
@
size-change=
"handleSizeChange"
/>
</div>
</template>
...
...
@@ -127,7 +114,7 @@ export default {
listLoading
:
false
}
},
crea
ted
()
{
moun
ted
()
{
// 初始化加载数据
this
.
getAccountList
()
},
...
...
@@ -137,9 +124,8 @@ export default {
this
.
listLoading
=
true
try
{
const
res
=
await
getAccountList
(
this
.
condition
)
if
(
res
.
code
===
200
)
{
this
.
tableData
=
res
.
data
.
list
||
[]
this
.
totalNum
=
res
.
data
.
total
||
0
if
(
res
.
status
===
200
)
{
this
.
tableData
=
res
.
result
.
data
||
[]
}
else
{
this
.
$message
.
error
(
res
.
message
||
'获取账号列表失败'
)
}
...
...
@@ -205,8 +191,8 @@ export default {
type
:
'warning'
}).
then
(
async
()
=>
{
try
{
const
res
=
await
deleteAccount
(
{
accountId
:
row
.
accountId
,
platform
:
row
.
platform
}
)
if
(
res
.
code
===
200
)
{
const
res
=
await
deleteAccount
(
row
.
id
)
if
(
res
.
status
===
200
)
{
this
.
$message
.
success
(
'删除成功'
)
this
.
getAccountList
()
}
else
{
...
...
@@ -220,31 +206,6 @@ export default {
// 取消删除
})
},
// 重置查询条件
resetCondition
()
{
this
.
condition
=
{
platform
:
''
,
accountId
:
''
,
accountName
:
''
,
offset
:
1
,
size
:
10
}
this
.
getAccountList
()
},
// 页码变化
handleCurrentChange
(
page
)
{
this
.
condition
.
offset
=
page
this
.
getAccountList
()
},
// 每页显示条数变化
handleSizeChange
(
size
)
{
this
.
condition
.
size
=
size
this
.
condition
.
offset
=
1
this
.
getAccountList
()
}
}
}
</
script
>
...
...
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