微信小程序一键登录
This commit is contained in:
1 parent
955c13429a
commit
f31015deb0
12 files changed
+132
-86
No files matched your search
@@ -5,6 +5,7 @@ export { default as boxesApi } from "./boxes"
|
||||
export { default as faceApi } from "./face"
|
||||
export { default as foodApi } from "./food"
|
||||
export { default as merchantApi } from "./merchant"
|
||||
export { default as miniPlatformApi } from "./mini-platform"
|
||||
export { default as orderApi } from "./order"
|
||||
export { default as payApi } from "./pay"
|
||||
export { default as productApi } from "./product"
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import request from "@/sheep/utils/request"
|
||||
|
||||
type AutoAdminLoginDto = {
|
||||
miniPlatformType?: string
|
||||
code?: string
|
||||
}
|
||||
|
||||
export default {
|
||||
autoAdminLogin: (data: AutoAdminLoginDto) =>
|
||||
request({
|
||||
url: "/third/third-mini-app-oath/auto-admin-login",
|
||||
method: "POST",
|
||||
data,
|
||||
}),
|
||||
}
|
||||
@@ -3,6 +3,13 @@ import { reactive } from "vue"
|
||||
|
||||
import { useMakePhoneCall } from "@@/hooks"
|
||||
|
||||
const props = defineProps({
|
||||
showPhoneText: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
|
||||
const state = reactive<any>({
|
||||
showModal: false,
|
||||
phoneList: ['15557321501']
|
||||
@@ -16,11 +23,19 @@ const doPhone = (v: string) => {
|
||||
useMakePhoneCall(v)
|
||||
}
|
||||
|
||||
const openModal = () => {
|
||||
state.showModal = true
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
openModal,
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view>
|
||||
<view class="w-full second-text-26 text-center mb-2 mt-10" @tap="doServiceText">
|
||||
<view v-if="showPhoneText" class="w-full second-text-26 text-center mb-2 mt-10" @tap="doServiceText">
|
||||
<text>联系热线</text>
|
||||
</view>
|
||||
<tm-drawer :show="state.showModal" title="联系热线" size="30%" position="bottom" @close="state.showModal = false">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export default {
|
||||
// 微信小程序
|
||||
WECHAT: "wechat",
|
||||
WECHAT: "WECHAT",
|
||||
// 支付宝
|
||||
ALI_PAY: "ali_pay",
|
||||
ALI_PAY: "ALI_PAY",
|
||||
} as const
|
||||
@@ -55,6 +55,12 @@ const actCancelStatusEnum = {
|
||||
"3": "已过期",
|
||||
}
|
||||
|
||||
const errorMsginiPlatformLoginErrorEnum = {
|
||||
"10": "获取手机号错误",
|
||||
"20": "用户不存在",
|
||||
"30": "登录错误",
|
||||
}
|
||||
|
||||
export default {
|
||||
hardwareOrderStatusEnum,
|
||||
hardwareOrderTypeEnum,
|
||||
@@ -64,4 +70,5 @@ export default {
|
||||
hardwareRefundStatusEnum,
|
||||
carTypeEnum,
|
||||
actCancelStatusEnum,
|
||||
errorMsginiPlatformLoginErrorEnum,
|
||||
}
|
||||
@@ -52,9 +52,13 @@ export const usePage = (ref: any = null, fn: Function | null = null, sticky = nu
|
||||
}
|
||||
let _arr = res
|
||||
for (let key of struct.split(".")) {
|
||||
if (_arr == null) {
|
||||
break
|
||||
}
|
||||
_arr = _arr[key]
|
||||
}
|
||||
setPage(_arr)
|
||||
const list = Array.isArray(_arr) ? _arr : (_arr?.records ?? [])
|
||||
setPage(list)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
setPage([])
|
||||
|
||||
@@ -20,17 +20,10 @@ const SKIP_REFRESH_TOKEN = ["/sys/auth/refresh-token", "/auth/token/check_token"
|
||||
|
||||
let refreshTokenLock = true
|
||||
|
||||
// 创建https请求实例
|
||||
let baseUrl = ""
|
||||
// #ifdef WEB
|
||||
baseUrl = import.meta.env.VITE_API_URL
|
||||
// #endif
|
||||
// #ifndef WEB
|
||||
baseUrl = getBaseApiUrl()
|
||||
// #endif
|
||||
console.log("getBaseApiUrl:", getBaseApiUrl())
|
||||
|
||||
const https = new Request({
|
||||
baseURL: baseUrl,
|
||||
baseURL: getBaseApiUrl(),
|
||||
timeout: 15000,
|
||||
method: "GET",
|
||||
header: {
|
||||
|
||||
Reference in new issue
Block a user