初始化移动端提交
This commit is contained in:
13
sheep/api/system/area.js
Normal file
13
sheep/api/system/area.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const AreaApi = {
|
||||
// 获得地区树
|
||||
getAreaTree: () => {
|
||||
return request({
|
||||
url: '/system/area/tree',
|
||||
method: 'GET'
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default AreaApi;
|
||||
166
sheep/api/system/auth.js
Normal file
166
sheep/api/system/auth.js
Normal file
File diff suppressed because it is too large
Load Diff
16
sheep/api/system/dict.js
Normal file
16
sheep/api/system/dict.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const DictApi = {
|
||||
// 根据字典类型查询字典数据信息
|
||||
getDictDataListByType: (type) => {
|
||||
return request({
|
||||
url: `/system/dict-data/type`,
|
||||
method: 'GET',
|
||||
params: {
|
||||
type,
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default DictApi;
|
||||
76
sheep/api/system/social.js
Normal file
76
sheep/api/system/social.js
Normal file
@@ -0,0 +1,76 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const SocialApi = {
|
||||
// 获得社交用户
|
||||
getSocialUser: (type) => {
|
||||
return request({
|
||||
url: '/system/social-user/get',
|
||||
method: 'GET',
|
||||
params: {
|
||||
type
|
||||
},
|
||||
custom: {
|
||||
showLoading: false,
|
||||
},
|
||||
});
|
||||
},
|
||||
// 社交绑定
|
||||
socialBind: (type, code, state) => {
|
||||
return request({
|
||||
url: '/system/social-user/bind',
|
||||
method: 'POST',
|
||||
data: {
|
||||
type,
|
||||
code,
|
||||
state
|
||||
},
|
||||
custom: {
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '绑定中',
|
||||
successMsg: '绑定成功',
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
// 社交解绑
|
||||
socialUnbind: (type, openid) => {
|
||||
return request({
|
||||
url: '/system/social-user/unbind',
|
||||
method: 'DELETE',
|
||||
data: {
|
||||
type,
|
||||
openid
|
||||
},
|
||||
custom: {
|
||||
showLoading: false,
|
||||
loadingMsg: '解除绑定',
|
||||
successMsg: '解绑成功',
|
||||
},
|
||||
});
|
||||
},
|
||||
// 获取订阅消息模板列表
|
||||
getSubscribeTemplateList: () =>
|
||||
request({
|
||||
url: '/system/social-user/get-subscribe-template-list',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showError: false,
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
// 获取微信小程序码
|
||||
getWxaQrcode: async (path, query) => {
|
||||
return await request({
|
||||
url: '/system/social-user/wxa-qrcode',
|
||||
method: 'POST',
|
||||
data: {
|
||||
scene: query,
|
||||
path,
|
||||
checkPath: false, // TODO 开发环境暂不检查 path 是否存在
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default SocialApi;
|
||||
97
sheep/api/system/user.js
Normal file
97
sheep/api/system/user.js
Normal file
@@ -0,0 +1,97 @@
|
||||
import request from '@/sheep/request';
|
||||
|
||||
const UserApi = {
|
||||
// 获得基本信息
|
||||
getUserInfo: () => {
|
||||
return request({
|
||||
url: '/system/user/profile/get',
|
||||
method: 'GET',
|
||||
custom: {
|
||||
showLoading: false,
|
||||
auth: true,
|
||||
},
|
||||
});
|
||||
},
|
||||
// 修改基本信息
|
||||
updateUser: (data) => {
|
||||
return request({
|
||||
url: '/system/user/profile/update',
|
||||
method: 'PUT',
|
||||
data,
|
||||
custom: {
|
||||
auth: true,
|
||||
showSuccess: true,
|
||||
successMsg: '更新成功'
|
||||
},
|
||||
});
|
||||
},
|
||||
// 修改用户手机
|
||||
updateUserMobile: (data) => {
|
||||
return request({
|
||||
url: '/system/user/profile/update-mobile',
|
||||
method: 'PUT',
|
||||
data,
|
||||
custom: {
|
||||
loadingMsg: '验证中',
|
||||
showSuccess: true,
|
||||
successMsg: '修改成功'
|
||||
},
|
||||
});
|
||||
},
|
||||
// 基于微信小程序的授权码,修改用户手机
|
||||
updateUserMobileByWeixin: (code) => {
|
||||
return request({
|
||||
url: '/system/user/profile/update-mobile-by-weixin',
|
||||
method: 'PUT',
|
||||
data: {
|
||||
code
|
||||
},
|
||||
custom: {
|
||||
showSuccess: true,
|
||||
loadingMsg: '获取中',
|
||||
successMsg: '修改成功'
|
||||
},
|
||||
});
|
||||
},
|
||||
// 修改密码
|
||||
updateUserPassword: (data) => {
|
||||
return request({
|
||||
url: '/system/user/profile/update-password',
|
||||
method: 'PUT',
|
||||
data,
|
||||
custom: {
|
||||
loadingMsg: '验证中',
|
||||
showSuccess: true,
|
||||
successMsg: '修改成功'
|
||||
},
|
||||
});
|
||||
},
|
||||
// 重置密码
|
||||
resetUserPassword: (data) => {
|
||||
return request({
|
||||
url: '/system/auth/reset-password',
|
||||
method: 'POST',
|
||||
data,
|
||||
custom: {
|
||||
loadingMsg: '验证中',
|
||||
showSuccess: true,
|
||||
successMsg: '修改成功'
|
||||
}
|
||||
});
|
||||
},
|
||||
// 上传用户头像
|
||||
uploadAvatar: (data) => {
|
||||
return request({
|
||||
url: '/system/user/profile/update-avatar',
|
||||
method: 'PUT',
|
||||
data,
|
||||
custom: {
|
||||
loadingMsg: '上传中',
|
||||
showSuccess: true,
|
||||
successMsg: '上传成功'
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default UserApi;
|
||||
Reference in New Issue
Block a user