Преглед на файлове

解决 sass后台 昵称加密的问题

dev
yangwenhua преди 1 година
родител
ревизия
01a37f5d67
променени са 3 файла, в които са добавени 49 реда и са изтрити 20 реда
  1. +1
    -1
      config/proxy.js
  2. +1
    -0
      package.json
  3. +47
    -19
      src/pages/member/memberInfo/index.jsx

+ 1
- 1
config/proxy.js Целия файл

@@ -9,7 +9,7 @@
export default {
dev: {
'/kitchen/': {
target: 'https://localhost:5001/',
target: 'http://kitchen.dev1.com/',
changeOrigin: true,
secure: false, //关闭证书验证
pathRewrite: {


+ 1
- 0
package.json Целия файл

@@ -66,6 +66,7 @@
"classnames": "^2.2.6",
"cos-js-sdk-v5": "^1.3.5",
"echarts": "^5.3.3",
"js-base64": "^3.7.5",
"js-export-excel": "^1.1.4",
"linq": "^4.0.0",
"lodash": "^4.17.11",


+ 47
- 19
src/pages/member/memberInfo/index.jsx Целия файл

@@ -18,6 +18,7 @@ import {
CreateMemberInfo
} from './service';
import { get, set } from 'lodash-es';
import { encode, decode } from 'js-base64';


const CheckboxGroup = Checkbox.Group;
@@ -26,6 +27,30 @@ const plainOptions = ['Apple', 'Pear', 'Orange'];
const defaultCheckedList = ['Apple', 'Orange'];

const key = 'message';

/**
* 判断会员名称是否被小程序加密
* @param {*} str
* @returns
*/
const isBase64 = (str) => {
const result = decode(str);
if (result.includes('BPA_BASE64')) {
return true;
} else {
false;
}
}

/**
* 对小程序加密的昵称进行解密
* @param {*} str
* @returns
*/
const decodeBPABase64 = (str) => {
return decode(str).replace('BPA_BASE64', '');
}

const MemberManage = () => {
const actionRef = useRef();
const actionRef2 = useRef();
@@ -50,8 +75,8 @@ const MemberManage = () => {
});
}

//添加会员信息
const AddMemberInfo = async (fields) => {
//添加会员信息
const AddMemberInfo = async (fields) => {
message.loading('正在添加...', key);
try {
await CreateMemberInfo(JSON.stringify(fields)).then((r) => {
@@ -185,6 +210,9 @@ const MemberManage = () => {
dataIndex: 'nickName',
valueType: 'textarea',
hideInForm: true,
render: (_, record) => (
<a>{isBase64(record.nickName) ? decodeBPABase64(record.nickName) : record.nickName}</a>
)
},
{
title: '电话',
@@ -244,19 +272,19 @@ const MemberManage = () => {
render: (_, record) => {
let template = [
<a
key="primary"
type="primary"
onClick={() => {
SetCreateModalVisible(true);
setCurrentRow(() => {
record.birthday = moment(record.birthday);
setIsLook(true);
return record;
});
}}
>
详情
</a>,
key="primary"
type="primary"
onClick={() => {
SetCreateModalVisible(true);
setCurrentRow(() => {
record.birthday = moment(record.birthday);
setIsLook(true);
return record;
});
}}
>
详情
</a>,
<a
key="primary"
type="primary"
@@ -543,10 +571,10 @@ const MemberManage = () => {
</>
</Modal>
{/* 积分记录 */}
<IntegralRecord
onClose={()=>{SetIntegralRecordVisible(false);}}
memberId={currentRow?.id}
integralRecordVisible={integralRecordVisible}
<IntegralRecord
onClose={() => { SetIntegralRecordVisible(false); }}
memberId={currentRow?.id}
integralRecordVisible={integralRecordVisible}
/>
</PageContainer>
);


Зареждане…
Отказ
Запис