style:根据UI设计图跳转页面样式
This commit is contained in:
@@ -249,6 +249,33 @@ export const uploadOssResource = (filePath) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 上传并更新用户头像(后端接口)
|
||||
export const uploadUserAvatar = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: URL + '/app/user/uploadAvatar',
|
||||
filePath,
|
||||
name: 'file',
|
||||
header: {
|
||||
'appid': appid,
|
||||
'Authorization': 'Bearer ' + uni.getStorageSync('token'),
|
||||
'Clientid': uni.getStorageSync('client_id')
|
||||
},
|
||||
success: (res) => {
|
||||
try {
|
||||
const parsed = typeof res.data === 'string' ? JSON.parse(res.data) : res.data
|
||||
resolve(parsed)
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 获取系统配置(预留接口)
|
||||
// 期望后端返回形如:{ code: 200, data: { expressReturnCountdownSeconds: number } }
|
||||
export const getSystemConfig = () => {
|
||||
|
||||
Reference in New Issue
Block a user