From 02b80a2d669752cef403d94e762be2ee511081ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cgrape=E2=80=9D?= <18746553572@163.com> Date: Tue, 3 Jan 2023 20:55:20 +0800 Subject: [PATCH] 2023/1/3 --- .env.dev | 4 +- src/constants/api/ms-system/system.api.ts | 12 ++--- src/services/api.service.ts | 7 ++- src/views/authentication/LoginView.vue | 1 + src/views/workbench/PersonLod.vue | 46 +++++++++++++++-- src/views/workbench/modifyInfo.vue | 61 ++++++++--------------- vue.config.js | 11 ++++ 7 files changed, 90 insertions(+), 52 deletions(-) diff --git a/.env.dev b/.env.dev index 0ee36b1..46fc3d5 100644 --- a/.env.dev +++ b/.env.dev @@ -17,9 +17,9 @@ VUE_APP_API_PREFIX = /api/v1 //////////////// local // 网关服务 -VUE_APP_MS_GATEWAY_API = http://192.168.14.1:9140 +VUE_APP_MS_GATEWAY_API = http://localhost:9140 //VUE_APP_ONLINE_API = http://192.168.14.1:9155/ms-online/api/v1 -VUE_APP_SYSTEM_API = ms-system/api/v1/ +VUE_APP_SYSTEM_API = /ms-system/api/v1 //////////////// serve diff --git a/src/constants/api/ms-system/system.api.ts b/src/constants/api/ms-system/system.api.ts index d9d6073..64f329e 100644 --- a/src/constants/api/ms-system/system.api.ts +++ b/src/constants/api/ms-system/system.api.ts @@ -4,7 +4,7 @@ import { HeaderType } from "@/constants/enum/general/header-type.enum"; //网关 // const prefix = process.env.VUE_APP_MS_GATEWAY_API + process.env.VUE_APP_AUTH_API; //local -const prefix = "http://192.168.14.1:9140" + process.env.VUE_APP_SYSTEM_API; +const prefix = process.env.VUE_APP_MS_GATEWAY_API + process.env.VUE_APP_SYSTEM_API; const systemApi = { // 通用请求地址 commonRq: { @@ -129,14 +129,14 @@ const systemApi = { //获取个人信息 getSysCustInfoById: { url: prefix + "/sys-cust-info/detail-by-id", - methodType: MethodType.GET.code, - headerType: HeaderType.AUTH.code, + method: MethodType.GET.code, + header: HeaderType.AUTH.code, }, //更新个人信息 updateSysCustInfoById: { - url: prefix + "/sys-cust-info/update-by-id", - methodType: MethodType.GET.code, - headerType: HeaderType.AUTH.code, + url: prefix + "/sys-cust-info/update-by-id", + method: MethodType.PUT.code, + header: HeaderType.AUTH.code, }, }; export default systemApi; diff --git a/src/services/api.service.ts b/src/services/api.service.ts index c4299d7..d57625c 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -197,7 +197,12 @@ class ApiService { } put(path: string, params: any, query: Query | undefined, requestConfig: AxiosRequestConfig): any { path = query != null ? this.urlQueryConvert(path, query) : path; - return Vue.axios.put(`${path}`, params, requestConfig).then(this.createBusCodeHandler()).catch(this.createErrorHandler()); + // return Vue.axios.put(`${path}`, params, requestConfig).then(this.createBusCodeHandler()).catch(this.createErrorHandler()); + return Vue.axios.put(`${path}`, params, requestConfig).then(res=>{ + //TODO + return res.data + }); + } delete(path: string, query: Query | undefined, requestConfig: AxiosRequestConfig): any { diff --git a/src/views/authentication/LoginView.vue b/src/views/authentication/LoginView.vue index fd2607d..558e269 100644 --- a/src/views/authentication/LoginView.vue +++ b/src/views/authentication/LoginView.vue @@ -258,6 +258,7 @@ export default class LoginView extends Vue { //密码 credential: this.password } + apiService.general(loginApi.loginSystem, undefined, param, undefined).then((response: RestfulResponse) => { console.log(response); //发送请求就保存账号 账号:18746555531 密码:123456 diff --git a/src/views/workbench/PersonLod.vue b/src/views/workbench/PersonLod.vue index fecbf71..c9512c9 100644 --- a/src/views/workbench/PersonLod.vue +++ b/src/views/workbench/PersonLod.vue @@ -91,6 +91,11 @@