File tree Expand file tree Collapse file tree 5 files changed +61
-2
lines changed Expand file tree Collapse file tree 5 files changed +61
-2
lines changed Original file line number Diff line number Diff line change 26
26
- [x] [ 短信登录] ( http://jike-sdk.surge.sh/functions/api_users.loginWithSmsCode.html )
27
27
- [x] [ 手机号与密码登录] ( http://jike-sdk.surge.sh/functions/api_users.loginWithPhoneAndPassword.html )
28
28
- [x] [ 弹一弹头像] ( http://jike-sdk.surge.sh/functions/api_users.avatarGreet.html )
29
+ - [x] [ 修改用户信息] ( http://jike-sdk.surge.sh/functions/api_users.editProfile.html )
29
30
- [ ] ~~ 保存设备 Token~~
30
31
- [ 用户关系] ( http://jike-sdk.surge.sh/modules/api_user_relation.html )
31
32
- [x] [ 获取关注列表] ( http://jike-sdk.surge.sh/functions/api_user_relation.getFollowingList.html )
Original file line number Diff line number Diff line change 1
1
import { getApiConfig , request , toResponse } from '../request'
2
+ import type { EditProfilePayload } from '../types/options'
2
3
import type { Users } from '../types/api-responses'
3
4
4
5
/**
@@ -110,3 +111,16 @@ export const avatarGreet = <T = Users.AvatarGreetResponse>(username: string) =>
110
111
} ,
111
112
} )
112
113
)
114
+
115
+ /**
116
+ * 修改用户信息
117
+ * @param payload 更新后的信息
118
+ */
119
+ export const editProfile = < T = Users . EditProfileResponse > (
120
+ payload : EditProfilePayload
121
+ ) =>
122
+ toResponse < T > (
123
+ request . post ( '1.0/users/editProfile' , {
124
+ json : payload ,
125
+ } )
126
+ )
Original file line number Diff line number Diff line change @@ -135,8 +135,11 @@ export namespace Users {
135
135
? MyProfile
136
136
: UserProfile
137
137
138
- export interface AvatarGreetResponse {
139
- success : boolean
138
+ export type AvatarGreetResponse = { }
139
+
140
+ export interface EditProfileResponse {
141
+ toast : LiteralUnion < '已更新' >
142
+ alert ?: any
140
143
}
141
144
}
142
145
Original file line number Diff line number Diff line change @@ -127,6 +127,23 @@ export interface Profile {
127
127
storyStatus : LiteralUnion < StoryStatus >
128
128
/** 是否夸夸过 */
129
129
respected : boolean
130
+ /** 行业 */
131
+ industries ?: number [ ]
132
+ /** 情感状态 */
133
+ relationshipState ?: {
134
+ id : string
135
+ text : LiteralUnion <
136
+ | '母胎solo'
137
+ | '今日单身'
138
+ | '等TA出现'
139
+ | '自由可撩'
140
+ | '单身不撩'
141
+ | '心里有人'
142
+ | '恋爱中'
143
+ | '一言难尽'
144
+ >
145
+ }
146
+ sponsorIconType ?: LiteralUnion < 'DEFAULT' | 'COLORFUL' | 'NONE' >
130
147
131
148
[ key : string ] : any
132
149
}
Original file line number Diff line number Diff line change
1
+ import type { Profile } from './entity'
1
2
import type { LiteralUnion } from '../utils'
2
3
3
4
/**
@@ -116,3 +117,26 @@ export interface UserUnfollowOption {
116
117
pageName ?: number
117
118
ref ?: string
118
119
}
120
+
121
+ /**
122
+ * @description 修改用户信息选项
123
+ */
124
+ export interface EditProfilePayload
125
+ extends Partial <
126
+ Pick <
127
+ Profile ,
128
+ | 'bio'
129
+ | 'gender'
130
+ | 'school'
131
+ | 'industries'
132
+ | 'country'
133
+ | 'province'
134
+ | 'city'
135
+ | 'birthday'
136
+ | 'screenName'
137
+ >
138
+ > {
139
+ /** 情感状态 */
140
+ relationshipState ?: string
141
+ [ key : string ] : any
142
+ }
You can’t perform that action at this time.
0 commit comments