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 MALL_VERSION = v1.0.0
# 后端接口 - 正式环境(通过 process.env.NODE_ENV 非 development # 后端接口 - 正式环境(通过 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 # 后端接口 - 测试环境(通过 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 MALL_API_PATH = /merchant-api

View File

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

View File

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

View File

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

View File

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

View File

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