123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- import {httpApi} from "../../request/httpApi";
- import website from "@/config/index";
- import md5 from 'js-md5'
- export default {
- //分页数据
- async userLogin({tenantId, deptId, roleId, username, password, type, key, code}) {
- return httpApi({
- url: '/api/blade-auth/oauth/token',
- method: 'post',
- headers: {
- 'Tenant-Id': tenantId,
- 'Dept-Id': (website.switchMode ? deptId : ''),
- 'Role-Id': (website.switchMode ? roleId : ''),
- 'Captcha-Key': key,
- 'Captcha-Code': code,
- },
- params: {
- tenantId,
- username,
- password: md5(password),
- grant_type: (website.captchaMode ? "captcha" : "password"),
- scope: "all",
- type
- }
- })
- },
- async refreshToken({token, tenantId, deptId, roleId}) {
- return httpApi({
- url: '/api/blade-auth/oauth/token',
- method: 'post',
- headers: {
- 'Tenant-Id': tenantId,
- 'Dept-Id': (website.switchMode ? deptId : ''),
- 'Role-Id': (website.switchMode ? roleId : ''),
- },
- params: {
- tenantId,
- refresh_token: token,
- grant_type: 'refresh_token',
- scope: 'all',
- },
- })
- },
- async queryCurrentUserData() {
- return httpApi({
- url: '/api/blade-business/userViewProjectContract/queryCurrentUserData',
- method: 'post',
- data: {},
- })
- },
- //更新用户信息
- async updateUserInfo(form) {
- return httpApi({
- url: '/api/blade-user/update-info',
- method: 'post',
- data: form,
- })
- },
- async appQuerYownData(form) {
- return httpApi({
- url: '/api/blade-manager/managerHomePage/appqueryowndata',
- method: 'post',
- data: form,
- })
- },
- //修改密码
- async updatePassword(form) {
- return httpApi({
- url: '/api/blade-user/update-password',
- method: 'post',
- params: form,
- })
- },
- //用户配置详情
- async userConfigInfo(form) {
- return httpApi({
- url: '/api/blade-business/defaultConfig/detail',
- method: 'get',
- params: form,
- })
- },
- //用户配置保存
- async userConfigSave(form) {
- return httpApi({
- url: '/api/blade-business/defaultConfig/saveOrUpdate',
- method: 'post',
- data: form,
- })
- },
- async loginByToken (form) {
- return httpApi({
- url: '/api/blade-user/loginByToken',
- method: 'post',
- params: form, // 将 params 改为 data
- });
- },
- // 获取租户ID
- async getTenantID (domain) {
- return httpApi({
- url: '/api/blade-system/tenant/info',
- method: 'get',
- params: {
- domain,
- },
- });
- }
- }
|