wjx 2 éve
szülő
commit
5d1e5ef27c

+ 147 - 0
src/api/accounts/ttAdapi.js

@@ -0,0 +1,147 @@
+import request from '@/utils/request'
+
+
+/**
+ * 获取所有应用
+ * @returns 
+ */
+export function getAdApp() {
+    return request({
+        url: '/oceanengine/adApp/all',
+        method: 'GET'
+    })
+}
+
+/**
+ * 新增应用列表
+ * @returns 
+ */
+export function addAdApp(data) {
+    return request({
+        url: '/oceanengine/adApp',
+        method: 'POST',
+        data
+    })
+}
+
+/**
+ * 修改应用列表
+ * @param {*} params 
+ * @returns 
+ */
+export function editAdApp(params) {
+    let { id, ...data } = params
+    return request({
+        url: `/oceanengine/adApp/${id}`,
+        method: 'PUT',
+        data
+    })
+}
+
+/**
+ * 修改应用状态
+ * @param {Number} id 
+ * @param {Boolean} enabled 
+ * @returns 
+ */
+export function editAdAppEnabled(id, enabled) {
+    return request({
+        url: `/oceanengine/adApp/modifyEnabled/${id}/${enabled}`,
+        method: 'PUT'
+    })
+}
+
+/**
+ * 删除应用
+ * @param {Number} id 
+ * @returns 
+ */
+export function delAdApp(id) {
+    return request({
+        url: `/oceanengine/adApp/${id}`,
+        method: 'DELETE'
+    })
+}
+
+
+/**
+ * 主表格数据
+ * @param {*} data 
+ * @returns 
+ */
+export function getAuthUserList(data) {
+    return request({
+        url: `/oceanengine/authUser/list`,
+        method: 'POST',
+        data
+    })
+}
+
+
+/**
+ * 主表格详细一条数据表格
+ * @param {*} data 
+ * @returns 
+ */
+export function getAdAccountList(data) {
+    return request({
+        url: `/oceanengine/adAccount/list`,
+        method: 'POST',
+        data
+    })
+}
+
+/**
+ * 授权
+ * @param {*} adAppId 
+ * @param {*} callbackPage 
+ * @returns 
+ */
+export function toAuthUser(data) {
+    let { adAppId, callbackPage } = data
+    return request({
+        url: `/oceanengine/authUser/toAuth?adAppId=${adAppId}&callbackPage=${callbackPage}`,
+        method: 'POST'
+    })
+}
+
+/**
+ * 回调接口
+ * @param {*} data 
+ * @returns 
+ */
+export function doAuthUser(data) {
+    let { state, auth_code } = data
+    return request({
+        url: `/oceanengine/authUser/doAuth?state=${state}&auth_code=${auth_code}`,
+        method: 'POST'
+    })
+}
+
+/**
+ * 刷新广告账户
+ * @param {*} adAppId 
+ * @param {*} authUserId 
+ * @returns 
+ */
+export function refreshUser(adAppId, authUserId) {
+    return request({
+        url: `/oceanengine/authUser/refreshAccount/${adAppId}/${authUserId}`,
+        method: 'PUT'
+    })
+}
+
+
+/**
+ * 配置投手
+ * @param {*} adAppId 
+ * @param {*} authUserId 
+ * @param {*} putUserId 
+ * @returns 
+ */
+export function putUser(adAppId, authUserId, putUserId) {
+    return request({
+        url: `/oceanengine/authUser/configPutUser/${adAppId}/${authUserId}/${putUserId}`,
+        method: 'PUT'
+    })
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
src/assets/icons/svg/stt.svg


+ 5 - 0
src/router/index.js

@@ -75,6 +75,11 @@ export const constantRoutes = [
     component: (resolve) => require(['@/views/ad'], resolve),
     hidden: true
   },
+  {
+    path: '/ttAdCode',
+    component: (resolve) => require(['@/views/ttAd'], resolve),
+    hidden: true
+  },
   {
     path: '/user',
     component: Layout,

+ 1 - 0
src/views/accounts/account/components/changeRecord.vue

@@ -141,6 +141,7 @@
                         <el-option label="GDT" value="GDT" />
                         <el-option label="头条" value="头条" />
                         <el-option label="企微" value="企微" />
+                        <el-option label="混投" value="混投" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="充值模板" prop="rechargeTemplate">

+ 1 - 0
src/views/accounts/account/components/cutBook.vue

@@ -45,6 +45,7 @@
                         <el-option label="GDT" value="GDT" />
                         <el-option label="头条" value="头条" />
                         <el-option label="企微" value="企微" />
+                        <el-option label="混投" value="混投" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="充值模板" prop="rechargeTemplate">

+ 1 - 0
src/views/accounts/account/index.vue

@@ -318,6 +318,7 @@
                         <el-option label="GDT" value="GDT" />
                         <el-option label="头条" value="头条" />
                         <el-option label="企微" value="企微" />
+                        <el-option label="混投" value="混投" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="充值模板" prop="rechargeTemplate" v-if="isAdd">

+ 1 - 0
src/views/accounts/account/use.vue

@@ -389,6 +389,7 @@
             <el-option label="GDT" value="GDT" />
             <el-option label="头条" value="头条" />
             <el-option label="企微" value="企微" />
+            <el-option label="混投" value="混投" />
           </el-select>
         </el-form-item>
         <el-form-item label="充值模板" prop="rechargeTemplate" v-if="isAdd">

+ 4 - 4
src/views/accounts/adWarrant/index.vue

@@ -413,7 +413,7 @@
 </template>
 
 <script>
-import { listAd, toAuth, editAdMp, refreshByIds, deleteAdMp, getAdt, switchAcc, switchBook, switchPitcher, switchPlatform, getAdAppList, addApp, editApp, getAdAppListAll, cutPut } from "@/api/accounts/adApi";
+import { listAd, toAuth, refreshByIds, getAdAppList, addApp, editApp, getAdAppListAll, cutPut } from "@/api/accounts/adApi";
 import { getAllBook } from "@/api/system/books";
 import { getPeriodAll } from "@/api/accounts/period";
 import { allUser } from "@/api/system/user";
@@ -577,9 +577,9 @@ export default {
         warrantsHandle() {
             console.log(1111);
             this.warrantsShow = true
-            this.$nextTick(() => {
-                this.$set(this.queryWarrants, 'adAppIds', this.tenAllList.map(item => item.id))
-            })
+            // this.$nextTick(() => {
+            //     this.$set(this.queryWarrants, 'adAppIds', this.tenAllList.map(item => item.id))
+            // })
         },
         /** 刷新服务商 */
         refreshServer() {

+ 232 - 0
src/views/accounts/ttAdWarrant/appManage.vue

@@ -0,0 +1,232 @@
+<template>
+    <div>
+        <el-button type="primary" size="mini" @click="handleEdit" >头条广告应用管理</el-button>
+        <el-dialog 
+            title="头条广告应用管理"
+            :visible.sync="visible"
+            width="950px"
+        >
+            <el-form :model="queryForm" ref="ttqueryForm" :inline="true">
+                <el-form-item>
+                    <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">刷新</el-button>
+                    <el-button type="primary" icon="el-icon-plus" size="mini" @click="addApp">新建</el-button>
+                </el-form-item>
+            </el-form>
+            <el-table :data="appList" v-loading="loading">
+                <el-table-column label="应用名称" prop="appName" align="center" width="90"/>
+                <el-table-column label="应用ID" prop="appId" align="center" width="150"/>
+                <el-table-column label="应用密钥" prop="appSecret" align="center"/>
+                <el-table-column label="归属" prop="useType" align="center" width="90">
+                    <template slot-scope="scope">
+                        <div>{{scope.row.useType === 0 ? '数据系统' : scope.row.useType === 1 ? '监控系统' : scope.row.useType === 2 ? '游戏数据' : '其它'}}</div>
+                    </template>
+                </el-table-column>
+                <el-table-column label="Enable?" prop="enabled" align="center" width="90">
+                    <template slot-scope="scope">
+                        <el-switch
+                            v-model="scope.row.enabled"
+                            @change="handleStatusChange(scope.row)"
+                        ></el-switch>
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
+                    <template slot-scope="scope" v-if="scope.row.id && typeof scope.row.id === 'number'">
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-edit"
+                            @click="handleEditApp(scope.row)"
+                        >编辑</el-button>
+                        <el-button
+                            size="mini"
+                            type="text"
+                            icon="el-icon-delete-solid"
+                            style="color: red"
+                            @click="handleDel(scope.row)"
+                        >删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <!-- <span slot="footer" class="dialog-footer">
+                <el-button @click="openTenEditSwitch = false">关 闭</el-button>
+            </span> -->
+        </el-dialog>
+
+        <el-dialog 
+            title="新增头条广告应用"
+            :visible.sync="addVisible"
+            width="350px"
+        >
+            <el-form :model="addQueryForm" ref="addqueryForm" :rules="rules">
+                <el-form-item label="应用名称" prop="appName">
+                    <el-input
+                        v-model="addQueryForm.appName"
+                        placeholder="应用名称"
+                        clearable
+                        size="small"
+                    />
+                </el-form-item>
+                <el-form-item label="应用ID" prop="appId">
+                    <el-input
+                        v-model.number="addQueryForm.appId"
+                        placeholder="请输入应用ID"
+                        clearable
+                        size="small"
+                    />
+                </el-form-item>
+                <el-form-item label="应用密钥" prop="appSecret">
+                    <el-input
+                        v-model="addQueryForm.appSecret"
+                        placeholder="请输入应用密钥"
+                        clearable
+                        size="small"
+                    />
+                </el-form-item>
+                <el-form-item label="Enable?" prop="enabled">
+                    <el-switch v-model="addQueryForm.enabled"></el-switch>
+                </el-form-item>
+                <el-form-item label="归属" prop="useType">
+                    <el-select v-model="addQueryForm.useType" placeholder="请选择" size="small">
+                        <el-option label="数据系统" value="0"></el-option>
+                        <el-option label="监控系统" value="1"></el-option>
+                        <el-option label="游戏数据" value="2"></el-option>
+                        <el-option label="其它" value="-1"></el-option>
+                    </el-select>
+                </el-form-item>
+            </el-form>
+
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="addVisible = false">取 消</el-button>
+                <el-button type="primary" @click="onSubmitSwitch()">确 定</el-button>
+            </span>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import { getAdApp, addAdApp, editAdApp, editAdAppEnabled, delAdApp } from "@/api/accounts/ttAdapi";
+export default {
+    data () {
+        return {
+            visible: false,
+            queryForm: {
+                enabled: true
+            },
+            appList: [],
+            loading: false,
+
+            addVisible: false,
+            addQueryForm: {},
+            rules: {
+                appName: [ { required: true, message: '请输入应用名称', trigger: 'blur' } ],
+                appId: [
+                    { required: true, message: '请输入应用ID', trigger: 'blur' },
+                    { type: 'number', message: '应用ID必须为数字值'}
+                ],
+                appSecret: [ { required: true, message: '请输入应用密钥', trigger: 'blur' } ],
+                enabled: [ { required: true, message: '请选择是否可用', trigger: 'blur' } ],
+                useType: [ { required: true, message: '请选择归属', trigger: 'blur' } ]
+            },
+        }
+    },
+    props: {
+
+    },
+    watch: {
+        visible(val) {
+            if (!val) {
+                this.$emit("onChange");
+            }
+        }
+    },
+    methods: {
+        /** 显示隐藏 */
+        handleEdit() {
+            this.visible = true;
+            this.getList()
+        },
+        /** 获取数据 */
+        getList() {
+            this.loading = true;
+            getAdApp().then(res => {
+                this.loading = false
+                this.appList = res.data
+            }).catch(err => this.loading = false)
+        },
+        /** 搜索 */
+        handleQuery() {
+            this.getList()
+        },
+        /** 新建按钮 */
+        addApp() {
+            this.addQueryForm = { enabled: true }
+            this.addVisible = true
+        },
+        /** 新增应用 */
+        onSubmitSwitch() {
+            this.$refs['addqueryForm'].validate((valid) => {
+                if (valid) {
+                    console.log(this.addQueryForm);
+                    if (this.addQueryForm.id) {
+                        editAdApp(this.addQueryForm).then(res => {
+                            if(res.data){
+                                this.msgSuccess("修改成功");
+                                this.addVisible = false
+                                this.getList()
+                            }else{
+                                console.error(res)
+                            }
+                        })
+                    } else {
+                        addAdApp(this.addQueryForm).then(res => {
+                            if(res.data){
+                                this.msgSuccess("新增成功");
+                                this.addVisible = false
+                                this.getList()
+                            }else{
+                                console.error(res)
+                            }
+                        })
+                    }
+                }
+            })
+        },
+        /** 编辑应用 */
+        handleEditApp(row) {
+            this.addQueryForm = { ...row, useType: row.useType.toString() }
+            this.addVisible = true
+        },
+        /** 修改状态 */
+        handleStatusChange(row) {
+            let text = row.enabled ? "启用" : "停用";
+            this.$confirm('确认要"' + text + '""' + row.appName + '"应用吗?', "警告", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(function() {
+                return editAdAppEnabled(row.id, row.enabled);
+            }).then(() => {
+                this.msgSuccess(text + "成功");
+            }).catch(function() {
+                row.enabled = row.enabled ? false : true;
+            });
+        },
+        /** 删除应用 */
+        handleDel(row) {
+            this.$confirm('确定删除?', '删除', {
+                distinguishCancelAndClose: true,
+                confirmButtonText: '确定',
+                cancelButtonText: '取消'
+            }).then(() => {
+                delAdApp(row.id).then(res => {
+                    if(res.data) {
+                        this.msgSuccess('删除成功');
+                        this.getList()
+                    }
+                })
+            })
+            
+        },
+    }
+}
+</script>

+ 162 - 0
src/views/accounts/ttAdWarrant/index.vue

@@ -0,0 +1,162 @@
+<template>
+    <div class="app-container">
+
+        <el-row :gutter="10" class="mb8" align="middle">
+            <el-col :span="1.5">
+                <div class="grid-content">
+                    <el-radio-group v-model="queryParams.adAppId" size="small" @change="getList">
+                        <el-radio :label="item.id" v-for="item in allList" :key="item.id">{{item.appName}}</el-radio>
+                    </el-radio-group>
+                </div>
+            </el-col>
+            <el-col :span="1.5">
+                <div class="grid-content">
+                    <el-button
+                        type="primary"
+                        icon="el-icon-plus"
+                        size="mini"
+                        @click="handleWarrantOld"
+                    >授权广告平台</el-button>
+                </div>
+            </el-col>
+            <el-col :span="1.5">
+                <div class="grid-content">
+                    <app-manage @onChange="getAll()"/>
+                </div>
+            </el-col>
+            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :isshowSearch="false"></right-toolbar>
+        </el-row>
+
+        <el-table :data="adList">
+            <el-table-column label="广告应用ID" prop="adAppId" align="center" fixed/>
+            <el-table-column label="授权人ID" prop="createBy" align="center"/>
+            <el-table-column label="投手ID" prop="sysUserId" align="center"/>
+            <el-table-column label="企业ID" prop="companyId" align="center"/>
+            <el-table-column label="授权用户ID" prop="authUserId" align="center" :show-overflow-tooltip="true"/>
+            <el-table-column label="邮箱" prop="email" align="center" :show-overflow-tooltip="true"/>
+            <el-table-column label="账号" prop="displayName" align="center" :show-overflow-tooltip="true"/>
+            <!-- <el-table-column label="accessToken" prop="accessToken" align="center" width="200">
+                <template slot-scope="scope">
+                    <el-tooltip placement="top" effect="light">
+                        <div slot="content">{{scope.row.accessToken}}</div>
+                        <div class="name-wrapper">
+                            <p>{{ scope.row.accessToken }}</p>
+                        </div>
+                    </el-tooltip>
+                </template>
+            </el-table-column>
+            <el-table-column label="refreshToken" prop="refreshToken" align="center" width="200">
+                <template slot-scope="scope">
+                    <el-tooltip placement="top" effect="light">
+                        <div slot="content">{{scope.row.refreshToken}}</div>
+                        <div class="name-wrapper">
+                            <p>{{ scope.row.refreshToken }}</p>
+                        </div>
+                    </el-tooltip>
+                </template>
+            </el-table-column> -->
+            <el-table-column label="授权时间" align="center" prop="createTime" width="150">
+                <template slot-scope="scope">
+                    <span>{{ parseTime(scope.row.createTime) }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="250">
+                <template slot-scope="scope">
+                    <!-- 指派 -->
+                    <put-user-button :adAppId="queryParams.adAppId" :authUserId="scope.row.authUserId" :putUserId="scope.row.sysUserId" @onChange="getList()"/>
+                    <!-- 刷新账户 -->
+                    <refresh-user-button :adAppId="queryParams.adAppId" :authUserId="scope.row.authUserId" @onChange="getList()"/>
+                    <!-- 查看账户 -->
+                    <look-account-button :adAppId="queryParams.adAppId" :authUserId="scope.row.authUserId" />
+                </template>
+            </el-table-column>
+        </el-table>
+
+        <pagination
+            v-show="total>0"
+            :total="total"
+            :page.sync="queryParams.pageNum"
+            :limit.sync="queryParams.pageSize"
+            @pagination="getList"
+        />
+    </div>
+</template>
+
+
+<script>
+import { getAdApp, getAuthUserList, toAuthUser } from "@/api/accounts/ttAdapi";
+import appManage from "./appManage.vue"
+import refreshUserButton from "./refreshUserButton.vue"
+import putUserButton from "./putUserButton.vue"
+import lookAccountButton from "./lookAccountButton.vue"
+export default {
+    components: { appManage, refreshUserButton, putUserButton, lookAccountButton },
+    data () {
+        return {
+            queryParams: {
+                pageNum: 1,
+                pageSize: 10,
+            },
+            total: 0,
+            showSearch: true,
+            // 所有授权平台
+            allList: [],
+            adList: [],
+            // 表格选中ID
+            ids: [],
+            // 总修改按钮控制 非多个禁用
+            multiple: true
+        }
+    },
+    created() {
+        this.getAll()
+    },
+    mounted(){
+        window.addEventListener('storage', (e) => {
+            if (e.key === 'ttAdMp') {
+                if (e.newValue === 'ok') {
+                    this.getList()
+                    this.msgSuccess("授权成功");
+                    localStorage.removeItem('ttAdMp')
+                } else {
+                    this.$message.error('授权失败');
+                    localStorage.removeItem('ttAdMp')
+                }
+            }
+        })
+    },
+    methods: {
+        /** 获取所有应用 */
+        getAll() {
+            getAdApp().then(res => {
+                if (res.data.length > 0) {
+                    this.allList = res.data
+                    this.queryParams.adAppId = res.data[0].id
+                    this.getList()
+                } else {
+                    this.allList = []
+                }
+            })
+        },
+        /** 获取数据 */
+        getList() {
+            this.loading = true
+            getAuthUserList(this.queryParams).then(res => {
+                console.log('res.data.records---->', res.data.records);
+                this.total = res.data.total
+                this.adList = res.data.records
+                this.loading = false
+            }).catch(() => this.loading = false)
+        },
+        /** 授权 */
+        handleWarrantOld() {
+            toAuthUser({ adAppId: this.queryParams.adAppId, callbackPage: encodeURIComponent(window.location.origin + '/ttAdCode') }).then(res => {
+            // toAuthUser({ adAppId: this.queryParams.adAppId, callbackPage: encodeURIComponent('http://erp.zanxiangnet.com/ttAdCode') }).then(res => {
+                if (res.data) {
+                    window.open(res.data)
+                }
+            })
+        },
+    }
+}
+</script>

+ 63 - 0
src/views/accounts/ttAdWarrant/lookAccountButton.vue

@@ -0,0 +1,63 @@
+<template>
+    <el-button size="mini" type="text" icon="el-icon-view" @click="lookHangdle()">
+        <span>查看账号</span>
+        <el-dialog :title="'查看 ' + authUserId" :visible.sync="visible" width="780px" append-to-body v-if="visible">
+            <el-table :data="accountList" :loading="loading">
+                <el-table-column label="账号名称" prop="accountName" align="center" fixed :show-overflow-tooltip="true"/>
+                <el-table-column label="账号ID" prop="accountId" align="center" fixed :show-overflow-tooltip="true"/>
+            </el-table>
+            <pagination
+                v-show="total > 0"
+                :total="total"
+                :page.sync="queryParams.pageNum"
+                :limit.sync="queryParams.pageSize"
+                @pagination="getList"
+            />
+        </el-dialog>
+    </el-button>
+</template>
+<script>
+import { getAdAccountList } from "@/api/accounts/ttAdapi";
+export default {
+    data () {
+        return {
+            visible: false,
+            loading: false,
+            queryParams: {
+                pageNum: 1,
+                pageSize: 10,
+            },
+            accountList: [],
+            total: 0
+        }
+    },
+    props: {
+        adAppId: {
+            type: Number,
+            default: null,
+        },
+        authUserId: {
+            type: Number,
+            default: null,
+        }
+    },
+    methods: {
+        lookHangdle() {
+            this.visible = true
+            this.queryParams.pageNum = 1
+            this.getList()
+        },
+        getList() {
+            if (this.adAppId && this.authUserId) {
+                let params = { ...this.queryParams, adAppId: this.adAppId, authUserId: this.authUserId }
+                this.loading = true
+                getAdAccountList(params).then(res => {
+                    this.loading = false
+                    this.accountList = res.data.records
+                    this.total = res.data.total
+                }).catch(() => this.loading = false)
+            }
+        }
+    }
+}
+</script>

+ 92 - 0
src/views/accounts/ttAdWarrant/putUserButton.vue

@@ -0,0 +1,92 @@
+<template>
+    <el-button size="mini" type="text" icon="el-icon-sort" @click="putHangdle()">
+        <span>指派</span>
+        <el-dialog title="指派投手" :visible.sync="visible" width="450px" append-to-body>
+            <el-form :model="paramsForm" :rules="rulesType" ref="platFormPut" label-width="80px" label-position="top">
+                <el-form-item label="用户" prop="putUserId">
+                    <el-select v-model="paramsForm.putUserId" clearable placeholder="请选择" filterable style="width: 100%">
+                        <el-option v-for="item in userAll" :key="item.id" :label="item.nickName" :value="item.id" />
+                    </el-select>
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="paramsForm = {}; visible = false">取 消</el-button>
+                <el-button type="primary" @click="onSubmit('platFormPut')" :loading="loading">确 定</el-button>
+            </span>
+        </el-dialog>
+    </el-button>
+</template>
+<script>
+/**
+ * 指派投手
+ */
+import { allUser } from "@/api/system/user";
+import { putUser } from "@/api/accounts/ttAdapi";
+export default {
+    data() {
+        return {
+            visible: false,
+            rulesType: {
+                putUserId: [
+                    { required: true, message: '请选择投手', trigger: 'blur' }
+                ]
+            },
+            paramsForm: {},
+            userAll: [],
+            loading: false
+        }
+    },
+    props: {
+        adAppId: {
+            type: Number,
+            default: null,
+        },
+        authUserId: {
+            type: Number,
+            default: null,
+        },
+        putUserId: {
+            type: Number,
+            default: null,
+        }
+    },
+    methods: {
+        putHangdle() {
+            this.getUserAllHandle()
+            this.paramsForm.putUserId = this.putUserId
+            this.visible = true
+        },
+        onSubmit(val) {
+            this.$refs[val].validate((valid) => {
+                if (valid && this.adAppId && this.authUserId) {
+                    this.loading = true
+                    putUser(this.adAppId, this.authUserId, this.paramsForm.putUserId).then(res => {
+                        this.loading = false
+                        if (res.data) {
+                            this.$message({
+                                showClose: true,
+                                message: '指派成功',
+                                type: 'success',
+                                onClose: () => {
+                                    this.$emit("onChange");
+                                    this.visible = false
+                                }
+                            });
+                            
+                        }
+                    }).catch(() => this.loading = false)
+                }
+            })
+        },
+        getUserAllHandle() {
+            // 所有用户
+            allUser().then(response => {
+                let data = response.data
+                this.userAll = data.map((item) => {
+                    return { id: item.userId, nickName: item.nickname }
+                })
+            })
+        }
+    }
+}
+</script>

+ 50 - 0
src/views/accounts/ttAdWarrant/refreshUserButton.vue

@@ -0,0 +1,50 @@
+<template>
+    <el-button size="mini" type="text" icon="el-icon-refresh" :loading="loading"
+        @click="refreshUserhangdle()">刷新应用</el-button>
+</template>
+
+<script>
+import { refreshUser } from "@/api/accounts/ttAdapi";
+/**
+ * 刷新广告账户
+ */
+export default {
+    data() {
+        return {
+            loading: false
+        }
+    },
+    props: {
+        adAppId: {
+            type: Number,
+            default: null,
+        },
+        authUserId: {
+            type: Number,
+            default: null,
+        }
+    },
+    methods: {
+        /** 刷新广告账户 */
+        refreshUserhangdle() {
+            if (this.adAppId && this.authUserId) {
+                this.$confirm('确定刷新?', `刷新${this.authUserId}`, {
+                    distinguishCancelAndClose: true,
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消'
+                }).then(() => {
+                    this.loading = true
+                    refreshUser(this.adAppId, this.authUserId).then(res => {
+                        this.loading = false
+                        if (res.data) {
+                            this.msgSuccess("刷新成功");
+                            this.$emit("onChange");
+                        }
+                    }).catch(() => this.loading = false)
+                })
+
+            }
+        }
+    }
+}
+</script>

+ 53 - 0
src/views/ttAd.vue

@@ -0,0 +1,53 @@
+<template>
+    <div>
+
+    </div>
+</template>
+
+
+<script>
+import { doAuthUser } from "@/api/accounts/ttAdapi";
+export default {
+    created () {
+        this.handleSubmit()
+    },
+    methods: {
+        handleSubmit() {
+            if (window.location.hash.indexOf('?') !== -1) {
+                const loading = this.$loading({
+                    lock: true,
+                    text: '正在授权,请稍后。。。',
+                    spinner: 'el-icon-loading',
+                    background: 'rgba(0, 0, 0, 0.8)'
+                });
+                let query = {
+                    auth_code: this.$route.query.auth_code,
+                    state: this.$route.query.state
+                }
+                this.loading = true
+                doAuthUser(query).then(response => {
+                    loading.close();
+                    let data = response.data
+                    if (data) {
+                        this.$message({
+                            message: '授权成功',
+                            type: 'success'
+                        });
+                        localStorage.setItem("ttAdMp", "ok");
+                    } else {
+                        this.$message({
+                            message: '授权失败',
+                            type: 'error'
+                        });
+                        localStorage.setItem("ttAdMp", "false");
+                        return
+                    }
+                    setTimeout(()=>{
+                        window.close()
+                    }, 200)
+                }).catch(() => loading.close())
+            }
+        }
+    }
+}
+</script>

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott