diff --git a/webfe/package_vue/src/components/paas-header.vue b/webfe/package_vue/src/components/paas-header.vue index 78eabccb82..42979f716d 100644 --- a/webfe/package_vue/src/components/paas-header.vue +++ b/webfe/package_vue/src/components/paas-header.vue @@ -464,7 +464,14 @@ export default { this.isShowInput = false; }); - this.getCurrentUser(); + // 入口请求成功,说明用户已认证 + bus.$on('on-user-data', (user) => { + this.userInitialized = true; + this.user = user; + if (user.avatarUrl) { + this.avatars = user.avatarUrl; + } + }); }, methods: { goRouter(sitem) { @@ -562,15 +569,6 @@ export default { this.filterKey = ''; this.$refs.dropdown.close(); }, - getCurrentUser() { - auth.requestCurrentUser().then((user) => { - this.userInitialized = true; - this.user = user; - if (user.avatarUrl) { - this.avatars = user.avatarUrl; - } - }); - }, // 监听滚动事件(滚动是头部样式切换) handleScroll() { if (window.scrollY > 0) { diff --git a/webfe/package_vue/src/components/paas-module-bar.vue b/webfe/package_vue/src/components/paas-module-bar.vue index 6886e334c7..fe1cc03122 100644 --- a/webfe/package_vue/src/components/paas-module-bar.vue +++ b/webfe/package_vue/src/components/paas-module-bar.vue @@ -136,6 +136,7 @@ import store from '@/store'; import router from '@/router'; import { bkMessage } from 'bk-magic-vue'; import { bus } from '@/common/bus'; +import i18n from '@/language/i18n'; export default defineComponent({ name: 'EditorStatus', @@ -207,7 +208,7 @@ export default defineComponent({ const isSmartApp = computed(() => curAppModule.source_origin === vm.proxy.GLOBAL.APP_TYPES.SMART_APP); // 新建模块禁用提示 - const disableTips = computed(() => (isSmartApp.value ? 'S-mart 应用不允许在页面上新建模块' : '当前应用不允许创建其他模块')); + const disableTips = computed(() => (isSmartApp.value ? i18n.t('S-mart 应用不允许在页面上新建模块') : i18n.t('当前应用不允许创建其他模块'))); // 切换tab const handleTabChange = async () => { @@ -269,7 +270,7 @@ export default defineComponent({ }); bkMessage({ theme: 'success', - message: '模块删除成功', + message: i18n.t('模块删除成功'), }); await store.dispatch('getAppInfo', { appCode: props.appCode, diff --git a/webfe/package_vue/src/main.js b/webfe/package_vue/src/main.js index 253688e307..5482b12d0c 100644 --- a/webfe/package_vue/src/main.js +++ b/webfe/package_vue/src/main.js @@ -244,7 +244,7 @@ auth.requestCurrentUser().then((user) => { methods: {}, template: '', }); - + bus.$emit('on-user-data', user); window.GLOBAL_I18N = global.paasVue; } }, (err) => { @@ -277,4 +277,4 @@ auth.requestCurrentUser().then((user) => { `, }); -}); \ No newline at end of file +}); diff --git a/webfe/package_vue/src/store/index.js b/webfe/package_vue/src/store/index.js index 8e93abc329..5a82ffeba2 100644 --- a/webfe/package_vue/src/store/index.js +++ b/webfe/package_vue/src/store/index.js @@ -182,8 +182,9 @@ const mutations = { state.curAppInfo.name = product.name; state.curAppInfo.application.name = product.name; }, - updateCurAppProductLogo(state, logo) { - state.curAppInfo.application.logo_url = logo; + updateCurAppBaseInfo(state, data) { + state.curAppInfo.application.logo_url = data.logo_url; + state.curAppInfo.application.name = data.name_zh_cn; }, updateCurAppMarketPublished(state, flag) { if (state.curAppInfo.application && state.curAppInfo.application.config_info) { diff --git a/webfe/package_vue/src/views/dev-center/app/basic-config/info.vue b/webfe/package_vue/src/views/dev-center/app/basic-config/info.vue index 4ddc36d682..a37a5ff0b1 100644 --- a/webfe/package_vue/src/views/dev-center/app/basic-config/info.vue +++ b/webfe/package_vue/src/views/dev-center/app/basic-config/info.vue @@ -396,6 +396,7 @@ export default { // 更新基本信息 async updateAppBasicInfo() { try { + this.appBaseInfoConfig.isLoading = true; const data = new FormData(); data.append('name', this.localeAppInfo.name); if (this.appBaseInfoConfig.logoData) { @@ -411,8 +412,7 @@ export default { }); this.resetAppBaseInfoConfig(); this.localeAppInfo.logo = res.logo_url; - this.$emit('current-app-info-updated'); - this.$store.commit('updateCurAppProductLogo', this.localeAppInfo.logo); + this.$store.commit('updateCurAppBaseInfo', res); } catch (e) { this.localeAppInfo.name = this.curAppName; this.$paasMessage({ @@ -421,6 +421,7 @@ export default { }); } finally { this.$refs.appNmaeRef?.clearError(); + this.appBaseInfoConfig.isLoading = false; } }, @@ -565,7 +566,6 @@ export default { // 基本信息提交 handleSubmitBaseInfo() { this.$refs.formNameRef?.validate().then(async () => { - this.appBaseInfoConfig.isLoading = true; this.updateAppBasicInfo(); }, (e) => { console.error(e); diff --git a/webfe/package_vue/src/views/dev-center/create-app/comps/top-bar.vue b/webfe/package_vue/src/views/dev-center/create-app/comps/top-bar.vue index 940967f321..677fcf5e47 100644 --- a/webfe/package_vue/src/views/dev-center/create-app/comps/top-bar.vue +++ b/webfe/package_vue/src/views/dev-center/create-app/comps/top-bar.vue @@ -17,7 +17,7 @@ export default {