chore: 初始化前端仓库并迁移 admin-ui
- 创建 rui-frontend 前端仓库 - 迁移 admin-ui 管理后台 - 创建 cashier-mobile 和 customer-mobile 占位项目 - 配置 pnpm workspace
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { request } from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 用户岗位关联服务
|
||||
*/
|
||||
class UserPostService {
|
||||
private baseUrl = '/user/admin/user-post'
|
||||
|
||||
/**
|
||||
* 查询用户已分配的岗位ID列表
|
||||
*/
|
||||
async listPostIdsByUserId(userId: number | string): Promise<number[]> {
|
||||
const res: any = await request({
|
||||
url: `${this.baseUrl}/user/${userId}`,
|
||||
method: 'get',
|
||||
})
|
||||
return res.data || []
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配用户岗位
|
||||
*/
|
||||
async assignPosts(userId: number | string, postIds: number[]): Promise<boolean> {
|
||||
const res: any = await request({
|
||||
url: `${this.baseUrl}/user/${userId}`,
|
||||
method: 'post',
|
||||
data: postIds,
|
||||
})
|
||||
return res.data === true
|
||||
}
|
||||
}
|
||||
|
||||
/** 用户岗位关联服务单例 */
|
||||
export const userPostService = new UserPostService()
|
||||
Reference in New Issue
Block a user