123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- import request from '@/utils/request'
- import qs from 'qs'
- import {
- getToken
- } from '@/utils/auth'
- import {
- method
- } from 'lodash';
- export const getUsers = (params) => {
- return new request({
- url: './sys/authUsers',
- method: 'get',
- params: params
- });
- }
- export const updatePwd = (params, token) => {
- return new request({
- url: './sys/authUsers/updatePwd',
- method: 'post',
- headers: {
- token
- },
- data: qs.stringify(Object.assign({
- rm: 1,
- }, params))
- });
- }
- export const updatePwdLogout = () => {
- return new request({
- url: './ums/logout',
- method: 'delete',
- });
- }
- export const getMenus = () => {
- return new request({
- url: './sys/menus',
- method: 'get',
- params: {
- applicationId: 2
- }
- });
- }
- export const getMyMenuTreeData = () => {
- return new request({
- url: './sys/menus/myTreeData',
- method: 'get',
- });
- }
- export const getChildrenMenuNum = (menuName) => {
- return new request({
- url: './sys/menus/getChildrenMenuNum',
- method: 'get',
- params: {
- menuName
- }
- });
- }
- export const getUserAuthorities = (userId) => {
- return new request({
- url: './uua/' + userId + '/authorities',
- method: 'get',
- });
- }
- export const getEmailCode = (account, email) => {
- return new request({
- url: './sys/authUsers/emailCode',
- method: 'get',
- params: {
- account,
- email
- }
- });
- }
- export const getSmsCode = (account, service) => {
- return new request({
- url: './sys/authUsers/smsCode',
- method: 'get',
- params: {
- account,
- service
- }
- });
- }
- export const getMobileSmsCode = (mobile, service) => {
- return new request({
- url: './sys/authUsers/mobile/smsCode',
- method: 'get',
- params: {
- mobile,
- service
- }
- });
- }
- export const getCaptcha = (uid) => {
- if (uid) {
- return new request({
- url: './sys/captcha',
- method: 'get',
- headers: {
- 'Captcha-Uid': uid
- },
- responseType: 'blob'
- });
- } else {
- return new request({
- url: './sys/captcha',
- method: 'get',
- responseType: 'blob'
- });
- }
- }
- export const resetPwd = (account, newPwd, surePwd, code) => {
- return new request({
- url: './sys/authUsers/resetPwd',
- method: 'post',
- data: qs.stringify({
- account,
- newPwd,
- surePwd,
- code
- })
- });
- }
- export const addToUserGroup = (userUid, groupKey, token) => {
- return new request({
- url: './sys/authUsers/' + userUid + "/group",
- method: 'post',
- headers: {
- token
- },
- data: qs.stringify({
- groupKey
- })
- });
- }
- export const findBasicInfo = () => {
- return new request({
- url: './uc/userCenter/findBasicInfo',
- method: 'get'
- });
- }
- export const findUserInfo = () => {
- return new request({
- url: './uc/userCenter/userInfo',
- method: 'get'
- })
- }
- export const saveUserInfo = (userNickName, basePersonnelInfo) => {
- return new request({
- url: './uc/userCenter/updateUserInfo',
- method: 'post',
- data: {
- basePersonnelInfo,
- userNickName
- }
- })
- }
- export const removeFromUserGroup = (userUid, groupKey) => {
- return new request({
- url: './sys/authUsers/' + userUid + "/group",
- method: 'delete',
- params: {
- groupKey
- }
- });
- }
- export function sendTelCode(account, service, language) {
- return new request({
- url: './ums/umsUsers/registCode',
- method: 'get',
- headers: {
- ANON: true
- },
- params: {
- account,
- service,
- language
- }
- });
- }
- export function registerByTel(umsUser, code, language) {
- return new request({
- url: './ums/umsUsers/regist',
- method: 'post',
- headers: {
- ANON: true,
- "Content-Type": "application/json"
- },
- data: {
- umsUser,
- code,
- language
- }
- })
- }
- export function checkCodeLogin(mobile, checkCode) {
- console.log('mobile,checkCode:', mobile, checkCode)
- return new request({
- url: './uc/userRegisterAndLogin/checkCodeLogin?mobile=' + mobile + '&checkCode=' + checkCode,
- method: 'get'
- });
- console.log(new request({
- url: './uc/userRegisterAndLogin/checkCodeLogin?mobile=' + mobile + '&checkCode=' + checkCode,
- method: 'get'
- }))
- }
- export const setPwd = (param) => {
- param = JSON.parse(param)
- let token = getToken()
- param.Authorization = token;
- param = JSON.stringify(param);
- return new request({
- url: './ums/umsUsers/changePassword',
- method: 'post',
- headers: {
- ANON: true
- },
- data: {
- param
- }
- })
- }
- export const updatePrsonnelInfo = (umsUser) => {
- return new request({
- url: './uc/userRegisterAndLogin/updatePrsonnelInfo',
- method: 'post',
- headers: {
- ANON: true,
- },
- data: {
- umsUser,
- language
- }
- })
- }
- export const updateEmail = (email, code) => {
- return new request({
- url: './uc/securitySetting/updateEmail',
- method: 'get',
- params: {
- email,
- code
- }
- })
- }
- //根据用户id获取用户信息
- export const getUserInfoById = (id) => {
- return new request({
- url: './uc/securitySetting/getUserInfoById',
- method: 'get'
- })
- }
- export const validCheckCode = (mobile, code) => {
- return new request({
- url: './uc/securitySetting/validCode',
- method: 'get',
- params: {
- mobile,
- code
- }
- })
- }
- export const updateMobile = (mobile, code) => {
- return new request({
- url: './uc/securitySetting/updateMobile',
- method: 'get',
- params: {
- mobile,
- code
- }
- })
- }
|