mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-27 14:46:06 +08:00
Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
commit
c0fbe194a2
|
@ -11,7 +11,7 @@ export default async () => {
|
|||
const subscriptionService = Container.get(SubscriptionService);
|
||||
|
||||
// 生成内置token
|
||||
let tokenCommand = `ts-node-transpile-only ${config.rootPath}/back/token.ts`;
|
||||
let tokenCommand = `tsx ${config.rootPath}/back/token.ts`;
|
||||
const tokenFile = `${config.rootPath}static/build/token.js`;
|
||||
if (await fileExist(tokenFile)) {
|
||||
tokenCommand = `node ${tokenFile}`;
|
||||
|
|
|
@ -49,7 +49,7 @@ RUN set -x \
|
|||
&& git config --global user.name "qinglong" \
|
||||
&& git config --global http.postBuffer 524288000 \
|
||||
&& npm install -g pnpm \
|
||||
&& pnpm add -g pm2 ts-node typescript tslib \
|
||||
&& pnpm add -g pm2 tsx \
|
||||
&& rm -rf /root/.pnpm-store \
|
||||
&& rm -rf /root/.local/share/pnpm/store \
|
||||
&& rm -rf /root/.cache \
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"start:front": "max dev",
|
||||
"start:back": "nodemon",
|
||||
"start:public": "ts-node --transpile-only ./back/public.ts",
|
||||
"start:schedule": "ts-node --transpile-only ./back/schedule.ts",
|
||||
"build:front": "max build",
|
||||
"build:back": "tsc -p tsconfig.back.json",
|
||||
"panel": "npm run build:back && node static/build/app.js",
|
||||
|
@ -142,6 +143,7 @@
|
|||
"sockjs-client": "^1.6.0",
|
||||
"ts-node": "^10.6.0",
|
||||
"tslib": "^2.4.0",
|
||||
"tsx": "^3.12.3",
|
||||
"typescript": "4.8.4",
|
||||
"umi-request": "^1.4.0",
|
||||
"vh-check": "^2.0.5",
|
||||
|
|
|
@ -84,6 +84,7 @@ specifiers:
|
|||
toad-scheduler: ^1.6.0
|
||||
ts-node: ^10.6.0
|
||||
tslib: ^2.4.0
|
||||
tsx: ^3.12.3
|
||||
typedi: ^0.10.0
|
||||
typescript: 4.8.4
|
||||
umi-request: ^1.4.0
|
||||
|
@ -184,6 +185,7 @@ devDependencies:
|
|||
sockjs-client: 1.6.1
|
||||
ts-node: 10.9.1_ksn4eycaeggbrckn3ykh37hwf4
|
||||
tslib: 2.4.1
|
||||
tsx: 3.12.3
|
||||
typescript: 4.8.4
|
||||
umi-request: 1.4.0
|
||||
vh-check: 2.0.5
|
||||
|
|
21
shell/api.sh
21
shell/api.sh
|
@ -1,15 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
create_token() {
|
||||
local token_command="tsx ${dir_root}/back/token.ts"
|
||||
local token_file="${dir_root}static/build/token.js"
|
||||
if [[ -f $token_file ]]; then
|
||||
token_command="node ${token_file}"
|
||||
fi
|
||||
token=$(eval "$token_command")
|
||||
}
|
||||
|
||||
get_token() {
|
||||
if [[ -f $file_auth_token ]]; then
|
||||
token=$(cat $file_auth_token | jq -r .value)
|
||||
else
|
||||
local token_command="ts-node-transpile-only ${dir_root}/back/token.ts"
|
||||
local token_file="${dir_root}static/build/token.js"
|
||||
if [[ -f $token_file ]]; then
|
||||
token_command="node ${token_file}"
|
||||
local expiration=$(cat $file_auth_token | jq -r .expiration)
|
||||
local currentTimeStamp=$(date +%s)
|
||||
if [[ $currentTimeStamp -ge $expiration ]]; then
|
||||
create_token
|
||||
fi
|
||||
token=$(eval "$token_command")
|
||||
else
|
||||
create_token
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ echo -e "提交master代码"
|
|||
git push
|
||||
|
||||
echo -e "更新cdn文件"
|
||||
ts-node sample/tool.ts
|
||||
tsx sample/tool.ts
|
||||
|
||||
string=$(cat version.yaml | grep "version" | egrep "[^ ]*" -o | egrep "\d\.*")
|
||||
version="v$string"
|
||||
|
|
|
@ -431,16 +431,17 @@ format_timestamp() {
|
|||
}
|
||||
|
||||
patch_version() {
|
||||
# 兼容pnpm@7
|
||||
pnpm setup &>/dev/null
|
||||
source ~/.bashrc
|
||||
|
||||
if [[ $PipMirror ]]; then
|
||||
pip3 config set global.index-url $PipMirror
|
||||
fi
|
||||
if [[ $NpmMirror ]]; then
|
||||
npm config set registry $NpmMirror
|
||||
pnpm config set registry $NpmMirror
|
||||
fi
|
||||
|
||||
# 兼容pnpm@7
|
||||
pnpm setup &>/dev/null
|
||||
source ~/.bashrc
|
||||
pnpm install -g &>/dev/null
|
||||
|
||||
if [[ -f "$dir_root/db/cookie.db" ]]; then
|
||||
|
@ -450,7 +451,7 @@ patch_version() {
|
|||
echo
|
||||
fi
|
||||
|
||||
pnpm add -g pm2 ts-node typescript tslib
|
||||
pnpm add -g pm2 tsx
|
||||
|
||||
git config --global pull.rebase false
|
||||
|
||||
|
|
|
@ -15,7 +15,11 @@ define_program() {
|
|||
elif [[ $file_param == *.sh ]]; then
|
||||
which_program="bash"
|
||||
elif [[ $file_param == *.ts ]]; then
|
||||
which_program="ts-node-transpile-only"
|
||||
if ! type tsx &>/dev/null; then
|
||||
which_program="ts-node-transpile-only"
|
||||
else
|
||||
which_program="tsx"
|
||||
fi
|
||||
else
|
||||
which_program=""
|
||||
fi
|
||||
|
|
|
@ -47,9 +47,8 @@ const CheckUpdate = ({ socketMessage, systemInfo }: any) => {
|
|||
</div>
|
||||
</>
|
||||
),
|
||||
okText: '确认',
|
||||
cancelText: '强制更新',
|
||||
onCancel() {
|
||||
okText: '强制更新',
|
||||
onOk() {
|
||||
showUpdatingModal();
|
||||
request
|
||||
.put(`${config.apiPrefix}system/update`)
|
||||
|
@ -103,6 +102,7 @@ const CheckUpdate = ({ socketMessage, systemInfo }: any) => {
|
|||
width: 600,
|
||||
maskClosable: false,
|
||||
closable: false,
|
||||
keyboard: false,
|
||||
okButtonProps: { disabled: true },
|
||||
title: '更新中...',
|
||||
centered: true,
|
||||
|
|
Loading…
Reference in New Issue
Block a user