123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637 |
- 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 getCaptchaNew = (uid) => {
- if (uid) {
- return new request({
- url: './sys/captcha',
- method: 'get',
- headers: {
- 'Captcha-Uid': uid,
- 'Captcha-Type': 'number',
- },
- responseType: 'blob',
- });
- } else {
- return new request({
- url: './sys/captcha',
- method: 'get',
- responseType: 'blob',
- headers: {
- 'Captcha-Type': 'number',
- },
- });
- }
- }
- 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, registType) {
- return new request({
- url: './ums/umsUsers/regist',
- method: 'post',
- headers: {
- ANON: true,
- "Content-Type": "application/json"
- },
- data: {
- umsUser,
- code,
- language,
- registType
- }
- })
- }
- 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, language) => {
- 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
- }
- })
- }
- export const saveUserPic = (userPic) => {
- return new request({
- url: './uc/userCenter/saveUserPic',
- method: 'get',
- params: {
- userPic
- }
- })
- }
- export const settingLanguage = (language) => {
- return new request({
- url: './uc/userCenter/settingLanguage',
- method: 'get',
- params: {
- language
- }
- })
- }
- /**
- * 用户成长体系
- */
- // 个人积分
- export const getUserPointPage = () => {
- return new request({
- url: './uc/umsUserPoints/getUserPoint',
- method: 'get',
- // params: {
- // userUid
- // }
- })
- }
- // 用户获取任务接口
- export const getUserTaskComplete = (language) => {
- return new request({
- url: './uc/umsUserTasks/getUserTaskComplete',
- method: 'get',
- })
- }
- // 用户完成任务获得积分接口
- export const addPointDetailByTaskDict = ({ taskDict, point }, token) => {
- return new request({
- url: './uc/umsUserPointDetailss/addPointDetailByTaskDict',
- method: 'post',
- data: {
- taskDict, point
- },
- headers: {
- token
- },
- })
- }
- // 用户签到
- export const addSignPointDetail = ({ taskDict, point }, token) => {
- return new request({
- url: './uc/umsUserPointDetailss/addSignPointDetail',
- method: 'post',
- data: {
- taskDict,
- point,
- },
- headers: {
- token
- },
- })
- }
- // 积分明细接口
- export const getUserPointDetailsPage = (params) => {
- return new request({
- url: './uc/umsUserPointDetailss/getUserPointDetailsPage',
- method: 'get',
- params: params
- })
- }
- // 积分兑换商品列表
- export const umsPointCommoditys = () => {
- return new request({
- url: './uc/umsPointCommoditys/commodityList',
- method: 'get',
- // params: params
- })
- }
- // 下载咨询等扣减积分
- export const downloadDeductingIntegral = (params, token) => {
- return new request({
- url: './uc/umsUserPointDetailss/reducePoint?taskDict=' + params,
- method: 'post',
- headers: {
- token
- },
- })
- }
- // 成长值任务列表
- export const growthValueTaskList = () => {
- return new request({
- url: './uc/umsUserGrowthTasks/getUserGrowthTaskComplete',
- method: 'get',
- // params: params
- })
- }
- // 新增成长值
- export const completeGrowthValue = ({ taskDict }, token) => {
- return new request({
- url: './uc/umsUserGrowthDetailss/addGrowthDetailByTaskDict',
- method: 'post',
- data: {
- taskDict
- },
- headers: {
- token
- },
- })
- }
- // 成长值明细
- export const getUserGrowthDetails = (params) => {
- return new request({
- url: './uc/umsUserGrowthDetailss/getGrowthDetailsPage',
- method: 'get',
- params: params
- })
- }
- // 兑换商品
- export const exchangeUserPoints = (data, token) => {
- return new request({
- url: './uc/umsUserPoints/exchangeUserPoints',
- method: 'post',
- data: {
- umsPointCommodity: data
- },
- headers: {
- token
- },
- })
- }
- //支付
- export const exchangeUserPointsStatus = (params,userAddressId,token) => {
- return new request({
- url: './uc/umsUserPoints/exchangeUserPoints',
- method: 'post',
- data: {
- umsPointCommodity:params,
- userAddressId,
- },
- headers: {
- token
- },
- })
- }
- // 获取省市区
- export const getSysAreaList = (params) => {
- return new request({
- url: './uc/umsUserCommodityAddresss/getSysAreaList',
- method: 'get',
- params: params
- })
- }
- // 查询地址列表
- export const getUmsUserCommodityAddresss = (params) => {
- return new request({
- url: './uc/umsUserCommodityAddresss',
- method: 'get',
- params: params
- })
- }
- // 新增修改地址
- export const addUmsUserCommodityAddresss = (data, token) => {
- return new request({
- url: './uc/umsUserCommodityAddresss/saveAddress',
- method: 'post',
- headers: {
- token
- },
- data: data
- })
- }
- // 修改已有订单的地址
- export const modifyAddress = (umsUserCommodityAddress, orderId, token) => {
- return new request({
- url: './uc/umsUserCommodityAddresss/updateOrderAddress',
- method: 'post',
- headers: {
- token
- },
- data: { umsUserCommodityAddress, orderId }
- })
- }
- // 删除地址
- export const deleteUmsUserCommodityAddresss = (id, token) => {
- return new request({
- url: './uc/umsUserCommodityAddresss/' + id,
- headers: {
- token
- },
- method: 'delete',
- });
- }
- // 获取商品详情
- export const getProductDetails = id => {
- return new request({
- url: './uc/umsPointCommoditys/' + id,
- method: 'get',
- });
- }
- // 删除订单
- export const deleteOrders = (id, token) => {
- return new request({
- url: './uc/umsPointCommodityOrders/' + id,
- headers: {
- token
- },
- method: 'delete',
- });
- }
- // 订单评论
- export const orderReview = (data,orderNo, token) => {
- return new request({
- url: './uc/umsOrderComments',
- method: 'post',
- headers: {
- token
- },
- data: { umsOrderComment: data ,
- orderNo:orderNo}
- })
- }
- // 获取订单列表
- export const toObtainListOrder = (params) => {
- return new request({
- url: './uc/umsPointCommodityOrders/getMyOrderPage',
- method: 'get',
- params: params
- });
- }
- // 取消订单
- export const cancelGoodsOrders = (id, token) => {
- return new request({
- url: './uc/umsPointCommodityOrders/cancelOrder?id=' + id,
- headers: {
- token
- },
- method: 'post',
- });
- }
- // 订单详情
- export const orderDetails = (id) => {
- return new request({
- url: './uc/umsPointCommodityOrders/getCommodityOrderDetails?orderId=' + id,
- method: 'get',
- });
- }
- // 订单确认
- export const orderConfirmation = (id, token) => {
- return new request({
- url: './uc/umsPointCommodityOrders/confirmOrder?id=' + id,
- method: 'post',
- headers: {
- token
- },
- });
- }
- // 用户等级
- export const getUserLevelList = () => {
- return new request({
- url: './uc/umsUserGrowthGrades',
- method: 'get',
- });
- }
- // 用户权益
- export const getUserRightsList = () => {
- return new request({
- url: './uc/umsUserGrowthRights',
- method: 'get',
- });
- }
- // 积分商城个人订单
- export const getPersonalOrder = (id) => {
- return new request({
- url: './uc/umsPointCommoditys/getCommodityOrderByUserId?commodityId=' + id,
- method: 'get',
- });
- }
- //支付
- export const getMoney = (orderId,payType,token) => {
- return new request({
- url: './uc/umsUserPoints/userCommonPay' ,
- method: 'post',
- data:{
- orderId:orderId,
- payType:payType,
- },
- headers: {
- token
- },
- });
- }
- //支付状态
- export const getMoneyStatus = (orderNo) => {
- return new request({
- url: './uc/commonPay/checkUserPayStatus?orderNo=' + orderNo ,
- method: 'get',
- });
- }
|