fix:多平台兼容
This commit is contained in:
@@ -69,7 +69,8 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { sendVerifyCode, loginWithCode } from '@/config/api/user.js'
|
||||
import { sendVerifyCode, quickLogin } from '@/config/api/user.js'
|
||||
import { appid } from '@/config/url.js'
|
||||
import { fetchAndCacheCustomerPhone } from '@/util/index.js'
|
||||
import { useI18n } from '@/utils/i18n.js'
|
||||
|
||||
@@ -163,7 +164,16 @@
|
||||
|
||||
try {
|
||||
uni.showLoading({ title: t('common.loggingIn') })
|
||||
const res = await loginWithCode(phone.value, verifyCode.value)
|
||||
const res = await quickLogin({
|
||||
loginType: 'SMS',
|
||||
appid,
|
||||
phonenumber: phone.value,
|
||||
smsCode: verifyCode.value
|
||||
})
|
||||
|
||||
if (res && res.code !== 200) {
|
||||
throw new Error(res.msg || res.message || t('auth.loginFailed'))
|
||||
}
|
||||
|
||||
// 保存token和client_id
|
||||
// 兼容多种返回格式:res.data.token, res.token, res.data.access_token
|
||||
|
||||
Reference in New Issue
Block a user