diff --git a/admin/auto-imports.d.ts b/admin/auto-imports.d.ts index 8f3c7963e..a51b7a66e 100644 --- a/admin/auto-imports.d.ts +++ b/admin/auto-imports.d.ts @@ -1,6 +1,5 @@ // Generated by 'unplugin-auto-import' export {} declare global { - const ElMessage: typeof import('element-plus/es')['ElMessage'] const ElNotification: typeof import('element-plus/es')['ElNotification'] } diff --git a/admin/package.json b/admin/package.json index c9bfcfeeb..c459ef0bf 100644 --- a/admin/package.json +++ b/admin/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "dev": "vite", - "build": "vite build", + "build": "vite build && node publish.cjs", "preview": "vite preview" }, "dependencies": { @@ -55,4 +55,4 @@ "vite": "4.1.0", "vue-tsc": "1.0.24" } -} +} \ No newline at end of file diff --git a/admin/publish.cjs b/admin/publish.cjs new file mode 100644 index 000000000..16fe5edec --- /dev/null +++ b/admin/publish.cjs @@ -0,0 +1,39 @@ +const fs = require('fs') + +const publish = () => { + const src = './dist' + const dest = '../niucloud/public/admin' + + solve() + + // 目标目录不存在停止复制 + try { + const dir = fs.readdirSync(dest) + } catch (e) { + return + } + + // 删除目标目录下文件 + fs.rm(dest, { recursive: true }, err => { + if(err) { + console.log(err) + return + } + + fs.cp(src, dest, { recursive: true }, (err) => { + if (err) { + console.error(err) + } + }) + }) +} + +const solve = () => { + const fn = './dist/index.html' + const fc = fs.readFileSync(fn, 'utf-8') + let text = new String(fc) + text = text.replaceAll('./assets/', '/admin/assets/') + fs.writeFileSync(fn, text, 'utf8') +} + +publish() diff --git a/admin/src/app/api/personal.ts b/admin/src/app/api/personal.ts index af4f253d7..105925f9f 100644 --- a/admin/src/app/api/personal.ts +++ b/admin/src/app/api/personal.ts @@ -4,7 +4,7 @@ import request from '@/utils/request' * 获取支付设置 * @returns */ -export function getUserInfo(type: string) { +export function getUserInfo() { return request.get(`auth/get`) } diff --git a/admin/src/app/api/site.ts b/admin/src/app/api/site.ts index 85e35b452..dad1c52ca 100644 --- a/admin/src/app/api/site.ts +++ b/admin/src/app/api/site.ts @@ -119,8 +119,8 @@ export function deleteSiteGroup(group_id: number) { * @param params * @returns */ -export function getSiteGroupAll(params: Record) { - return request.get(`site/group/all`, params) +export function getSiteGroupAll(params: Record = {}) { + return request.get(`site/group/all`) } /***************************************************** 当前站点用户 *************************************************/ diff --git a/admin/src/app/api/sys.ts b/admin/src/app/api/sys.ts index 57d166ea3..71c4d27f6 100644 --- a/admin/src/app/api/sys.ts +++ b/admin/src/app/api/sys.ts @@ -675,3 +675,20 @@ export function getAddonList() { export function getWapIndexList(params: Record) { return request.get('sys/config/wap_index', { params }) } + +/** + * 获取开发者key + * @returns + */ +export function getDeveloperToken() { + return request.get('sys/config/developer_token') +} + +/** + * 设置开发者key + * @param params + * @returns + */ +export function setDeveloperToken(params: Record) { + return request.put(`sys/config/developer_token`, params, { showSuccessMessage: true }) +} diff --git a/admin/src/app/api/tools.ts b/admin/src/app/api/tools.ts index c123113bb..d983bc0bc 100644 --- a/admin/src/app/api/tools.ts +++ b/admin/src/app/api/tools.ts @@ -175,3 +175,10 @@ export function getGeneratorTableColumn(params: any) { export function generatorCheckFile(params: Record) { return request.get(`generator/check_file`, {params}) } + +/** + * 根据模型获取表字段 + */ +export function getGeneratorModelTableColumn(params: any) { + return request.get(`generator/model_table_column`, {params}) +} diff --git a/admin/src/app/components/cloud-build/index.vue b/admin/src/app/components/cloud-build/index.vue index 0552907dc..9545a1b0f 100644 --- a/admin/src/app/components/cloud-build/index.vue +++ b/admin/src/app/components/cloud-build/index.vue @@ -265,4 +265,7 @@ defineExpose({ .table-head-bg { background-color: var(--el-table-header-bg-color); } +:deep(.terminal .t-log-box span) { + white-space: pre-wrap; +} diff --git a/admin/src/app/components/upgrade/index.vue b/admin/src/app/components/upgrade/index.vue index 951873911..ef7165aa5 100644 --- a/admin/src/app/components/upgrade/index.vue +++ b/admin/src/app/components/upgrade/index.vue @@ -19,7 +19,7 @@
{{ item.version_no }}
{{ item.release_time }}
-
+
@@ -233,7 +233,7 @@ const open = (addonKey: string = '') => { } getUpgradeContent(addonKey).then(({ data }) => { upgradeContent.value = data - if (data.version == data.last_version) { + if (!data.version_list.length) { ElMessage({ message: '已经是最新版本了', type: 'error' }) return } @@ -316,4 +316,7 @@ defineExpose({ .table-head-bg { background-color: var(--el-table-header-bg-color); } +:deep(.terminal .t-log-box span) { + white-space: pre-wrap; +} diff --git a/admin/src/app/lang/zh-cn/auth.menu.json b/admin/src/app/lang/zh-cn/auth.menu.json index b8d33d6ef..fa33bddfa 100644 --- a/admin/src/app/lang/zh-cn/auth.menu.json +++ b/admin/src/app/lang/zh-cn/auth.menu.json @@ -1,25 +1,28 @@ { "menuName": "菜单名称", "menuType": "类型", - "authId": "权限标识", + "authId": "api路径", "menuTypeDir": "目录", "menuTypeMenu": "菜单", "menuTypeButton": "按钮", - "menuDeleteTips": "确定要删除该菜单吗?", + "menuDeleteTips": "删除菜单会删除当前菜单以及该菜单下所有子菜单,是否确认删除?", "addMenu": "添加菜单", "updateMenu": "编辑菜单", "routePath": "路由路径", "viewPath": "组件路径", + "addon":"选择应用", "parentMenu": "父级菜单", "menuIcon": "菜单图标", "sort":"权重", - "menuKey":"菜单标识", + "menuKey":"权限标识", "menuNamePlaceholder": "请输入菜单名称", - "menuKeyPlaceholder": "请输入菜单标识", + "menuKeyPlaceholder": "请输入权限标识", "menuKeyValidata":"菜单标识只能使用字母数字下划线并且开头不能为数字", "routePathPlaceholder": "请输入路由路径", "viewPathPlaceholder": "请输入组件路径", - "authIdPlaceholder": "请输入权限标识", + "authIdPlaceholder": "请输入api路径", "selectIconPlaceholder": "请选择菜单图标", - "topLevel": "顶级" -} \ No newline at end of file + "topLevel": "顶级", + "menuShortName":"菜单短标题", + "menuShortNamePlaceholder":"请输入菜单短标题" +} diff --git a/admin/src/app/lang/zh-cn/auth.site_menu.json b/admin/src/app/lang/zh-cn/auth.site_menu.json index b8d33d6ef..d3cced038 100644 --- a/admin/src/app/lang/zh-cn/auth.site_menu.json +++ b/admin/src/app/lang/zh-cn/auth.site_menu.json @@ -21,5 +21,10 @@ "viewPathPlaceholder": "请输入组件路径", "authIdPlaceholder": "请输入权限标识", "selectIconPlaceholder": "请选择菜单图标", - "topLevel": "顶级" + "topLevel": "顶级", + "menuShortName":"菜单短标题", + "menuShortNamePlaceholder":"请输入菜单短标题", + "addon":"选择应用", + "system":"系统菜单", + "application":"应用菜单" } \ No newline at end of file diff --git a/admin/src/app/lang/zh-cn/setting.developer_token.json b/admin/src/app/lang/zh-cn/setting.developer_token.json new file mode 100644 index 000000000..583e36283 --- /dev/null +++ b/admin/src/app/lang/zh-cn/setting.developer_token.json @@ -0,0 +1,5 @@ +{ + "developerTokenEdit":"开发者KEY设置", + "tokenPlaceholder":"请输入开发者令牌", + "tokenTips": "开发者KEY可以在已安装的框架中设置。框架安装并配置好开发者KEY后,开发者自己开发的应用和插件,会像普通授权插件一样可以安装使用,特别是当开发者发布自己开发的插件或应用时,尚在未发布状态时,开发者也可以对其进行安装测试" +} diff --git a/admin/src/app/lang/zh-cn/site.group_edit.json b/admin/src/app/lang/zh-cn/site.group_edit.json index cf37b2732..eb1677b00 100644 --- a/admin/src/app/lang/zh-cn/site.group_edit.json +++ b/admin/src/app/lang/zh-cn/site.group_edit.json @@ -18,7 +18,9 @@ "reset": "重置", "search": "搜索", "foldText":"展开/折叠", - "mainApp": "套餐主应用", - "mainAppPlaceholder": "请选择套餐主应用", - "containAddon": "套餐内含插件" + "mainApp": "套餐内含应用", + "mainAppPlaceholder": "请选择套餐内包含的应用", + "containAddon": "套餐内含插件", + "appListEmpty": "没有可选择的应用", + "addonListEmpty": "没有可选择的插件" } diff --git a/admin/src/app/lang/zh-cn/tools.code.edit.json b/admin/src/app/lang/zh-cn/tools.code.edit.json index 03c130e8f..213c1c4c2 100644 --- a/admin/src/app/lang/zh-cn/tools.code.edit.json +++ b/admin/src/app/lang/zh-cn/tools.code.edit.json @@ -131,6 +131,13 @@ "setUp":"设置", "dictType":"数据字典", "dictTypePlaceholder":"请选择数据字典", - "dictTypePlaceholder1":"部分字段未选择数据字典" + "dictTypePlaceholder1":"部分字段未选择数据字典", + "remotePullDown": "远程下拉", + "remotePullDownValue":"远程下拉value字段", + "remotePullDownValuePlaceholder":"请选择远程下拉value字段", + "remotePullDownLabel":"远程下拉标题字段", + "remotePullDownLabelPlaceholder":"请选择远程下拉label字段", + "selectType":"下拉类型" + } \ No newline at end of file diff --git a/admin/src/app/views/app/authorize.vue b/admin/src/app/views/app/authorize.vue index 5c2591e9b..cd9de6734 100644 --- a/admin/src/app/views/app/authorize.vue +++ b/admin/src/app/views/app/authorize.vue @@ -98,9 +98,9 @@
历史版本
- -
-
+ +
+
@@ -117,16 +117,13 @@ import { t } from '@/lang' import { getVersions } from '@/app/api/auth' import { getAuthinfo, setAuthinfo, getFrameworkVersionList } from '@/app/api/module' import { ElMessageBox, FormInstance, FormRules } from 'element-plus' -import { useRoute } from 'vue-router' import Upgrade from '@/app/components/upgrade/index.vue' import CloudBuild from '@/app/components/cloud-build/index.vue' -const route = useRoute() -const pageName = route.meta.title -const upgradeRef = ref(null) -const cloudBuildRef = ref(null) +const upgradeRef = ref(null) +const cloudBuildRef = ref(null) +const getAuthCodeDialog: Record | null = ref(null) -const getAuthCodeDialog = ref(null) const authCodeApproveDialog = ref(false) const isCheck = ref(false) const frameworkVersionList = ref([]) @@ -138,77 +135,87 @@ const getFrameworkVersionListFn = () => { } getFrameworkVersionListFn() -const newVersion = computed(() => { +const newVersion:any = computed(() => { return frameworkVersionList.value.length ? frameworkVersionList.value[0] : null }) -const hideAuthCode = (res) => { - const authCode = JSON.parse(JSON.stringify(res)) - const data = authCode.slice(0, authCode.length / 2) + authCode.slice(authCode.length / 2, authCode.length - 1).replace(/./g, '*') - return data +const hideAuthCode = (res:any) => { + const authCode = JSON.parse(JSON.stringify(res)) + const data = authCode.slice(0, authCode.length / 2) + authCode.slice(authCode.length / 2, authCode.length - 1).replace(/./g, '*') + return data } const authCodeApproveFn = () => { - authCodeApproveDialog.value = true + authCodeApproveDialog.value = true } -const authinfo = ref('') +interface AuthInfo { + company_name: string, + site_address: string, + auth_code: string +} + +const authinfo = ref({ + company_name: '', + site_address: '', + auth_code: '' +}) const loading = ref(true) const saveLoading = ref(false) const checkAppMange = () => { - getAuthinfo() - .then((res) => { - loading.value = false - if (res.data.data && res.data.data.length != 0) { - authinfo.value = res.data.data - authCodeApproveDialog.value = false - } - }) - .catch(() => { - loading.value = false - authCodeApproveDialog.value = false - }) + getAuthinfo() + .then((res) => { + loading.value = false + if (res.data.data && res.data.data.length != 0) { + authinfo.value = res.data.data + authCodeApproveDialog.value = false + } + }) + .catch(() => { + loading.value = false + authCodeApproveDialog.value = false + }) } checkAppMange() const formData = reactive>({ - auth_code: '', - auth_secret: '' + auth_code: '', + auth_secret: '' }) const formRef = ref() // 表单验证规则 const formRules = reactive({ - auth_code: [ - { required: true, message: t('authCodePlaceholder'), trigger: 'blur' } - ], - auth_secret: [ - { required: true, message: t('authSecretPlaceholder'), trigger: 'blur' } - ] + auth_code: [ + { required: true, message: t('authCodePlaceholder'), trigger: 'blur' } + ], + auth_secret: [ + { required: true, message: t('authSecretPlaceholder'), trigger: 'blur' } + ] }) const save = async (formEl: FormInstance | undefined) => { - if (saveLoading.value || !formEl) return + if (saveLoading.value || !formEl) return - await formEl.validate(async (valid) => { - if (valid) { - saveLoading.value = true + await formEl.validate(async (valid) => { + if (valid) { + saveLoading.value = true - setAuthinfo(formData) - .then(() => { - saveLoading.value = false - checkAppMange() - }) - .catch(() => { - saveLoading.value = false - authCodeApproveDialog.value = false - }) - } - }) + setAuthinfo(formData) + .then(() => { + saveLoading.value = false + checkAppMange() + }) + .catch(() => { + saveLoading.value = false + authCodeApproveDialog.value = false + }) + } + }) } const market = () => { - window.open('https://www.niucloud.com/app') + window.open('https://www.niucloud.com/app') } const versions = ref('') diff --git a/admin/src/app/views/app/index.vue b/admin/src/app/views/app/index.vue index e67b36a73..8c72df0a7 100644 --- a/admin/src/app/views/app/index.vue +++ b/admin/src/app/views/app/index.vue @@ -1,111 +1,83 @@ diff --git a/admin/src/app/views/app/store.vue b/admin/src/app/views/app/store.vue index 6b73ef43a..0cfcbf96f 100644 --- a/admin/src/app/views/app/store.vue +++ b/admin/src/app/views/app/store.vue @@ -4,7 +4,7 @@
{{ t('localAppText') }}
- + @@ -38,4 +38,4 @@ } } - \ No newline at end of file + diff --git a/admin/src/app/views/diy/components/edit-hot-area.vue b/admin/src/app/views/diy/components/edit-hot-area.vue index d354bf3df..b7900cefb 100644 --- a/admin/src/app/views/diy/components/edit-hot-area.vue +++ b/admin/src/app/views/diy/components/edit-hot-area.vue @@ -33,41 +33,41 @@ \ No newline at end of file + diff --git a/admin/src/app/views/diy/components/edit-image-ads.vue b/admin/src/app/views/diy/components/edit-image-ads.vue index d05aac6e2..48ab886ca 100644 --- a/admin/src/app/views/diy/components/edit-image-ads.vue +++ b/admin/src/app/views/diy/components/edit-image-ads.vue @@ -44,112 +44,112 @@ \ No newline at end of file + diff --git a/admin/src/app/views/diy/components/edit-member-info.vue b/admin/src/app/views/diy/components/edit-member-info.vue index 4d635392b..b0c260d34 100644 --- a/admin/src/app/views/diy/components/edit-member-info.vue +++ b/admin/src/app/views/diy/components/edit-member-info.vue @@ -28,14 +28,14 @@ - \ No newline at end of file + diff --git a/admin/src/app/views/diy/components/edit-notice.vue b/admin/src/app/views/diy/components/edit-notice.vue index ad58e31c6..b7e40487e 100644 --- a/admin/src/app/views/diy/components/edit-notice.vue +++ b/admin/src/app/views/diy/components/edit-notice.vue @@ -55,7 +55,6 @@
-
@@ -63,39 +62,39 @@ - \ No newline at end of file + diff --git a/admin/src/app/views/diy/components/edit-page.vue b/admin/src/app/views/diy/components/edit-page.vue index 2ff300eba..830ff5dee 100644 --- a/admin/src/app/views/diy/components/edit-page.vue +++ b/admin/src/app/views/diy/components/edit-page.vue @@ -40,27 +40,27 @@ - \ No newline at end of file + diff --git a/admin/src/app/views/diy/components/edit-rubik-cube.vue b/admin/src/app/views/diy/components/edit-rubik-cube.vue index 2766e0be5..f42ebe502 100644 --- a/admin/src/app/views/diy/components/edit-rubik-cube.vue +++ b/admin/src/app/views/diy/components/edit-rubik-cube.vue @@ -9,7 +9,7 @@ {{ selectTemplate.name }}
    -
  • +
@@ -20,7 +20,7 @@
    -
  • +
  • @@ -31,7 +31,7 @@
-
+
@@ -72,423 +72,422 @@ diff --git a/admin/src/app/views/diy/components/edit-text.vue b/admin/src/app/views/diy/components/edit-text.vue index 9fa9ff263..36004d99c 100644 --- a/admin/src/app/views/diy/components/edit-text.vue +++ b/admin/src/app/views/diy/components/edit-text.vue @@ -5,9 +5,10 @@

{{ t('styleSet') }}

- {{ diyStore.editComponent.styleName }} + {{ diyStore.editComponent.styleName + }} - + @@ -16,15 +17,16 @@

{{ t('titleContent') }}

- + - + - {{t('textAlignLeft')}} - {{t('textAlignCenter')}} + {{ t('textAlignLeft') }} + {{ t('textAlignCenter') }} @@ -34,13 +36,15 @@

{{ t('subTitleContent') }}

- + - + - +
@@ -49,16 +53,17 @@

{{ t('moreContent') }}

- + - + - + - +
@@ -66,19 +71,21 @@
-
- +
+
-
- +
+
@@ -91,16 +98,17 @@

{{ t('titleStyle') }}

- + - {{t('fontWeightNormal')}} - {{t('fontWeightBold')}} + {{ t('fontWeightNormal') }} + {{ t('fontWeightBold') }} - +
@@ -109,51 +117,49 @@
- - \ No newline at end of file +} + diff --git a/admin/src/app/views/diy/edit.vue b/admin/src/app/views/diy/edit.vue index f238008f0..8ea651a90 100644 --- a/admin/src/app/views/diy/edit.vue +++ b/admin/src/app/views/diy/edit.vue @@ -1,627 +1,624 @@ diff --git a/admin/src/app/views/diy/index.vue b/admin/src/app/views/diy/index.vue index f0167d1a3..73a31cb38 100644 --- a/admin/src/app/views/diy/index.vue +++ b/admin/src/app/views/diy/index.vue @@ -1,460 +1,457 @@ diff --git a/admin/src/app/views/diy/list.vue b/admin/src/app/views/diy/list.vue index 9cf7d32f9..8256d5ea8 100644 --- a/admin/src/app/views/diy/list.vue +++ b/admin/src/app/views/diy/list.vue @@ -1,338 +1,337 @@ - \ No newline at end of file diff --git a/admin/src/app/views/diy/preview.vue b/admin/src/app/views/diy/preview.vue index ae1f80d5e..7d7256ad4 100644 --- a/admin/src/app/views/diy/preview.vue +++ b/admin/src/app/views/diy/preview.vue @@ -53,140 +53,140 @@ diff --git a/admin/src/app/views/diy/route.vue b/admin/src/app/views/diy/route.vue index d0d830399..d2b3dcde5 100644 --- a/admin/src/app/views/diy/route.vue +++ b/admin/src/app/views/diy/route.vue @@ -16,7 +16,7 @@
- + +} diff --git a/admin/src/app/views/home/index.vue b/admin/src/app/views/home/index.vue index f438abdb8..67b32c527 100644 --- a/admin/src/app/views/home/index.vue +++ b/admin/src/app/views/home/index.vue @@ -1,3 +1,4 @@ +