lilei %!s(int64=4) %!d(string=hai) anos
pai
achega
9ef1119c45

+ 1 - 2
api/login.js

@@ -36,8 +36,7 @@ export const checkLogin = () => {
 // 获取登录用户信息
 export const getUserInfo = params => {
   return axios.request({
-    url: `customer/getDetail`,
-    data: params,
+    url: `customer/detail`,
     method: 'get'
   })
 };

+ 1 - 1
api/user.js

@@ -31,4 +31,4 @@ export const ldUsedQuery = params => {
     data: params,
     method: 'post'
   })
-}
+}

+ 1 - 1
components/uni-popup/image-txt-popup.vue

@@ -38,7 +38,7 @@
 			}
 		},
 		created() {
-			this.getCode()
+			// this.getCode()
 		},
 		methods: {
 			//  获取验证码

+ 14 - 7
pages/login/phoneLogin.vue

@@ -103,6 +103,7 @@
 						uni.showToast({icon: 'none',title: '请输入正确的手机号码'})
 						return
 					}else{
+						this.retsetCode()
 						//  图文验证码
 						this.$refs.imageTxtPopup.open()
 					}
@@ -144,19 +145,25 @@
 						//  关闭   图形验证码 弹框
 						_this.$refs.imageTxtPopup.close()
 						//  开启倒计时
-						this.getCodeFun()
+						_this.getCodeFun()
 						uni.showToast({icon: 'none',title: '验证码发送成功'})
 					}else {  //  验证码输入错误
-						_this.randomCode = ''
-						//  切换验证码重新校验
-						_this.changeImg = false
-						_this.$nextTick(function(){
-							_this.changeImg = true
-						})
+						_this.retsetCode()
 						uni.showToast({icon: 'none',title: res.message})
 					}
 				})
 			},
+			// 重新触发获取图片验证码
+			retsetCode(){
+				const _this = this
+				_this.form.verifyCode = ''
+				_this.randomCode = ''
+				//  切换验证码重新校验
+				_this.changeImg = false
+				_this.$nextTick(function(){
+					_this.changeImg = true
+				})
+			}
 		}
 	}
 </script>

+ 10 - 1
pages/userCenter/index.vue

@@ -38,7 +38,7 @@
 </template>
 
 <script>
-	import {logout, checkLogin } from '@/api/login.js'
+	import { checkLogin, getUserInfo } from '@/api/login.js'
 	export default {
 		data() {
 			return {
@@ -49,11 +49,20 @@
 			checkLogin().then(res => {
 				console.log(res)
 				this.hasLogin = res.status == 200
+				if(this.hasLogin){
+					this.getUserInfo()
+				}
 			})
 		},
 		onLoad() {
 		},
 		methods:{
+			// 获取用户信息
+			getUserInfo(){
+				getUserInfo().then(res => {
+					console.log(res,'getUserInfo')
+				})
+			},
 			// 打开对应的页面
 			toPage(index){
 				console.log(index)