This commit is contained in:
2025-08-15 16:55:43 +08:00
parent 2986b212a0
commit 10b714e441
7 changed files with 129 additions and 10 deletions
+1
View File
@@ -1,4 +1,5 @@
// 领养专区相关API接口
// 注意:所有接口的鉴权配置已在 http/config/config.js 中统一管理
/**
* 获取待领养宠物列表
-1
View File
@@ -61,7 +61,6 @@ export const addPet = (petData, config = {}) => {
export const updatePet = (petId, petData, config = {}) => {
return uni.$u.http.put(`/pets/${petId}`, petData, {
custom: {
auth: true,
loading: true,
loadingText: '正在更新宠物信息...',
...config.custom
+31 -2
View File
@@ -131,7 +131,6 @@ export const refreshToken = (config = {}) => {
const refreshToken = uni.getStorageSync('refreshToken')
return uni.$u.http.post('/auth/refresh', { refreshToken }, {
custom: {
auth: false,
loading: false,
toast: false,
...config.custom
@@ -217,7 +216,6 @@ export const updateUserSettings = (settings, config = {}) => {
export const bindPhone = (phoneData, config = {}) => {
return uni.$u.http.post('/user/bind-phone', phoneData, {
custom: {
auth: true,
loading: true,
loadingText: '正在绑定手机号...',
...config.custom
@@ -225,3 +223,34 @@ export const bindPhone = (phoneData, config = {}) => {
...config
})
}
/**
* 获取用户权限
* @param {Object} config 自定义配置
* @returns {Promise}
*/
export const getUserPermissions = (config = {}) => {
return uni.$u.http.get('/user/permissions', {
custom: {
loading: false,
...config.custom
},
...config
})
}
/**
* 注销账户
* @param {Object} config 自定义配置
* @returns {Promise}
*/
export const deleteAccount = (config = {}) => {
return uni.$u.http.delete('/user/account', {}, {
custom: {
loading: true,
loadingText: '正在注销账户...',
...config.custom
},
...config
})
}