u
This commit is contained in:
1 parent
95609c92d4
commit
9954a33f89
2 files changed
+11
-5
No files matched your search
@@ -9,7 +9,7 @@ const userStore = useUserStore()
|
||||
|
||||
const startOffset = ref(getWindowInfo().statusBarHeight + 60)
|
||||
|
||||
const loginLoading = ref(false)
|
||||
const _loading = ref(false)
|
||||
|
||||
const formModel = reactive({
|
||||
orgid: userStore.userInfo.orgid,
|
||||
@@ -34,7 +34,7 @@ function onSubmit() {
|
||||
formRef.value
|
||||
?.validate()
|
||||
.then(() => {
|
||||
loginLoading.value = true
|
||||
_loading.value = true
|
||||
loginOrgApi({
|
||||
orgid: formModel.orgid,
|
||||
userid: formModel.userid,
|
||||
@@ -57,11 +57,11 @@ function onSubmit() {
|
||||
else {
|
||||
uni.showToast({
|
||||
title: '登录失败,请稍后再试',
|
||||
icon:'error'
|
||||
icon: 'error',
|
||||
})
|
||||
}
|
||||
}).finally(() => {
|
||||
loginLoading.value = false
|
||||
_loading.value = false
|
||||
})
|
||||
})
|
||||
.catch((error: FieldValidateError[]) => {
|
||||
@@ -150,7 +150,7 @@ function onSubmit() {
|
||||
</view>
|
||||
|
||||
<view class="footer">
|
||||
<sar-button loading-type="clock" :loading="loginLoading" @click="onSubmit">
|
||||
<sar-button loading-type="clock" :loading="_loading" @click="onSubmit">
|
||||
登录
|
||||
</sar-button>
|
||||
</view>
|
||||
|
||||
@@ -91,6 +91,12 @@ function request<T = any>(option: UniApp.RequestOptions): Promise<IResData<T>> &
|
||||
if (aborted)
|
||||
return reject(new Error('请求已取消'))
|
||||
|
||||
if (res.statusCode !== 200) {
|
||||
console.error('HTTP错误', res.statusCode, res.data)
|
||||
toast.fail(`请求失败:${res.statusCode}`)
|
||||
return reject(new Error(`HTTP错误: ${res.statusCode}`))
|
||||
}
|
||||
|
||||
let data: IResData<T>
|
||||
try {
|
||||
// 解析最外层响应
|
||||
|
||||
Reference in new issue
Block a user