|
@@ -98,6 +98,16 @@
|
|
|
>指派</el-button>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <div class="grid-content">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ icon="el-icon-refresh"
|
|
|
+ @click="warrantsHandle"
|
|
|
+ >批量授权</el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
@@ -651,6 +661,62 @@
|
|
|
<el-button type="primary" @click="submitPUt('platFormPut')">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 批量授权 -->
|
|
|
+ <el-dialog
|
|
|
+ title="批量授权"
|
|
|
+ :visible.sync="warrantsShow"
|
|
|
+ width="550px"
|
|
|
+ >
|
|
|
+ <el-form :model="queryWarrants" ref="warrantsQueryForm" label-position="top" :rules="rulesWarrants">
|
|
|
+ <el-form-item label="平台选择" prop="adAppIds">
|
|
|
+ <el-checkbox-group v-model="queryWarrants.adAppIds">
|
|
|
+ <el-checkbox v-for="val in tenAllList" :label="val.id" :key="val.id">{{val.appName}}</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="账号ID" prop="users">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :rows="2"
|
|
|
+ placeholder="每个账号请以,号隔空例:123456,222333,444444"
|
|
|
+ v-model="queryWarrants.users">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div style="display: flex;">
|
|
|
+ <el-button type="primary" @click="clearAccount()">清空账号状态</el-button>
|
|
|
+ <el-button size="mini" @click="errorHandle()">查询授权失败账户</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <div v-if="errorData['1']" style="margin-top: 10px">
|
|
|
+ <div>趣程数据(旧版)失败列表:</div>
|
|
|
+ <div style="margin-top: 5px">{{errorData['1']}}</div>
|
|
|
+ </div>
|
|
|
+ <div v-if="errorData['2']" style="margin-top: 10px">
|
|
|
+ <div>赞象计划监控失败列表:</div>
|
|
|
+ <div style="margin-top: 5px">{{errorData['2']}}</div>
|
|
|
+ </div>
|
|
|
+ <div v-if="errorData['4']" style="margin-top: 10px">
|
|
|
+ <div>赞象数据(新版)失败列表</div>
|
|
|
+ <div style="margin-top: 5px">{{errorData['4']}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="warrantsShow = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmitWarrants()">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="扫码"
|
|
|
+ :visible.sync="imgBase64Show"
|
|
|
+ width="200px"
|
|
|
+ >
|
|
|
+ <img :src="this.imgBase64" width="180">
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -662,6 +728,7 @@ import { allUser } from "@/api/system/user";
|
|
|
import { searchList } from "@/api/accounts/account";
|
|
|
import MyTable from './components/myTable.vue';
|
|
|
import store from '@/store'
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
export default {
|
|
|
name: 'Account',
|
|
|
components: { MyTable },
|
|
@@ -826,15 +893,30 @@ export default {
|
|
|
putUserId: [
|
|
|
{ required: true, message: '请选择投手', trigger: 'blur' }
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ warrantsShow: false,
|
|
|
+ queryWarrants: {
|
|
|
+ adAppIds: []
|
|
|
+ },
|
|
|
+ rulesWarrants: {
|
|
|
+ adAppIds: [
|
|
|
+ { required: true, message: '请选择平台', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ users: [
|
|
|
+ { required: true, message: '请输入账户ID', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ imgBase64: '',
|
|
|
+ imgBase64Show: false,
|
|
|
+ errorData: {}
|
|
|
}
|
|
|
},
|
|
|
mounted(){
|
|
|
window.addEventListener('storage', (e) => {
|
|
|
if (e.key === 'adMp') {
|
|
|
if (e.newValue === 'ok') {
|
|
|
- this.$router.go(0)
|
|
|
- // this.getList()
|
|
|
+ // this.$router.go(0)
|
|
|
+ this.getList()
|
|
|
this.msgSuccess("授权成功");
|
|
|
localStorage.removeItem('adMp')
|
|
|
} else {
|
|
@@ -849,6 +931,55 @@ export default {
|
|
|
this.getAll()
|
|
|
},
|
|
|
methods: {
|
|
|
+ /** 清空账户状态 */
|
|
|
+ clearAccount() {
|
|
|
+ fetch('http://47.99.157.216:8022/qq/delCookie',{
|
|
|
+ method:'GET'
|
|
|
+ }).then(res=>res.json()).then(r=>{
|
|
|
+ this.msgSuccess('清理成功!!!!请重新扫码授权登录!!!');
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 查询授权失败账户 */
|
|
|
+ errorHandle() {
|
|
|
+ fetch('http://47.99.157.216:8022/qq/queryErr',{
|
|
|
+ method:'GET'
|
|
|
+ }).then(res=>res.json()).then(r=>{
|
|
|
+ this.errorData = r.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 授权确定 */
|
|
|
+ onSubmitWarrants() {
|
|
|
+ this.$refs['warrantsQueryForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let params = { ...this.queryWarrants, users: this.queryWarrants.users.split(','), callbackPage: encodeURIComponent(window.location.origin + '/adCode'), authorization: 'Bearer ' + getToken() }
|
|
|
+ console.log(params);
|
|
|
+ fetch('http://47.99.157.216:8022/qq/auth', {
|
|
|
+ method: 'POST',
|
|
|
+ headers:{
|
|
|
+ "content-type": "application/json",
|
|
|
+ },
|
|
|
+ body:JSON.stringify(params)
|
|
|
+ }).then(response => response.json()).then(json => {
|
|
|
+ console.log('11111--->',json)
|
|
|
+ if (json.data.msg) {
|
|
|
+ this.msgSuccess(json.data.msg);
|
|
|
+ }
|
|
|
+ if (json.data.codeImgUrl) {
|
|
|
+ this.imgBase64 = json.data.codeImgUrl
|
|
|
+ this.imgBase64Show = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 批量授权 */
|
|
|
+ warrantsHandle() {
|
|
|
+ console.log(1111);
|
|
|
+ this.warrantsShow = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$set(this.queryWarrants, 'adAppIds', this.tenAllList.map(item => item.id))
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 刷新服务商 */
|
|
|
refreshServer() {
|
|
|
this.reLoading = true
|
|
@@ -1185,7 +1316,7 @@ export default {
|
|
|
},
|
|
|
/** 老的授权广告平台 */
|
|
|
handleWarrantOld() {
|
|
|
- toAuth({ adAppId: this.queryParams.adAppId, callbackPage: encodeURIComponent(window.location.origin + '/admin/adCode') }).then(res => {
|
|
|
+ toAuth({ adAppId: this.queryParams.adAppId, callbackPage: encodeURIComponent(window.location.origin + '/adCode') }).then(res => {
|
|
|
if (res.data) {
|
|
|
window.open(res.data)
|
|
|
}
|