- 手机号/账号全场景一律脱敏:SensitiveFieldPolicy 删除完整值分支与 ADMIN_EDIT,SELF_PROFILE 同样脱敏;convertToVO 全调用点统一脱敏 - 联系信息接口不再返回号码:toContact 置空 phone 并给出 phoneAvailable,补齐 ensureUserCanSeeShop 真实可见范围校验 - 新增 POST /contact-info/dial,按 scene(SHOP_MANAGER/ORDER_ARTIST/PRODUCT_ARTIST/PLATFORM) 一次一取;DialTargetProvider 抽象直连/隐私号,未配置隐私号返回 9001 且不回退真实号;/contact-info/** 按用户限流并记录审计 - 验证码与换绑手机号改为服务端按当前登录用户取号,客户端 phone/oldPhone 参数兼容忽略;前端与小程序同步去掉回传 - 消息发布人昵称兜底改为脱敏账号,避免 account 明文写入 publisher_name - 新增 V5 账号加密与账号哈希、V6 协议文本改为全场景脱敏与单次拨号取号
This commit is contained in:
@@ -144,6 +144,18 @@ module.exports = {
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 单次拨号取号:号码不缓存,仅用于本次拨号。
|
||||
* scene: SHOP_MANAGER / ORDER_ARTIST / PRODUCT_ARTIST / PLATFORM
|
||||
*/
|
||||
dialContact(scene, targetId, artistId) {
|
||||
return request({
|
||||
url: '/contact-info/dial',
|
||||
method: 'POST',
|
||||
data: { scene, targetId, artistId }
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: getShopManagerContact supports user.js by holding or executing the get shop manager contact page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
|
||||
@@ -30,6 +30,18 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 平台客服拨号:点击后才单次取号,号码不保存。
|
||||
*/
|
||||
async handleDialPlatform() {
|
||||
try {
|
||||
const dial = await userApi.dialContact('PLATFORM')
|
||||
wx.makePhoneCall({ phoneNumber: dial.dialNumber })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '获取客服号码失败', icon: 'none' })
|
||||
}
|
||||
},
|
||||
|
||||
openRoute(event) {
|
||||
const route = event.currentTarget.dataset.route
|
||||
const pureRoute = String(route || '').split('?')[0]
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
<text class="section-title">平台联系信息</text>
|
||||
<block wx:if="{{contact}}">
|
||||
<text wx:if="{{contact.contactName}}" class="contact-line">{{contact.contactName}} {{contact.roleLabel || ''}}</text>
|
||||
<text wx:if="{{contact.phoneAvailable && contact.phone}}" class="contact-line">电话:{{contact.phone}}</text>
|
||||
<text wx:if="{{contact.phoneAvailable}}" class="contact-line">
|
||||
<view class="primary-btn" bindtap="handleDialPlatform">拨打客服电话</view>
|
||||
</text>
|
||||
<text wx:if="{{contact.wechatAvailable && contact.wechatId}}" class="contact-line">微信:{{contact.wechatId}}</text>
|
||||
<text wx:if="{{contact.platformContactText}}" class="contact-line">{{contact.platformContactText}}</text>
|
||||
</block>
|
||||
|
||||
@@ -131,6 +131,21 @@ Page({
|
||||
navigation.navigate('/pages/after-sales/index', { orderId: this.data.id })
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击后才单次取号并拨号,页面不保存号码。
|
||||
*/
|
||||
async handleDialArtist() {
|
||||
if (!this.data.id) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
const dial = await userApi.dialContact('ORDER_ARTIST', this.data.id)
|
||||
wx.makePhoneCall({ phoneNumber: dial.dialNumber })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '获取拨号号码失败', icon: 'none' })
|
||||
}
|
||||
},
|
||||
|
||||
async handleCancelOrder() {
|
||||
const confirmed = await new Promise(resolve => {
|
||||
wx.showModal({
|
||||
|
||||
@@ -51,7 +51,9 @@
|
||||
<view wx:if="{{contact}}" class="page-card contact-card">
|
||||
<text class="section-title">联系信息</text>
|
||||
<text class="contact-line">{{contact.contactName || contact.roleLabel || '服务联系人'}}</text>
|
||||
<text wx:if="{{contact.phoneAvailable && contact.phone}}" class="contact-line">电话:{{contact.phone}}</text>
|
||||
<text wx:if="{{contact.phoneAvailable}}" class="contact-line">
|
||||
<view class="soft-chip" bindtap="handleDialArtist">拨打美甲师电话</view>
|
||||
</text>
|
||||
<text wx:if="{{contact.wechatAvailable && contact.wechatId}}" class="contact-line">微信:{{contact.wechatId}}</text>
|
||||
<text wx:if="{{contact.platformContactText}}" class="contact-line">{{contact.platformContactText}}</text>
|
||||
</view>
|
||||
|
||||
@@ -739,22 +739,9 @@ Page({
|
||||
},
|
||||
|
||||
async handleChangePhoneSubmit() {
|
||||
const userInfo = this.data.userInfo || {}
|
||||
const oldPhone = String(userInfo.phone || '').trim()
|
||||
const newPhone = String(this.data.changePhoneForm.newPhone || '').trim()
|
||||
const verificationCode = String(this.data.changePhoneForm.verificationCode || '').trim()
|
||||
|
||||
/**
|
||||
* `if` page method. Use this from WXML event bindings or lifecycle hooks.
|
||||
* Call guide: read or update page data with `this.setData(...)` inside the method when state changes.
|
||||
*/
|
||||
if (!oldPhone) {
|
||||
wx.showToast({
|
||||
title: '请先绑定手机号',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
// 原手机号由服务端按当前登录用户取,页面展示的是脱敏值,不再回传。
|
||||
|
||||
if (!phoneRegex.test(newPhone)) {
|
||||
wx.showToast({
|
||||
@@ -782,7 +769,6 @@ Page({
|
||||
|
||||
try {
|
||||
await runWithLoading(() => userApi.updatePhone({
|
||||
oldPhone,
|
||||
newPhone,
|
||||
verificationCode
|
||||
}))
|
||||
@@ -829,8 +815,8 @@ Page({
|
||||
}
|
||||
|
||||
try {
|
||||
// 号码由服务端按当前登录用户读取,前端只传场景。
|
||||
await runWithLoading(() => authApi.sendVerificationCode({
|
||||
phone,
|
||||
sceneCode: 'USER_CHANGE_PASSWORD_SMS_CODE'
|
||||
}))
|
||||
wx.showToast({
|
||||
|
||||
@@ -180,8 +180,8 @@ Page({
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: handleContactManager retrieves and shows the current shop manager contact.
|
||||
* Usage: bind it to the contact button and require login before exposing phone data.
|
||||
* Purpose: handleContactManager 点击后才单次取号并拨号,页面不再保存或展示号码。
|
||||
* Usage: 绑定到联系按钮,要求登录后由服务端按场景鉴权。
|
||||
*/
|
||||
async handleContactManager() {
|
||||
const shopInfo = this.data.shopInfo
|
||||
@@ -191,20 +191,9 @@ Page({
|
||||
try {
|
||||
const contact = await userApi.getShopManagerContact(shopInfo.id)
|
||||
this.setData({ managerContact: contact })
|
||||
if (contact && contact.phoneAvailable && contact.phone) {
|
||||
wx.showModal({
|
||||
title: contact.contactName || '店长联系方式',
|
||||
content: `${contact.roleLabel || '店长'}:${contact.phone}`,
|
||||
confirmText: '拨打',
|
||||
cancelText: '复制',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
wx.makePhoneCall({ phoneNumber: contact.phone })
|
||||
} else {
|
||||
wx.setClipboardData({ data: contact.phone })
|
||||
}
|
||||
}
|
||||
})
|
||||
if (contact && contact.phoneAvailable) {
|
||||
const dial = await userApi.dialContact('SHOP_MANAGER', shopInfo.id)
|
||||
wx.makePhoneCall({ phoneNumber: dial.dialNumber })
|
||||
return
|
||||
}
|
||||
wx.showToast({
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<view class="contact-row">
|
||||
<view class="primary-btn contact-btn" bindtap="handleContactManager">联系店长</view>
|
||||
<view wx:if="{{managerContact}}" class="contact-copy">
|
||||
{{managerContact.contactName || '店长'}} · {{managerContact.phoneAvailable ? managerContact.phone : (managerContact.platformContactText || '暂无电话')}}
|
||||
{{managerContact.contactName || '店长'}} · {{managerContact.phoneAvailable ? '点击“联系店长”获取当次号码' : (managerContact.platformContactText || '暂无电话')}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user