audio
This commit is contained in:
parent
2c167bf638
commit
a8df35e175
|
@ -4,7 +4,14 @@ import { Store } from "antd/lib/form/interface";
|
|||
import PayConfig from "./config/pay-config";
|
||||
import PushConfig from "./config/push-config";
|
||||
import ImConfig from "./config/im-config";
|
||||
import { useEffect } from "react";
|
||||
import { useParams } from "react-router";
|
||||
const AppManageConfig = (props: Store) => {
|
||||
const { appStore } = props
|
||||
const { id } = useParams();
|
||||
useEffect(()=>{
|
||||
appStore.getApp(id)
|
||||
},[appStore,id])
|
||||
const items: TabsProps["items"] = [
|
||||
{
|
||||
key: "1",
|
||||
|
@ -22,11 +29,13 @@ const AppManageConfig = (props: Store) => {
|
|||
children: <ImConfig />,
|
||||
},
|
||||
];
|
||||
|
||||
const onChange = ()=>{
|
||||
appStore.getApp(id)
|
||||
}
|
||||
return (
|
||||
<div className="contentBox">
|
||||
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||
<Tabs defaultActiveKey="1" type="card" items={items} />
|
||||
<Tabs defaultActiveKey="1" type="card" items={items} onChange={onChange}/>
|
||||
</Space>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -10,8 +10,10 @@ const PayConfig = (props: Store) => {
|
|||
const { id } = useParams();
|
||||
const wxformRef = React.useRef<FormInstance>(null);
|
||||
const aliformRef = React.useRef<FormInstance>(null);
|
||||
|
||||
useEffect(() => {}, []);
|
||||
useEffect(() => {
|
||||
wxformRef.current?.setFieldsValue(appStore.item?.wechat)
|
||||
aliformRef.current?.setFieldsValue(appStore.item?.ali)
|
||||
}, [appStore.item,id]);
|
||||
const onFinishFailed = () => {};
|
||||
const onwxFinish = (values: any) => {
|
||||
appStore.setWechatConfig(id,values)
|
||||
|
|
|
@ -15,8 +15,12 @@ const PushConfig = (props: Store) => {
|
|||
const xmformRef = React.useRef<FormInstance>(null);
|
||||
|
||||
useEffect(() => {
|
||||
appStore.getIosConfig(id);
|
||||
}, [appStore, id]);
|
||||
hwformRef.current?.setFieldsValue(appStore.item.pushHwawei);
|
||||
iosformRef.current?.setFieldsValue(appStore.item.pushIos);
|
||||
opformRef.current?.setFieldsValue(appStore.item.pushOppo);
|
||||
vivoformRef.current?.setFieldsValue(appStore.item.pushVivo);
|
||||
xmformRef.current?.setFieldsValue(appStore.item.pushXiaomi);
|
||||
}, [appStore.item, id]);
|
||||
|
||||
const onFinishFailed = () => {};
|
||||
|
||||
|
@ -75,7 +79,7 @@ const PushConfig = (props: Store) => {
|
|||
type: "upload",
|
||||
label: "推送证书",
|
||||
name: "centerFile",
|
||||
value: "",
|
||||
value: [],
|
||||
rules: [{ required: true, message: "请上传推送证书!" }],
|
||||
},
|
||||
]}
|
||||
|
|
|
@ -4,7 +4,7 @@ import axios, { AxiosResponse } from "axios";
|
|||
axios.defaults.headers.common["CommonType"] = "shouka";
|
||||
axios.defaults.headers.common["Content-Type"] = "application/json; charset=utf8";
|
||||
axios.interceptors.request.use((config) => {
|
||||
config.baseURL = "http://127.0.0.1:8899/v1/api/";
|
||||
config.baseURL = "http://quwanya.cn:8899/v1/api/";
|
||||
config.timeout = 5000;
|
||||
let token = window.localStorage.getItem("token")
|
||||
config.headers.Authorization = 'Bearer ' + token
|
||||
|
@ -56,7 +56,6 @@ class BaseHttp {
|
|||
data: params
|
||||
});
|
||||
return res.data;
|
||||
|
||||
};
|
||||
async put(url: string, params: any) {
|
||||
let res = await axios({
|
||||
|
@ -65,7 +64,6 @@ class BaseHttp {
|
|||
data: params
|
||||
});
|
||||
return res.data;
|
||||
|
||||
};
|
||||
async delete(url: string, params: any) {
|
||||
let res = await axios({
|
||||
|
|
|
@ -8,69 +8,46 @@ class AppStore extends BaseStore<CardDataType> {
|
|||
constructor() {
|
||||
super(AppConfig)
|
||||
makeObservable(this, {
|
||||
getIosConfig: action,
|
||||
getApp: action
|
||||
})
|
||||
}
|
||||
// 设置Ios 配置
|
||||
async setIosConfig(id: number, param) {
|
||||
return await baseHttp.put(AppConfig.IOSAPPPUSH + id, param)
|
||||
}
|
||||
// 获取Ios 配置
|
||||
async getIosConfig(id: number) {
|
||||
return await baseHttp.get(AppConfig.IOSAPPPUSH + "/" + id, {})
|
||||
}
|
||||
|
||||
// 设置hw 配置
|
||||
async setHwConfig(id: number, param) {
|
||||
return await baseHttp.put(AppConfig.HUAWEIAPPPUSH + id, param)
|
||||
}
|
||||
// 获取HW 配置
|
||||
async getHwConfig(id: number) {
|
||||
return await baseHttp.get(AppConfig.HUAWEIAPPPUSH + "/" + id, {})
|
||||
}
|
||||
|
||||
// 设置op 配置
|
||||
async setOPConfig(id: number, param) {
|
||||
return await baseHttp.put(AppConfig.OPPOAPPPUSH + id, param)
|
||||
}
|
||||
// 获取op 配置
|
||||
async getOpConfig(id: number) {
|
||||
return await baseHttp.get(AppConfig.OPPOAPPPUSH + "/" + id, {})
|
||||
}
|
||||
|
||||
// 设置op 配置
|
||||
async setVivoConfig(id: number, param) {
|
||||
return await baseHttp.put(AppConfig.VIVOAPPPUSH + id, param)
|
||||
}
|
||||
// 获取op 配置
|
||||
async getVivoConfig(id: number) {
|
||||
return await baseHttp.get(AppConfig.VIVOAPPPUSH + "/" + id, {})
|
||||
}
|
||||
|
||||
// 设置wx 配置
|
||||
async setWechatConfig(id: number, param) {
|
||||
return await baseHttp.put(AppConfig.WechatConfig + id, param)
|
||||
}
|
||||
// 获取wx 配置
|
||||
async getWechatConfig(id: number) {
|
||||
return await baseHttp.get(AppConfig.WechatConfig + "/" + id, {})
|
||||
}
|
||||
|
||||
// 设置wx 配置
|
||||
async setXmConfig(id: number, param) {
|
||||
return await baseHttp.put(AppConfig.XIAOMIAPPPUSH + id, param)
|
||||
}
|
||||
// 获取wx 配置
|
||||
async getXmConfig(id: number) {
|
||||
return await baseHttp.get(AppConfig.XIAOMIAPPPUSH + "/" + id, {})
|
||||
}
|
||||
|
||||
// 设置wx 配置
|
||||
async setAlConfig(id: number, param) {
|
||||
return await baseHttp.put(AppConfig.ALCONFIG + id, param)
|
||||
}
|
||||
// 获取wx 配置
|
||||
async getAlConfig(id: number) {
|
||||
return await baseHttp.get(AppConfig.ALCONFIG + "/" + id, {})
|
||||
|
||||
async getApp(id: number) {
|
||||
let data = await baseHttp.get(AppConfig.ADD + "/" + id, {})
|
||||
this.item = data.data
|
||||
}
|
||||
}
|
||||
export default new AppStore();
|
|
@ -72,6 +72,7 @@ class BaseStore<B> implements BaseStoreInterface<B> {
|
|||
runInAction(() => {
|
||||
this.list = data;
|
||||
})
|
||||
this.listStatus = false;
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
|
@ -80,6 +81,7 @@ class BaseStore<B> implements BaseStoreInterface<B> {
|
|||
...res.data.list[i]
|
||||
})
|
||||
}
|
||||
|
||||
runInAction(() => {
|
||||
this.list = data;
|
||||
this.total = res.data.total | res.data.totals
|
||||
|
|
Loading…
Reference in New Issue