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