|
@@ -1,38 +1,47 @@
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
-import { tencentAdAccountDoAuth, tencentAdAccountToAuth } from "@/services/miniApp/adBack"
|
|
|
|
|
|
+import { getAppAccountConfig, tencentAdAccountDoAuth, tencentAdAccountToAuth } from "@/services/miniApp/adBack"
|
|
import { PageContainer, ProCard, ProForm, ProFormRadio, ProFormSelect, ProFormText } from "@ant-design/pro-components"
|
|
import { PageContainer, ProCard, ProForm, ProFormRadio, ProFormSelect, ProFormText } from "@ant-design/pro-components"
|
|
|
|
+import { history, useModel } from "@umijs/max"
|
|
import { Button, Divider, Space } from "antd"
|
|
import { Button, Divider, Space } from "antd"
|
|
import { useEffect, useRef, useState } from "react"
|
|
import { useEffect, useRef, useState } from "react"
|
|
|
|
|
|
function Auth() {
|
|
function Auth() {
|
|
|
|
+ let {getEnum} = useModel('global')
|
|
|
|
+ let {initialState} = useModel("@@initialState")
|
|
let [key, setKey] = useState<any>()
|
|
let [key, setKey] = useState<any>()
|
|
let [isEdit, setIsEdit] = useState(false)
|
|
let [isEdit, setIsEdit] = useState(false)
|
|
let formRef = useRef()
|
|
let formRef = useRef()
|
|
let TencentAdAccountToAuth = useAjax((params) => tencentAdAccountToAuth(params))//获取授权地址
|
|
let TencentAdAccountToAuth = useAjax((params) => tencentAdAccountToAuth(params))//获取授权地址
|
|
let TencentAdAccountDoAuth = useAjax((params) => tencentAdAccountDoAuth(params))//开始授权
|
|
let TencentAdAccountDoAuth = useAjax((params) => tencentAdAccountDoAuth(params))//开始授权
|
|
|
|
+ let GetAppAccountConfig = useAjax((params) => getAppAccountConfig(params))//获取回传配置
|
|
// 获取广告回传列表
|
|
// 获取广告回传列表
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
-
|
|
|
|
- }, [key])
|
|
|
|
|
|
+ console.log("history.location.search",history.location.search)
|
|
|
|
+ getConfig()
|
|
|
|
+ }, [])
|
|
|
|
+ //获取回传配置
|
|
|
|
+ const getConfig =()=>{
|
|
|
|
+ GetAppAccountConfig.run({appType:initialState?.selectApp?.appType,appId:initialState?.selectApp?.id})
|
|
|
|
+ }
|
|
// 授权
|
|
// 授权
|
|
const auth = () => {
|
|
const auth = () => {
|
|
- console.log("授权")
|
|
|
|
|
|
+ // TencentAdAccountToAuth.run({
|
|
|
|
+
|
|
|
|
+ // })
|
|
|
|
+ console.log("授权",{
|
|
|
|
+ appType:initialState?.selectApp?.appType,
|
|
|
|
+ appId:initialState?.selectApp?.id,
|
|
|
|
+ advertisingChannel:key,
|
|
|
|
+ callbackPage:"https://testdistribution.zanxiangnet.com/#/miniApp/adBack"
|
|
|
|
+ })
|
|
}
|
|
}
|
|
return <PageContainer
|
|
return <PageContainer
|
|
- tabList={[
|
|
|
|
- {
|
|
|
|
- tab: '基本信息',
|
|
|
|
- key: 'base',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- tab: '详细信息',
|
|
|
|
- key: 'info',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- tab: '详细信息',
|
|
|
|
- key: 'info1',
|
|
|
|
|
|
+ tabList={getEnum("ADVERTISING_CHANNEL","arr")?.map((item: { label: any; key: any },index:number)=>{
|
|
|
|
+ if(index === 0 && !key){
|
|
|
|
+ setKey(item.key)
|
|
}
|
|
}
|
|
- ]}
|
|
|
|
|
|
+ return {tab:item.label,key:item.key}
|
|
|
|
+ })}
|
|
tabProps={{
|
|
tabProps={{
|
|
type: 'card',
|
|
type: 'card',
|
|
hideAdd: true,
|
|
hideAdd: true,
|