Commit d558c083 authored by TZW's avatar TZW

11301352

parent 124df178
......@@ -30,6 +30,7 @@ const loginOut = async () => {
const AvatarDropdown = ({ menu }) => {
const { initialState, setInitialState } = useModel('@@initialState');
console.log('initialState,', initialState);
const [visible, cv] = useState(false),
[formRef] = Form.useForm(),
{ run, loading } = useRequest(doFetch, {
......@@ -117,10 +118,11 @@ const AvatarDropdown = ({ menu }) => {
}
const { currentUser } = initialState;
if (!currentUser || !currentUser.userName) {
if (!currentUser || !currentUser.username) {
return loadings;
}
let saveData = (values) => {
let newfields = JSON.parse(JSON.stringify(values));
delete newfields.confirmPassword;
......@@ -186,7 +188,7 @@ const AvatarDropdown = ({ menu }) => {
<HeaderDropdown overlay={menuHeaderDropdown}>
<span className={`${styles.action} ${styles.account}`}>
<Avatar style={{ backgroundColor: '#1890ff' }}>
{currentUser.userName.substr(0, 1)}
{currentUser.username.substr(0, 1)}
</Avatar>
<span className={`${styles.name} anticon`} style={{ margin: '0 12px' }}>
......
......@@ -79,7 +79,7 @@ const Login = () => {
try {
// 登录
const res = await doFetch({
url: `/token/oauth/token?grant_type=password&client_id=userservice1&client_secret=1234&username=${values?.userName}&password=${values?.password}`,
url: `/token/oauth/token?grant_type=password&client_id=NGEMS3&client_secret=ems_Nangao@2022&username=${values?.userName}&password=${values?.password}`,
});
if (res?.access_token) {
let token = res?.access_token;
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-10 15:41:24
* @Last Modified time: 2022-11-30 12:20:15
*/
import * as React from 'react';
......@@ -74,7 +74,7 @@ function Factory(props) {
params,
});
if (res.code === '0000') {
message.success('新增成功!');
message.success('编辑成功!');
setDrawer((s) => ({
...s,
visible: false,
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:43:54
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-10 16:25:11
* @Last Modified time: 2022-11-30 13:16:10
*/
import * as React from 'react';
......@@ -74,7 +74,7 @@ function Section(props) {
params,
});
if (res.code === '0000') {
message.success('新增成功!');
message.success('编辑成功!');
setdrawer((s) => ({
...s,
visible: false,
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:43:54
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-25 10:03:59
* @Last Modified time: 2022-11-30 13:15:45
*/
import * as React from 'react';
......@@ -74,7 +74,7 @@ function Section(props) {
params,
});
if (res.code === '0000') {
message.success('新增成功!');
message.success('编辑成功!');
setdrawer((s) => ({
...s,
visible: false,
......
......@@ -89,7 +89,7 @@ function getcolumns(setdrawer) {
{
title: '负责工厂',
dataIndex: 'factoryNames',
key: 'factoryNames',
key: 'factoryIdList',
search: false,
fieldProps: {
placeholder: '请选择',
......@@ -116,7 +116,7 @@ function getcolumns(setdrawer) {
options: {
path: '/auth/sysShop/getShopSelectionByFactoryIdList',
linkParams: {
factoryNames: 'factoryIdList',
factoryIdList: 'factoryIdList',
},
},
key: 'shopId',
......@@ -128,7 +128,7 @@ function getcolumns(setdrawer) {
dataIndex: 'sectionName',
align: 'center',
search: false,
key: 'sectionId',
key: 'sectionIdList',
fieldProps: {
placeholder: '请选择',
showSearch: true,
......@@ -154,7 +154,7 @@ function getcolumns(setdrawer) {
mode: 'multiple',
},
search: false,
key: 'productLineName',
key: 'productionLineIdList',
align: 'center',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShopIdList',
......@@ -166,7 +166,7 @@ function getcolumns(setdrawer) {
{
title: '角色配置',
dataIndex: 'roleNames',
key: 'roleNames',
key: 'roleIdList',
valueType: 'select',
search: false,
fieldProps: {
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-29 18:04:45
* @Last Modified time: 2022-11-30 12:17:26
*/
import * as React from 'react';
......@@ -66,11 +66,24 @@ function User(props) {
title: '编辑',
val: 'only',
onFinish: async (vals) => {
console.log(1);
let userCharReqList = [];
console.log('id:', row.id);
for (let i in vals) {
if (!isNaN(Number(i))) {
userCharReqList.push({
fieldId: i,
fieldRealValue: vals[i],
});
delete vals[i];
}
}
let params = {
...vals,
id: row.id,
id: row?.id,
shopIdList: vals.shopId,
userCharReqList,
};
delete params.shopId;
let res = await doFetch({
url: urlParams.save,
params,
......@@ -201,25 +214,22 @@ function User(props) {
}
let params = {
...vals,
factoryIdList: vals.factoryNames,
id: drawer?.title == '编辑' ? drawer?.item?.id : '',
shopIdList: vals.shopId,
sectionIdList: vals.sectionId,
productionLineIdList: vals.productLineName,
roleIdList: vals.roleNames,
userCharReqList,
};
delete params.factoryNames;
delete params.shopId;
delete params.sectionId;
delete params.productLineName;
delete params.roleNames;
console.log(params, '!!!!');
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
if (drawer?.title == '编辑') {
message.success('编辑成功!');
} else {
message.success('新增成功!');
}
setDrawer((s) => ({
...s,
visible: false,
......
......@@ -13,7 +13,7 @@ function getcolumns(setdrawer) {
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '所属工厂名称',
title: '所属工厂',
dataIndex: 'factoryName',
key: 'factoryId',
valueType: 'select',
......
......@@ -10,7 +10,7 @@ export function fakeAccountLogin(params) {
//登出
export function fakeAccountLoginOut(params) {
return request(`/ngic-auth/sysAccount/logout`, {
return request(`/emspro/logout`, {
method: 'POST',
data: params,
});
......@@ -26,7 +26,7 @@ export function saveForRegister(params) {
//个人信息
export function queryCurrentUser(params) {
return request('/ngic-auth/sysUser/query', {
return request('/emspro/auth/sysUser/me', {
method: 'POST',
data: params,
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment