bebae732 by 张猛

登录

1 parent bb440033
...@@ -105,6 +105,7 @@ import { ...@@ -105,6 +105,7 @@ import {
105 const isActive = ref(0) 105 const isActive = ref(0)
106 const agree = ref(false) 106 const agree = ref(false)
107 const isRember = ref(true) 107 const isRember = ref(true)
108 const loading = ref(false)
108 const codeUrl = ref(null) 109 const codeUrl = ref(null)
109 const inputstyle = ref({ 110 const inputstyle = ref({
110 borderColor: 'transparent', 111 borderColor: 'transparent',
...@@ -176,13 +177,15 @@ function login() { ...@@ -176,13 +177,15 @@ function login() {
176 }) 177 })
177 return 178 return
178 } 179 }
179 180 if (loading.value) return;
181 loading.value = true
180 pcLogin(form.value).then((res) => { 182 pcLogin(form.value).then((res) => {
181
182 app.globalData.isLogin = true 183 app.globalData.isLogin = true
183 uni.redirectTo({ 184 uni.redirectTo({
184 url: '/pages/index/home' 185 url: '/pages/index/home'
185 }) 186 })
187 }).finally(() => {
188 loading.value = false
186 }) 189 })
187 } else if (isActive.value == 1) { 190 } else if (isActive.value == 1) {
188 if (!form2.value.telNo) { 191 if (!form2.value.telNo) {
...@@ -208,13 +211,16 @@ function login() { ...@@ -208,13 +211,16 @@ function login() {
208 }) 211 })
209 return 212 return
210 } 213 }
211 214 if (loading.value) return;
215 loading.value = true
212 loginByPhone(form2.value.telNo, form2.value.code) 216 loginByPhone(form2.value.telNo, form2.value.code)
213 .then(() => { 217 .then(() => {
214 app.globalData.isLogin = true 218 app.globalData.isLogin = true
215 uni.redirectTo({ 219 uni.redirectTo({
216 url: '/pages/index/home' 220 url: '/pages/index/home'
217 }) 221 })
222 }).finally(() => {
223 loading.value = false
218 }) 224 })
219 } 225 }
220 } 226 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!