Skip to content

Commit b54ab23

Browse files
committed
feat: 忽略操作系统差异性
1 parent 0ecbf9a commit b54ab23

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

.gitattributes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Explicitly declare text files you want to always be normalized and converted
5+
# to native line endings on checkout.
6+
*.c text
7+
*.h text
8+
9+
# Declare files that will always have CRLF line endings on checkout.
10+
*.sln text eol=crlf
11+
12+
# Denote all files that are truly binary and should not be modified.
13+
*.png binary
14+
*.jpg binary

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ lerna-debug.log*
99

1010
node_modules
1111
dist
12+
dist.tar.gz
1213
dist-ssr
1314
*.local
1415
stats.html

launch.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ TMP_WEB_PKG="tmp.tar.gz"
77

88
DEPLOY_SCRIPT="launch.sh"
99
START_FUNC_NAME="start"
10+
BUILD_FUNC_NAME="build"
1011
INSTALL_FUNC_NAME="install"
1112
SERVER_FUNC_NAME="server"
1213

@@ -54,11 +55,13 @@ function server() {
5455
}
5556

5657
function start() {
58+
echo "---- 开始部署 ----"
5759
cd ${WORK_DIR_PRO}
5860
mv ${WEB_PKG} ${WEB_PKG_BK}
5961
mv ${ADMIN_WORKSPACE} "${ADMIN_WORKSPACE}_bk"
6062
mv ${TMP_WEB_PKG} ${WEB_PKG}
6163
tar -zxvf ${WEB_PKG}
64+
echo "---- 部署完成 ----"
6265
}
6366

6467
function deploy() {
@@ -102,6 +105,8 @@ function deploy() {
102105

103106
if [ "$1" = "${START_FUNC_NAME}" ]; then
104107
start "$@"
108+
elif [ "$1" = "${BUILD_FUNC_NAME}" ]; then
109+
build $1
105110
elif [ "$1" = "${INSTALL_FUNC_NAME}" ]; then
106111
install $1
107112
elif [ "$1" = "${SERVER_FUNC_NAME}" ]; then
@@ -113,6 +118,7 @@ else
113118
echo "安装依赖: ./launch.sh install"
114119
echo "本地启动: ./launch.sh server"
115120
echo "=========== 上传服务器 & 服务器解压使用 =============="
121+
echo "打包 dist.tar.gz: ./launch.sh build"
116122
echo "打包静态资源并上传到服务器 & 解压执行: ./launch.sh pro"
117123
echo "服务器上资源启用: ./launch.sh start"
118124
fi

src/layouts/components/Header/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import "./index.less";
1414

1515
const LayoutHeader = (props: any) => {
1616
let { userInfo } = props || {};
17-
if (!userInfo) {
17+
if (!userInfo || JSON.stringify(userInfo) === "{}") {
1818
let fetchUsrInfo = async () => {
1919
const { status, result } = await loginUserInfo();
2020
if (status && status.code == 0 && result && result?.userId > 0) {

0 commit comments

Comments
 (0)