Commit 2d8d200a by liuliufashi

update

parent d2c99d52
No preview for this file type
...@@ -111,7 +111,6 @@ export const onCreateGoods = async(data:any)=>{ ...@@ -111,7 +111,6 @@ export const onCreateGoods = async(data:any)=>{
data data
}); });
} }
export const onfindAli = async(uid:any)=>{ export const onfindAli = async(uid:any)=>{
return await request({ return await request({
url: `/pay/findalipay?uid=${uid}`, url: `/pay/findalipay?uid=${uid}`,
......
...@@ -299,21 +299,22 @@ const onSetShowTable = async (data: any) => { ...@@ -299,21 +299,22 @@ const onSetShowTable = async (data: any) => {
const { mchid, mchkey, appid, name } = data; const { mchid, mchkey, appid, name } = data;
const uid: any = getUid(); const uid: any = getUid();
modelRef.privatekey = mchid; modelRef.privatekey = mchid;
modelRef.alipaypublickey = mchkey; modelRef.alipaypublickey = '';
modelRef.appid = appid; modelRef.appid = appid;
modelRef.name = name; modelRef.name = name;
// modelRef.server_url =server_url // modelRef.server_url =server_url
modelRef.uid = uid; modelRef.uid = uid;
} else { } else {
const { alipaypublickey, privatekey, appid, name } = data; const { alipaypublickey, privatekey, appid, payname } = data;
const uid: any = getUid(); const uid: any = getUid();
modelRef.alipaypublickey = alipaypublickey; modelRef.alipaypublickey = '';
modelRef.privatekey = privatekey; modelRef.privatekey = privatekey;
modelRef.appid = appid; modelRef.appid = appid;
modelRef.name = name; modelRef.name = payname;
// modelRef.server_url =server_url // modelRef.server_url =server_url
modelRef.uid = uid; modelRef.uid = uid;
} }
dataFrom.value = data; dataFrom.value = data;
}; };
const onCreated = () => { const onCreated = () => {
......
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
<a-form-item label="支付域名配置" v-bind="validateInfos.alName"> <a-form-item label="支付域名配置" v-bind="validateInfos.alName">
<a-input v-model:value="modelRef.alName" /> <a-input v-model:value="modelRef.alName" />
</a-form-item> </a-form-item>
<a-form-item label="微信appid" v-bind="validateInfos.name">
<a-input v-model:value="modelRef.appid" />
</a-form-item>
<a-form-item label="微信密钥" v-bind="validateInfos.name">
<a-input v-model:value="modelRef.secret" />
</a-form-item>
<a-form-item :wrapper-col="{ span: 14, offset: 4 }"> <a-form-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" @click.prevent="onSubmit">提交</a-button> <a-button type="primary" @click.prevent="onSubmit">提交</a-button>
</a-form-item> </a-form-item>
...@@ -18,6 +24,8 @@ const uid = ref<Boolean>(false) ...@@ -18,6 +24,8 @@ const uid = ref<Boolean>(false)
const id = ref<any>('0') const id = ref<any>('0')
const modelRef = reactive({ const modelRef = reactive({
alName: "", alName: "",
appid: "",
secret:""
}); });
const { resetFields, validate, validateInfos } = useForm( const { resetFields, validate, validateInfos } = useForm(
modelRef, modelRef,
...@@ -33,24 +41,27 @@ const { resetFields, validate, validateInfos } = useForm( ...@@ -33,24 +41,27 @@ const { resetFields, validate, validateInfos } = useForm(
const onSubmit = () => { const onSubmit = () => {
validate() validate()
.then(async (res) => { .then(async (res) => {
const uid =getUid()
const params: Object = { const params: Object = {
id: id.value, id: id.value,
remarks: '', remarks: '',
uid: getUid(), uid: uid,
url: toRaw(modelRef).alName url: toRaw(modelRef).alName,
appid:toRaw(modelRef).appid,
secret:toRaw(modelRef).secret,
} }
if (uid) { if (uid) {
const data: any = await onUpdaterealmName(JSON.stringify(params)) const data: any = await onUpdaterealmName(JSON.stringify(params))
if (data.state === 1) { if (data.state === 1) {
message.success('更新成功'); message.success('更新成功');
onSreach(1) onSreach(uid)
} }
} else { } else {
const data: any = await onCreaterealmName(JSON.stringify(params)) const data: any = await onCreaterealmName(JSON.stringify(params))
if (data.state === 1) { if (data.state === 1) {
message.success('创建成功'); message.success('创建成功');
onSreach(1) onSreach(uid)
} }
} }
...@@ -63,6 +74,8 @@ const onSubmit = () => { ...@@ -63,6 +74,8 @@ const onSubmit = () => {
const onSreach = async (uid: any) => { const onSreach = async (uid: any) => {
const data = await onSearchSelectrealmName(uid) const data = await onSearchSelectrealmName(uid)
modelRef.alName = data.data[0].url modelRef.alName = data.data[0].url
modelRef.appid = data.data[0].appid
modelRef.secret = data.data[0].secret
localStorage.setItem('url',modelRef.alName) localStorage.setItem('url',modelRef.alName)
if (!data.data[0].userid) { if (!data.data[0].userid) {
uid.value = true uid.value = true
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<a-form-item label="公众号配置" v-bind="validateInfos.name"> <a-form-item label="公众号配置" v-bind="validateInfos.name">
<a-input v-model:value="modelRef.name" /> <a-input v-model:value="modelRef.name" />
</a-form-item> </a-form-item>
<a-form-item :wrapper-col="{ span: 14, offset: 4 }"> <a-form-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" @click.prevent="onSubmit">提交</a-button> <a-button type="primary" @click.prevent="onSubmit">提交</a-button>
</a-form-item> </a-form-item>
...@@ -16,9 +17,6 @@ const useForm = Form.useForm; ...@@ -16,9 +17,6 @@ const useForm = Form.useForm;
const modelRef = reactive({ const modelRef = reactive({
name: "", name: "",
sub: {
name: "",
},
}); });
const { resetFields, validate, validateInfos } = useForm( const { resetFields, validate, validateInfos } = useForm(
modelRef, modelRef,
...@@ -29,12 +27,6 @@ const { resetFields, validate, validateInfos } = useForm( ...@@ -29,12 +27,6 @@ const { resetFields, validate, validateInfos } = useForm(
message: "Please input name", message: "Please input name",
}, },
], ],
"sub.name": [
{
required: true,
message: "Please input sub name",
},
],
}) })
); );
const onSubmit = () => { const onSubmit = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment