This commit is contained in:
Ankkaya 2024-08-27 17:57:03 +08:00
parent b58fe9df30
commit 32c3cd8936
6 changed files with 814 additions and 819 deletions

4
.env
View File

@ -2,10 +2,10 @@
MALL_VERSION = v1.0.0
# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 development
MALL_BASE_URL = http://api-dashboard.yudao.iocoder.cn
MALL_BASE_URL = https://mall.jiandyb.cn:49011
# 后端接口 - 测试环境(通过 process.env.NODE_ENV = development
MALL_DEV_BASE_URL = https://mall-baclend-local.jiandyb9834.xyz
MALL_DEV_BASE_URL = https://mall.jiandyb.cn:49011
# 后端接口前缀(一般不建议调整)
MALL_API_PATH = /merchant-api

View File

@ -34,6 +34,7 @@ const AuthUtil = {
loadingMsg: '发送中',
showSuccess: true,
successMsg: '发送成功',
auth: false,
},
})
},

View File

@ -84,6 +84,7 @@ export function closeMenuTools() {
export function getSmsCode(event, mobile) {
const modalStore = $store('modal')
const lastSendTimer = modalStore.lastTimer[event]
if (typeof lastSendTimer === 'undefined') {
$helper.toast('短信发送事件错误')
return
@ -117,10 +118,11 @@ export function getSmsCode(event, mobile) {
scene = 1
break
}
AuthUtil.sendSmsCode(mobile, scene).then((res) => {
if (res.code === 0) {
modalStore.lastTimer[event] = dayjs().unix()
}
// if (res.code === 0) {
// modalStore.lastTimer[event] = dayjs().unix()
// }
})
}

View File

@ -64,6 +64,7 @@ const http = new Request({
http.interceptors.request.use(
(config) => {
console.log(config)
// 自定义处理【auth 授权】:必须登录的接口,否则提示登录
if (config.custom.auth && !$store('user').isLogin) {
// 处理登录
@ -134,11 +135,7 @@ http.interceptors.response.use(
}
// 自定义处理【showSuccess 成功提示】:如果需要显示成功提示,则显示成功提示
if (
response.config.custom.showSuccess &&
response.config.custom.successMsg !== '' &&
response.data.code === 0
) {
if (response.config.custom.showSuccess && response.config.custom.successMsg !== '' && response.data.code === 0) {
uni.showToast({
title: response.config.custom.successMsg,
icon: 'none',
@ -195,8 +192,7 @@ http.interceptors.response.use(
}
if (error.errMsg.includes('timeout')) errorMessage = '请求超时'
// #ifdef H5
if (error.errMsg.includes('Network'))
errorMessage = window.navigator.onLine ? '服务器异常' : '请检查您的网络连接'
if (error.errMsg.includes('Network')) errorMessage = window.navigator.onLine ? '服务器异常' : '请检查您的网络连接'
// #endif
}

View File

@ -72,7 +72,7 @@ const props = defineProps({
},
leftIcon: {
type: String,
default: '',
default: 'leftIcon',
},
navbar: {
type: String,

View File

@ -36,11 +36,7 @@
<view
:class="{ 'uni-navbar-btn-icon-left': !leftIcon.length > 0 }"
class="uni-navbar-btn-text"
v-if="
titleAlign === 'left' &&
title.length &&
peach.$platform.name !== 'WechatOfficialAccount'
"
v-if="titleAlign === 'left' && title.length && peach.$platform.name !== 'WechatOfficialAccount'"
>
<text :style="{ color: themeColor, fontSize: '18px' }">{{ title }}</text>
</view>
@ -128,7 +124,7 @@ const props = defineProps({
},
leftIcon: {
type: String,
default: '',
default: 'left',
},
rightIcon: {
type: String,