This commit is contained in:
全栈小学生 2023-10-24 14:28:30 +08:00
parent d38c0f062d
commit 7382267d13
13 changed files with 66 additions and 65 deletions

View File

@ -1,8 +1,8 @@
{ {
"app": "应用管理", "app": "应用管理",
"descriptionLeft": "暂无安装任何应用,马上去", "descriptionLeft": "暂未安装任何应用,请到",
"link": "插件管理", "link": "插件管理",
"descriptionRight": "逛逛", "descriptionRight": "进行安装使用",
"niucloud": "Niucloud官网", "niucloud": "Niucloud官网",
"appStore": "插件管理" "appStore": "插件管理"
} }

View File

@ -48,7 +48,7 @@
"descriptionLeft": "暂无任何应用,马上去", "descriptionLeft": "暂无任何应用,马上去",
"link": "官方应用市场", "link": "官方应用市场",
"descriptionRight": "逛逛", "descriptionRight": "逛逛",
"installed-empty": "暂安装任何应用,请先安装", "installed-empty": "暂安装任何应用,请先安装",
"siteAddressTips": "授权域名不匹配", "siteAddressTips": "授权域名不匹配",
"authCodePlaceholder": "请输入授权码", "authCodePlaceholder": "请输入授权码",

View File

@ -574,6 +574,7 @@ const installAddonFn = (key: string) => {
preInstallCheck(key).then(res => { preInstallCheck(key).then(res => {
installCheckResult.value = res.data installCheckResult.value = res.data
userStore.clearRouters()
}).catch(() => { }) }).catch(() => { })
} }
@ -612,6 +613,7 @@ const getInstallTask = (first: boolean = true) => {
} else { } else {
if (!first) { if (!first) {
installStep.value = 3 installStep.value = 3
userStore.clearRouters()
localListFn() localListFn()
userStore.getAppList() userStore.getAppList()
notificationEl.close() notificationEl.close()
@ -822,11 +824,12 @@ const save = async (formEl: FormInstance | undefined) => {
setAuthinfo(formData) setAuthinfo(formData)
.then(() => { .then(() => {
saveLoading.value = false saveLoading.value = false
checkAppMange() setTimeout(() => {
location.reload();
}, 1000);
}) })
.catch(() => { .catch(() => {
saveLoading.value = false saveLoading.value = false
authCodeApproveDialog.value = false
}) })
} }
}) })

View File

@ -8,7 +8,7 @@
<span class="cursor-pointer" @click="goDeveloperCenter">{{ t('developerCenter') }}</span> <span class="cursor-pointer" @click="goDeveloperCenter">{{ t('developerCenter') }}</span>
</template> </template>
</div> </div>
<div class="flex items-center mr-[20px] min-w-[200px] text-[14px]"> <div class="flex items-center min-w-[180px] text-[14px]">
<span class="cursor-pointer mr-[15px]" @click="goNiucloud">{{ t('niucloud') }}</span> <span class="cursor-pointer mr-[15px]" @click="goNiucloud">{{ t('niucloud') }}</span>
<el-dropdown> <el-dropdown>
<div class="userinfo flex h-full items-center"> <div class="userinfo flex h-full items-center">
@ -18,14 +18,13 @@
</div> </div>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item command="usercenter"><router-link to="/user/center">账号设置</router-link></el-dropdown-item> <el-dropdown-item><router-link to="/user/center">账号设置</router-link></el-dropdown-item>
<el-dropdown-item command="usercenter"><router-link to="/tools/authorize">授权信息</router-link></el-dropdown-item> <el-dropdown-item><router-link to="/tools/authorize">授权信息</router-link></el-dropdown-item>
<el-dropdown-item command="usercenter" @click="changePasswordDialog=true">修改密码</el-dropdown-item> <el-dropdown-item @click="changePasswordDialog=true">修改密码</el-dropdown-item>
<el-dropdown-item @click="logout">退出登录</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
<span class="mx-2 text-[#4F5563]">|</span>
<span class="cursor-pointer" @click="logout">{{t('exit')}}</span>
</div> </div>
<el-dialog v-model="changePasswordDialog" width="450px" title="修改密码" :before-close="handleClose"> <el-dialog v-model="changePasswordDialog" width="450px" title="修改密码" :before-close="handleClose">

View File

@ -8,7 +8,7 @@
<span class="cursor-pointer" @click="goDeveloperCenter">{{ t('developerCenter') }}</span> <span class="cursor-pointer" @click="goDeveloperCenter">{{ t('developerCenter') }}</span>
</template> </template>
</div> </div>
<div class="flex items-center mr-[20px] min-w-[200px] text-[14px]"> <div class="flex items-center min-w-[180px] text-[14px]">
<span class="cursor-pointer mr-[15px]" @click="goNiucloud">{{ t('niucloud') }}</span> <span class="cursor-pointer mr-[15px]" @click="goNiucloud">{{ t('niucloud') }}</span>
<el-dropdown> <el-dropdown>
<div class="userinfo flex h-full items-center"> <div class="userinfo flex h-full items-center">
@ -18,14 +18,13 @@
</div> </div>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item command="usercenter"><router-link to="/user/center">账号设置</router-link></el-dropdown-item> <el-dropdown-item><router-link to="/user/center">账号设置</router-link></el-dropdown-item>
<el-dropdown-item command="usercenter"><router-link to="/tools/authorize">授权信息</router-link></el-dropdown-item> <el-dropdown-item><router-link to="/tools/authorize">授权信息</router-link></el-dropdown-item>
<el-dropdown-item command="usercenter" @click="changePasswordDialog=true">修改密码</el-dropdown-item> <el-dropdown-item @click="changePasswordDialog=true">修改密码</el-dropdown-item>
<el-dropdown-item @click="logout">退出登录</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
<span class="mx-2 text-[#4F5563]">|</span>
<span class="cursor-pointer" @click="logout">{{t('exit')}}</span>
</div> </div>
<el-dialog v-model="changePasswordDialog" title="修改密码" :before-close="handleClose"> <el-dialog v-model="changePasswordDialog" title="修改密码" :before-close="handleClose">
<div> <div>

View File

@ -22,7 +22,7 @@ const useSystemStore = defineStore('system', {
dark: theme.dark ?? false, dark: theme.dark ?? false,
theme: theme.theme ?? '#273de3', theme: theme.theme ?? '#273de3',
sidebar: theme.sidebar ?? 'oneType', sidebar: theme.sidebar ?? 'oneType',
sidebarStyle: theme.sidebarStyle ?? 'oneType', sidebarStyle: theme.sidebarStyle ?? 'threeType',
lang: storage.get('lang') ?? 'zh-cn' lang: storage.get('lang') ?? 'zh-cn'
} }
}, },

View File

@ -44,6 +44,9 @@ const useUserStore = defineStore('user', {
}) })
}) })
}, },
clearRouters() {
this.routers = []
},
logout() { logout() {
this.token = '' this.token = ''
this.userInfo = {} this.userInfo = {}

View File

@ -1518,19 +1518,6 @@ return [
], ],
], ],
], ],
[
'menu_name' => '插件管理',
'menu_key' => 'app_store',
'menu_type' => 1,
'icon' => 'iconfont-iconchajian1',
'api_url' => 'addon/local',
'router_path' => 'app_store',
'view_path' => 'app/store',
'methods' => 'get',
'sort' => 20,
'status' => 1,
'is_show' => 0,
],
[ [
'menu_name' => '授权信息', 'menu_name' => '授权信息',
'menu_key' => 'app_auth', 'menu_key' => 'app_auth',

View File

@ -402,10 +402,13 @@ class Index extends BaseInstall
if ($match_item > 0) { if ($match_item > 0) {
try { try {
$table_name = $match_data[ 1 ]; $table_name = $match_data[ 1 ];
if (substr($dbprefix, -1) !== "_") {
$dbprefix .= '_';
}
$new_table_name = $dbprefix . $table_name; $new_table_name = $dbprefix . $table_name;
$sql_item = $this->str_replace_first($table_name, $new_table_name, $sql); $sql_item = $this->str_replace_first($table_name, $new_table_name, $sql);
@mysqli_query($conn, $sql_item); @mysqli_query($conn, $sql_item);
if ($is_write) $this->setSuccessLog([ '创建表' . $table_name, 'success' ]); if ($is_write) $this->setSuccessLog([ '创建表' . $new_table_name, 'success' ]);
} catch (Exception $e) { } catch (Exception $e) {
$this->setSuccessLog([ $e->getMessage(), 'error' ]); $this->setSuccessLog([ $e->getMessage(), 'error' ]);
return fail('数据库解析失败' . $e->getMessage()); return fail('数据库解析失败' . $e->getMessage());
@ -435,6 +438,9 @@ class Index extends BaseInstall
$dbpwd = $data[ 'dbpwd' ] ?? ''; $dbpwd = $data[ 'dbpwd' ] ?? '';
$dbname = $data[ 'dbname' ] ?? ''; $dbname = $data[ 'dbname' ] ?? '';
$dbprefix = $data[ 'dbprefix' ] ?? ''; $dbprefix = $data[ 'dbprefix' ] ?? '';
if (substr($dbprefix, -1) !== "_") {
$dbprefix .= '_';
}
$replace_key = [ $replace_key = [
'{dbhost}', '{dbhost}',
@ -467,7 +473,8 @@ class Index extends BaseInstall
* 安装插件 * 安装插件
* @return void * @return void
*/ */
public function installAddon() { public function installAddon()
{
$addon_path = root_path() . 'addon' . DIRECTORY_SEPARATOR; $addon_path = root_path() . 'addon' . DIRECTORY_SEPARATOR;
$addon_files = []; $addon_files = [];

View File

@ -354,6 +354,10 @@ class CoreAddonDevelopService extends CoreAddonBaseService
return true; return true;
} }
$file = $dir . $name; $file = $dir . $name;
if (!is_dir($dir) && !mkdir($dir, 0777, true) && !is_dir($dir)) {
throw new AddonException(sprintf('Directory "%s" was not created', $dir));
}
if (strpos($name, 'png') || strpos($name, 'jpg')) { if (strpos($name, 'png') || strpos($name, 'jpg')) {
$file_name = explode('.', $name)[0] ?? ''; $file_name = explode('.', $name)[0] ?? '';
if (empty($file_name)) return true; if (empty($file_name)) return true;
@ -361,14 +365,12 @@ class CoreAddonDevelopService extends CoreAddonBaseService
if (empty($image)) return true; if (empty($image)) return true;
if (check_file_is_remote($image)) { if (check_file_is_remote($image)) {
try { try {
(new CoreFetchService())->setRootPath($dir)->setRename($name)->image($image, '', FileDict::LOCAL); (new CoreFetchService())->setRootPath($dir)->setRename($name)->image($image, '', FileDict::LOCAL);
} catch ( UploadFileException $e ) { } catch ( UploadFileException $e ) {
return true; return true;
} }
} else { } else {
copy($image, $file); @copy($image, $file);
} }
} else { } else {
//创建路由文件 //创建路由文件

View File

@ -64,6 +64,7 @@ class CoreAddonService extends CoreAddonBaseService
} catch ( Throwable $e ) { } catch ( Throwable $e ) {
$error = $e->getMessage(); $error = $e->getMessage();
} }
if(is_dir($this->addon_path)){
$files = get_files_by_dir($this->addon_path); $files = get_files_by_dir($this->addon_path);
if (!empty($files)) { if (!empty($files)) {
foreach ($files as $path) { foreach ($files as $path) {
@ -80,6 +81,7 @@ class CoreAddonService extends CoreAddonBaseService
} }
} }
}
return ['list' => $list, 'error' => $error ?? '']; return ['list' => $list, 'error' => $error ?? ''];
} }

View File

@ -308,7 +308,6 @@ class CorePayService extends BaseCoreService
{ {
$pay = $this->findPayInfoByOutTradeNo($out_trade_no); $pay = $this->findPayInfoByOutTradeNo($out_trade_no);
if ($pay->isEmpty()) throw new PayException('PAY_TRANSACTION_NO_NOT_EXIST'); if ($pay->isEmpty()) throw new PayException('PAY_TRANSACTION_NO_NOT_EXIST');
// if (empty($pay->type)) throw new PayException('TREAT_PAYMENT_IS_OPEN');
if($pay['status'] == PayDict::STATUS_CALCLE) return true; if($pay['status'] == PayDict::STATUS_CALCLE) return true;
if (!in_array($pay['status'], [ if (!in_array($pay['status'], [

View File

@ -138,8 +138,8 @@ abstract class BasePay extends Storage
'enable' => true, 'enable' => true,
'file' => root_path('runtime') . 'paylog' . DIRECTORY_SEPARATOR . date('Ym') . DIRECTORY_SEPARATOR . date('d') . '.log', 'file' => root_path('runtime') . 'paylog' . DIRECTORY_SEPARATOR . date('Ym') . DIRECTORY_SEPARATOR . date('d') . '.log',
'level' => env('app_debug') ? 'debug' : 'info', // 建议生产环境等级调整为 info开发环境为 debug 'level' => env('app_debug') ? 'debug' : 'info', // 建议生产环境等级调整为 info开发环境为 debug
'type' => 'single', // optional, 可选 daily. 'type' => 'single', // type, 可选 daily.
'max_file' => 30, // optional, 当 type 为 daily 时有效,默认 30 天 'max_file' => 30, // max_file, 当 type 为 daily 时有效,默认 30 天
], ],
'http' => [ // optional 'http' => [ // optional
'timeout' => 5.0, 'timeout' => 5.0,