From 6f9a71707065762924c9f73f2110080e13ce20fb Mon Sep 17 00:00:00 2001 From: sunnie <406803045@qq.com> Date: Wed, 22 Apr 2020 17:49:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0get?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/api/user.js | 13 +++++++++++-- src/views/home/about.vue | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 99b54ca..3879859 100644 --- a/README.md +++ b/README.md @@ -522,7 +522,7 @@ import request from '@/utils/request' export function getUserInfo(params) { return request({ url: '/user/userinfo', - method: 'get', + method: 'post', data: qs.stringify(params), hideloading: true // 隐藏 loading 组件 }) diff --git a/src/api/user.js b/src/api/user.js index b7a287a..246d61d 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -11,12 +11,21 @@ export function login(params) { data: qs.stringify(params) }) } -// 用户信息 +// 用户信息 post 方法 export function getUserInfo(params) { return request({ url: '/user/userinfo', - method: 'get', + method: 'post', data: qs.stringify(params), hideloading: true }) } + +// 用户名称 get 方法 +export function getUserName(params) { + return request({ + url: '/user/name?' + qs.stringify(params), + method: 'get', + hideloading: true + }) +} diff --git a/src/views/home/about.vue b/src/views/home/about.vue index 3be401d..1be997a 100644 --- a/src/views/home/about.vue +++ b/src/views/home/about.vue @@ -5,7 +5,7 @@
VUE H5开发模板
-
项目地址: https://github.com/sunniejs
+
项目地址: https://github.com/sunniejs/vue-h5-template
项目作者: sunnie