diff --git a/src/constants/api/ms-system/system.api.ts b/src/constants/api/ms-system/system.api.ts index f53af4db3a8550d0761c5cf6a90131901c088937..d9d60738fdcc2ffbe925a2d4ae674e919f610a55 100644 --- a/src/constants/api/ms-system/system.api.ts +++ b/src/constants/api/ms-system/system.api.ts @@ -128,9 +128,15 @@ const systemApi = { }, //获取个人信息 getSysCustInfoById: { - url: prefix + "/sys-cust-info/getSysCustInfoById", + url: prefix + "/sys-cust-info/detail-by-id", methodType: MethodType.GET.code, headerType: HeaderType.AUTH.code, }, + //更新个人信息 + updateSysCustInfoById: { + url: prefix + "/sys-cust-info/update-by-id", + methodType: MethodType.GET.code, + headerType: HeaderType.AUTH.code, + }, }; export default systemApi; diff --git a/src/views/workbench/modifyInfo.vue b/src/views/workbench/modifyInfo.vue index 4d19675adad11e26c42f600a0a48c15d87e87bc9..d16248f1ab7ad19b5c1994c67719e7ce1c4e09d0 100644 --- a/src/views/workbench/modifyInfo.vue +++ b/src/views/workbench/modifyInfo.vue @@ -74,6 +74,7 @@ import systemApi from "@/constants/api/ms-system/system.api"; import { Code } from "@/constants/enum/general/code.enum"; import { RestfulResponse } from "@/model/domain/RestfulResponse"; import apiService from "@/services/api.service"; +import { Toast } from "vant"; import { Component, Vue, Prop, Watch, Emit } from "vue-property-decorator"; @@ -100,7 +101,30 @@ export default class PersonLod extends Vue { this.getInfo(); } + + modifyInfo(){ + let custInfo: any = sessionStorage.getItem("sysCustInfo"); + custInfo = JSON.parse(custInfo); + let id = custInfo.id; + + let query = { + + } + let param = { + id: custInfo.id, + phone: this.phone, + address: this.liveAdress, + } + apiService.general(systemApi.getSysCustInfoById, query, param, undefined).then((response: RestfulResponse) => { + if (response.code == Code.SUCCESS.code) { + this.name = response.data.records.custName; + this.IdCard = response.data.records.idcard; + this.phone = response.data.records.phone; + this.liveAdress = response.data.records.address; + } + Toast(response.msg + ""); + }); @@ -108,7 +132,7 @@ export default class PersonLod extends Vue { } getInfo(){ - let custInfo: any = sessionStorage.getItem("sysCustInfo"); + let custInfo: any = sessionStorage.getItem("sysCustInfo"); custInfo = JSON.parse(custInfo); let id = custInfo.id; console.log(id); @@ -126,6 +150,7 @@ export default class PersonLod extends Vue { this.phone = response.data.records.phone; this.liveAdress = response.data.records.address; } + Toast(response.msg + ""); }); }