Commit 4d5322dc authored by Bill's avatar Bill

Merge branch 'dev' of 10.0.0.22:lingxi/lingxi-business-paltform into dev

parents 403db5c7 6c7241c1
......@@ -38,6 +38,7 @@
"@antv/data-set": "^0.11.5",
"@formily/antd": "^1.3.3",
"@formily/antd-components": "^1.3.3",
"@types/crypto-js": "^4.0.1",
"@umijs/hooks": "^1.9.3",
"@umijs/plugin-esbuild": "^1.0.1",
"@umijs/preset-react": "1.x",
......@@ -45,6 +46,7 @@
"antd-img-crop": "^3.12.0",
"bizcharts": "^4.0.14",
"copy-to-clipboard": "^3.3.1",
"crypto-js": "^4.0.0",
"god": "^0.2.1",
"immutability-helper": "^3.1.1",
"lingxi-design": "^1.0.8",
......
......@@ -2,7 +2,6 @@ import { IRoutes } from '.';
import { history, RequestConfig, Redirect } from 'umi';
import React from 'react'
import MobxProvider from './store'
import queryString from 'query-string'
import '@/global/styles/reset.less'; // 重置antd样式
import '@/global/styles/global.less'; // 导入全局样式
......@@ -179,11 +178,17 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
if (whiteLists.includes(location.pathname)) {
return
}
const authInfo = getAuth()
// 是否登录
if (getAuth()) {
if (authInfo) {
const routeAuthUrls = getRouters()
let routeAuthUrls = getRouters()
if (!routeAuthUrls || routeAuthUrls.length === 0) {
const { urls } = authInfo
routeAuthUrls = urls
setRouters(urls)
}
const { pathname } = location
if (userLoginLists.includes(pathname)) {
// 当登录过, 并且尝试访问登录相关页面, 需重定向到首页
......@@ -208,7 +213,7 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
return;
}
// 无权限访问时
console.log(pathname)
// console.log(pathname)
history.replace('/memberCenter/noAuth')
} else {
if (whiteLists.includes(location.pathname)) {
......
import React, { useState, useEffect, useCallback, useRef } from 'react'
import { CaretUpOutlined, CaretDownOutlined, UnorderedListOutlined, AppstoreOutlined, CloseOutlined, QuestionCircleOutlined } from '@ant-design/icons'
import React, { useState, useEffect } from 'react'
import { CaretUpOutlined, CaretDownOutlined, UnorderedListOutlined, AppstoreOutlined, CloseOutlined } from '@ant-design/icons'
import Filter from '../components/Filter'
import { FILTER_TYPE } from '@/constants'
import cx from 'classnames'
......@@ -13,7 +13,7 @@ import { store } from '@/store'
import { PublicApi } from '@/services/api'
import { LAYOUT_TYPE } from '@/constants'
import { PostSearchShopEnterpriseGetCommodityListResponseDetail } from '@/services/SearchApi'
import bannerImg from '@/assets/imgs/banner_2.png'
// import bannerImg from '@/assets/imgs/banner_2.png'
import arrowDownIcon from '@/assets/imgs/arrow_down.png'
import arrowDownActiveIcon from '@/assets/imgs/arrow_down_active.png'
import styles from './index.less'
......
......@@ -147,12 +147,13 @@
color: #303133;
text-align: left;
margin-top: 12px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
// display: -webkit-box;
// -webkit-box-orient: vertical;
// -webkit-line-clamp: 2;
text-overflow: ellipsis;
overflow: hidden;
-webkit-box-orient: vertical;
white-space: nowrap;
// -webkit-box-orient: vertical;
word-wrap: break-word;
word-break: break-all;
}
......
import React from 'react'
import noResultIcon from '@/assets/imgs/no_result_icon.png'
import styles from './index.less'
interface ErrorResultPropsType {
errorMessage: string
}
const ErrorResult: React.FC<ErrorResultPropsType> = (props) => {
const { errorMessage } = props
return (
<div className={styles.no_result_container}>
<div className={styles.no_result}>
<div className={styles.no_result_tip}>
<div className={styles.no_result_tip_img}>
<img src={noResultIcon} />
</div>
<div className={styles.no_result_tip_text}>
{ errorMessage }
</div>
</div>
<div className={styles.no_result_suggest}>
<ul className={styles.no_result_suggest_list}>
<li>出现的可能原因:</li>
<li>1、管理员冻结了该商品</li>
<li>2、商品链接出现错误</li>
</ul>
</div>
</div>
</div>
)
}
export default ErrorResult
\ No newline at end of file
......@@ -362,4 +362,58 @@
color: #FFF;
}
}
}
.no_result_container {
width: 1200px;
margin: 0 auto;
}
.no_result {
width: 300px;
margin: 0 auto;
padding: 200px 0;
&_tip {
font-size: 14px;
color: #D32F2F;
font-weight: 500;
display: flex;
&_text {
line-height: 30px;
}
&_search {
color: #303133;
}
&_img {
width: 30px;
height: 30px;
overflow: hidden;
margin-right: 16px;
&>img {
width: 30px;
height: 30px;
}
}
}
&_suggest {
margin-top: 12px;
font-size: 12px;
color: #909399;
padding-left: 46px;
&_list {
padding: 0;
margin: 0;
&>li {
list-style: none;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -30,7 +30,7 @@ const PopularShops: React.FC<PopularShopsPropsType> = (props) => {
<div className={styles.popular_shops_list}>
{
shopList && shopList.map((item, index) => index <=5 && (
<div className={styles.popular_shops_list_item}>
<div className={styles.popular_shops_list_item} key={item.memberShopId}>
<div className={styles.popular_shops_rank}>0{index+1}</div>
<div className={styles.popular_shops_logo}>
<ImageBox width={36} height={36} imgUrl={item.memberLogo} />
......
......@@ -48,7 +48,7 @@ const ShoppingNews: React.FC = () => {
</div>
<div className={styles.popular_buy_dynamic_list_item_content}>
<span className={styles.content_text}>{item.count || 0}条回应</span>
<span className={styles.content_time}>{moment(item.deliveryTime).format("MM/DD HH:mm")}</span>
<span className={styles.content_time}>{moment(item.deliveryTime || "").format("MM/DD HH:mm")}</span>
</div>
</div>
))
......
......@@ -195,6 +195,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
if (orderItem.logistics?.deliveryType === 1 && orderItem.logistics?.carriageType === 2 && orderItem.logistics?.useTemplate && templateId) {
orderProductList.push({
templateId,
count: orderItem.count,
weight: orderItem.logistics?.weight,
})
}
......
......@@ -8,6 +8,7 @@ import {
} from '@ant-design/icons';
import { PublicApi } from '@/services/api';
import { setAuth, setRouters } from '@/utils/auth';
import { encryptedByAES } from '@/utils/cryptoAes';
const LoginWrap: React.FC = () => {
const { redirect } = history.location.query
......@@ -16,6 +17,7 @@ const LoginWrap: React.FC = () => {
const [loginLoading, setLoginLoading] = useState<boolean>(false)
const finish = (value: any) => {
value.password = encryptedByAES(value.password)
setLoginLoading(true)
PublicApi.postMemberLogin(value).then(res => {
const { data, code } = res
......
......@@ -11,6 +11,7 @@ import { PATTERN_MAPS } from '@/constants/regExp';
import { omit } from '@/utils';
import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { encryptedByAES } from '@/utils/cryptoAes';
const actions = createFormActions()
......@@ -21,6 +22,7 @@ const GetBack: React.FC = () => {
const { account } = value
const isEmail = PATTERN_MAPS.email.test(account)
const accountParams = isEmail ? {email: account, ...omit(value, ['account', 'confirmPassword'])} : { phone: account, ...omit(value, ['account', 'confirmPassword']) }
accountParams.password = encryptedByAES(accountParams.password)
const submitFn = isEmail ? PublicApi.postMemberRegisterResetEmail : PublicApi.postMemberRegisterResetSms
const { code } = await submitFn(accountParams)
......
......@@ -15,6 +15,7 @@ import { omit, transFormSchema, filterUndef } from '@/utils';
import { PublicApi } from '@/services/api';
import NiceForm from '@/components/NiceForm';
import schemas from './schema';
import { encryptedByAES } from '@/utils/cryptoAes';
const { onFieldValueChange$, onFieldInputChange$, onFieldValidateEnd$ } = FormEffectHooks
......@@ -235,6 +236,7 @@ const UserRegistry = () => {
// 写死传入的区号
formCache.countryCode = prefixCode
const params = omit(formCache, ['isRead', 'confirmPassword'])
params.password = encryptedByAES(params.password)
setSubmitLoading(true)
PublicApi.postMemberRegister(params).then(({ code }) => {
if (code === 1000) {
......
import CryptoJS from 'crypto-js'
var key = CryptoJS.enc.Utf8.parse('GzSsyLingxi2.0.0');
// var iv = CryptoJS.enc.Utf8.parse('JlM6cyqmrC2zKNsx');
/**
* @auth xjm
* 加密方法
*/
export const encryptedByAES = (source: string) => {
var password=CryptoJS.enc.Utf8.parse(source);
var encrypted = CryptoJS.AES.encrypt(password, key, {mode:CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7}); //CryptoJS.pad.Pkcs7
return encrypted.toString() // 加密后的base64
}
/**
* @auth xjm
* 解密方法
*/
export const decryptedByAES = (source: string) => {
var decrypted = CryptoJS.AES.decrypt(source, key, {mode:CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7}); //CryptoJS.pad.Pkcs7
return decrypted.toString(CryptoJS.enc.Utf8) // 解密后的原始字符串
}
\ No newline at end of file
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