zhengpengju 3 years ago
parent 39c2e09020
commit 2bdf1b3594

@ -60,6 +60,14 @@ export async function getInitialState(): Promise<{
u_type: 1, // 用户类型
random_num: new Date().getTime(),
});
// 角色权限判断 2: 校管理员 4: 普通教师
/*
const rule_ids = cookie.load('background_role_id')?.split(',') || []
console.log('rules',rule_ids,rule_ids.indexOf(5))
if(rule_ids.indexOf('2') === -1){
cookie.remove('person_id')
history.push(loginPath)
}*/
console.log('avatar: ',`/dsideal_yy/html/thumb/Material/${tx?.file_id?.substr(0,2)}/${tx?.file_id}.${tx?.extension}`)
return {name: msg?.person_name, userid: msg?.person_id, avatar: `/dsideal_yy/html/thumb/Material/${tx?.file_id?.substr(0,2)}/${tx?.file_id}.${tx?.extension}`};
} catch (error) {

@ -266,7 +266,7 @@ const CourseList: React.FC = () => {
<Upload
accept='.mp4'
action='/dsideal_yy/res/plupload/'
defaultFileList={item.initialValue ? [item.initialValue.map(item=>({...item, url:'/dsideal_yy/html/' + item.url}))] : []}
defaultFileList={item.initialValue ? [item.initialValue].map(item=>({...item, url:'/dsideal_yy/html/' + item.url})) : []}
beforeUpload={async (file) => {
/** 获取视频文件信息 */
const {media: {track:[General, Video, Audio]}} = await getInfo(file)
@ -275,7 +275,6 @@ const CourseList: React.FC = () => {
message.error('视频编码格式不正确视频采用AVC音频采用AAC')
return false;
}
// console.log('file', file)
// 获取文件名
SetUploadFileName(file?.name);
// 获取最后一个.的位置
@ -294,9 +293,6 @@ const CourseList: React.FC = () => {
}}
maxCount={1}
multiple={false}
file={()=>{
// location.pathname
}}
>
<Button icon={<UploadOutlined />}></Button>
</Upload>

@ -6,7 +6,7 @@ import { useIntl, history, FormattedMessage, SelectLang, useModel } from 'umi';
import Footer from '@/components/Footer';
import { login } from '@/services/ant-design-pro/api';
//import { getFakeCaptcha } from '@/services/ant-design-pro/login';
import cookie from 'react-cookies';
import styles from './index.less';
const LoginMessage: React.FC<{
@ -43,7 +43,10 @@ const Login: React.FC = () => {
try {
// 登录
const msg = await login({ ...values, type });
if (msg.success === true) {
// 角色权限判断 2: 校管理员 4: 普通教师
const rule_ids = cookie.load('background_role_id')?.split(',') || []
console.log('rules',rule_ids,rule_ids.indexOf(5))
if (msg.success && (rule_ids.indexOf('2') !== -1)) {
const defaultLoginSuccessMessage = '登录成功!';
message.success(defaultLoginSuccessMessage);
await fetchUserInfo();

Loading…
Cancel
Save