1
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// 领养专区相关API接口
|
||||
// 注意:所有接口的鉴权配置已在 http/config/config.js 中统一管理
|
||||
|
||||
/**
|
||||
* 获取待领养宠物列表
|
||||
|
||||
@@ -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
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user