| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- import request from '@/utils/request'
- import {parseStrEmpty} from "@/utils/yamato.js";
- import {encryptField} from "@/utils/encrypt.js";
- // ユーザーリストを取得
- export function listUser(query) {
- return request({
- url: '/system/user/list',
- method: 'get',
- params: query
- })
- }
- // ユーザー詳細を取得
- export function getUser(userId) {
- return request({
- url: '/system/user/' + parseStrEmpty(userId),
- method: 'get'
- })
- }
- // 新規ユーザーを追加
- export function addUser(data) {
- return request({
- url: '/system/user',
- method: 'post',
- data: data
- })
- }
- // ユーザー情報を修正
- export function updateUser(data) {
- return request({
- url: '/system/user',
- method: 'put',
- data: data
- })
- }
- // ユーザーを論理削除
- export function delLogicUser(row) {
- const { userId, version } = row;
- const data = {
- userId,
- version
- }
- return request({
- url: '/system/user/delLogicUser',
- method: 'post',
- data: data
- })
- }
- // ユーザーパスワードをリセット
- export function resetUserPwd(userId, passwordValue, version) {
- let password = encryptField(passwordValue);
- const data = {
- userId,
- password,
- version
- }
- return request({
- url: '/system/user/resetPwd',
- method: 'put',
- data: data
- })
- }
- // ユーザーステータスを変更
- export function changeUserStatus(row) {
- const { userId, version ,status} = row;
- const data = {
- userId,
- version,
- status
- }
- return request({
- url: '/system/user/changeStatus',
- method: 'post',
- data: data
- })
- }
- // ユーザーパーソナル情報を取得
- export function getUserProfile() {
- return request({
- url: '/system/user/profile',
- method: 'get'
- })
- }
- // ユーザーパーソナル情報を修正
- export function updateUserProfile(data) {
- return request({
- url: '/system/user/profile',
- method: 'put',
- data: data
- })
- }
- // ユーザーパスワードを更新
- export function updateUserPwd(data) {
- // const data = {
- // oldPassword,
- // newPassword
- // }
- return request({
- url: '/system/user/profile/updatePwd',
- method: 'post',
- params: data
- })
- }
- // ユーザーアバターをアップロード
- export function uploadAvatar(data) {
- return request({
- url: '/system/user/profile/avatar',
- method: 'post',
- headers: {'Content-Type': 'application/x-www-form-urlencoded'},
- data: data
- })
- }
- // 認証されたロールを取得
- export function getAuthRole(userId) {
- return request({
- url: '/system/user/authRole/' + userId,
- method: 'get'
- })
- }
- // 認証ロールを保存
- export function updateAuthRole(data) {
- return request({
- url: '/system/user/authRole',
- method: 'put',
- params: data
- })
- }
- // 部門ツリー構造を取得
- export function deptTreeSelect() {
- return request({
- url: '/system/user/deptTree',
- method: 'get'
- })
- }
|