| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- import {
- postJ,
- post,
- get
- } from '@/utils/request'
- import Vue from 'vue'
- /**
- * 登录
- */
- export async function login(data) {
- const res = await postJ(Vue.prototype.apiUrl + '/main/user/login', data)
- if (res.code == 0) {
- return res
- }
- return Promise.reject(res.message)
- }
- /**
- * 获取用户信息
- */
- export async function getLoginUser(data) {
- const res = await get(Vue.prototype.apiUrl + '/system/account/getLoginUser', data)
- if (res.code == 0) {
- return res.data
- }
- return Promise.reject(res.message)
- }
- // 公司名称
- export async function usName() {
- const data = await get(Vue.prototype.apiUrl + `/pda/mes/us/indexName`)
- if (data.code == 0) {
- return data.data
- }
- return Promise.reject(data.message)
- }
- // 工序列表
- export async function producetaskList() {
- const data = await get(Vue.prototype.apiUrl + `/main/producetask/list`)
- if (data.code == 0) {
- return data.data
- }
- return Promise.reject(data.message)
- }
- /**
- * 查询机构列表
- * @param params 查询条件
- */
- export async function listOrganizations(params) {
- const res = await get(Vue.prototype.apiUrl + `/main/group/getGroupList`, params)
- console.log(res.code, '=====')
- if (res.code == 0) {
- return res.data
- }
- return Promise.reject(new Error(res.message))
- }
- /**
- * 查询人员列表
- * @param params 查询条件
- */
- export async function getUserPage(params) {
- // let par = new URLSearchParams(params);
- const res = await get(Vue.prototype.apiUrl + `/main/user/getUserPage`, params)
- if (res.code == 0) {
- return res.data
- }
- return Promise.reject(new Error(res.message))
- }
- /**
- * 获取所有用户
- *
- */
- export async function listAllUserBind() {
- const res = await get(Vue.prototype.apiUrl + `/main/user/listAllUserBind`)
- if (res.code == 0) {
- return res.data
- }
- return Promise.reject(new Error(res.message))
- }
- /**
- * 获取部门所有父级
- *
- */
- export async function getParentIdListByDeptId(id) {
- const res = await get(Vue.prototype.apiUrl + `/main/group/getParentIdListById/${id}`)
- if (res.code == 0) {
- return res.data
- }
- return Promise.reject(new Error(res.message))
- }
- // 获取字典
- export async function getDictByCode(code) {
- const data = await get(
- Vue.prototype.apiUrl + `/system/dict/getByCode/${code}`,
- );
- if (data.code == 0) {
- return data.data;
- }
- return Promise.reject(data.message);
- }
- export async function getLatestVersion(code) {
- const data = await get(
- Vue.prototype.apiUrl + `/sys/appupdates/getLatestVersion`,
- );
- if (data.code == 0) {
- return data.data;
- }
- return Promise.reject(data.message);
- }
|