fix: some
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 2m59s

This commit is contained in:
luo
2026-10-13 14:53:19 +08:00
parent 77b0e25011
commit da95a914e3
31 changed files with 1702 additions and 116 deletions

View File

@@ -1,4 +1,7 @@
import request from '@/utils/request.js';
import { useAssetStore } from '@/store/asset.js';
import { useUserStore } from '@/store/user.js';
import { getSessionContext, isCurrentSession } from '@/utils/session-context.js';
export const normalizeAssetInfo = (data = {}) => ({
...data,
@@ -56,11 +59,23 @@ export const hasActiveOrPendingPackage = async (identifier) => {
export const assetApi = {
getInfo(identifier) {
const context = getSessionContext();
const userStore = useUserStore();
const phoneRevision = userStore.state.phoneRevision;
return request({
url: '/api/c/v1/asset/info',
method: 'GET',
data: { identifier }
}).then(normalizeAssetInfo);
}).then((response) => {
const data = normalizeAssetInfo(response);
if (identifier === context.identifier && isCurrentSession(context)) {
useAssetStore().receiveExpiryReminder(context, data.expiry_reminder);
if (phoneRevision === userStore.state.phoneRevision && typeof data.bound_phone === 'string') {
userStore.setCustomerPhone(data.bound_phone);
}
}
return data;
});
},
getPackageHistory(identifier, page, page_size, params = {}) {

View File

@@ -30,7 +30,8 @@ export const authApi = {
return request({
url: '/api/c/v1/auth/bind-phone',
method: 'POST',
data: { phone, code }
data: { phone, code },
showError: false
});
},

View File

@@ -31,7 +31,7 @@ export const notificationApi = {
markAllRead() {
return request({
url: '/api/c/v1/notifications/read-all',
method: 'PUT'
method: 'POST'
});
}
};