Browse Source

func 函数重写

dev
yuan_yi 3 years ago
parent
commit
22630d2124
  1. 2
      code/VideoAccess-VCMP/web/client/src/sections/example/actions/example.js
  2. 2
      code/VideoAccess-VCMP/web/client/src/sections/example/containers/example.jsx
  3. 9
      code/VideoAccess-VCMP/web/client/src/utils/func.js

2
code/VideoAccess-VCMP/web/client/src/sections/example/actions/example.js

@ -3,7 +3,7 @@
import { basicAction } from '@peace/utils' import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils' import { ApiTable } from '$utils'
export function getMembers(orgId) { export function getMembers (orgId) {
return dispatch => basicAction({ return dispatch => basicAction({
type: 'get', type: 'get',
dispatch: dispatch, dispatch: dispatch,

2
code/VideoAccess-VCMP/web/client/src/sections/example/containers/example.jsx

@ -1,7 +1,7 @@
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Spin, Card } from '@douyinfe/semi-ui'; import { Spin, Card } from '@douyinfe/semi-ui';
import '../style.less'
const { Meta } = Card; const { Meta } = Card;
const Example = (props) => { const Example = (props) => {

9
code/VideoAccess-VCMP/web/client/src/utils/func.js

@ -1,13 +1,10 @@
'use strict'; 'use strict';
export default class Func { export const isAuthorized = (authcode) => {
static isAuthorized(authcode) {
if (JSON.parse(sessionStorage.getItem('user'))) { if (JSON.parse(sessionStorage.getItem('user'))) {
const { resources } = JSON.parse(sessionStorage.getItem('user')); const { resources } = JSON.parse(sessionStorage.getItem('user'));
return resources.includes(authcode); return resources.includes(authcode);
}else{ } else {
return false; return false;
} }
} }
}
Loading…
Cancel
Save