Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复富文本预览的样式问题;init接口路径配置更新 #1236

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,10 @@
color: #63656E;
}
}
/deep/ {
.tui-editor-defaultUI,
.tui-editor-contents {
font-family: inherit;
}
}
</style>
4 changes: 3 additions & 1 deletion frontend/pc/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ export default new Vuex.Store({
return jsonp(bkPaasEsbHost + '/api/c/compapi/v2/usermanage/fe_update_user_language/', language);
},
getPlatformPreData() {
return ajax.get(`${SITE_URL}init/`).then((response) => {
return ajax.get('init/', {
baseURL: window.SITE_URL
}).then((response) => {
if (response.data.data.need_target && response.data.data.location) {
window.location.href = `//${window.location.host}${response.data.data.location}`;
return;
Expand Down
6 changes: 3 additions & 3 deletions frontend/pc/src/store/modules/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,22 @@ export default {
});
},
getManagePermission({ commitm }) {
return ajax.get(`/iam/permission/platform_permission/`).then((response) => {
return ajax.get(`iam/permission/platform_permission/`).then((response) => {
const res = response.data;
return res;
});
},
// 获取项目资源的权限结构树
getPermissionMeta({ commit, state, dispatch }) {
return ajax.get(`/iam/permission/meta/`).then((response) => {
return ajax.get(`iam/permission/meta/`).then((response) => {
const res = response.data;
commit("setPermissionMeta", res.data);
return res;
});
},
// 获取权限中心跳转链接
getIamUrl({ commit }, data) {
return ajax.post(`/iam/permission/query_apply_permission_url/`, data).then((response) => {
return ajax.post(`iam/permission/query_apply_permission_url/`, data).then((response) => {
const res = response.data;
return res;
});
Expand Down
6 changes: 1 addition & 5 deletions frontend/pc/src/utils/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ bus.$on('processData', (response) => {
*/
instance.interceptors.request.use(
(config) => {
// 接口请求如果已经配置了以SITE_URL开头,则不需要添加baseURL
if (new RegExp(`^${SITE_URL}`).test(config.url)) {
config.baseURL = '';
}
// 添加工单查看权限
const token = sessionStorage.getItem('itsm_token');
if (token && config.url.indexOf('ticket/') === 0) {
Expand All @@ -83,7 +79,7 @@ instance.interceptors.request.use(

instance.interceptors.response.use(
(response) => {
if (response.config.url === `${SITE_URL}init/`) {
if (response.config.url === 'init/') {
if (response.status === 401) {
const { login_url } = response.data;
const url = `${login_url.split('c_url=')[0]}c_url=${encodeURIComponent(location.href)}`;
Expand Down
8 changes: 5 additions & 3 deletions frontend/pc/src/views/commonComponent/fieldPreview/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
:class="{ 'bk-big-width': item.layout === 'COL_12' }"
:key="index">
<span class="bk-li-left" style="float: initial;">{{item.name}}:</span>
<span class="bk-li-right"
v-html="item.value">
</span>
<div class="bk-li-right">
<RichTextEditor :is-preview="true" :value="item.value" />
</div>
</li>
<li v-else-if="item.type === 'TEXT'"
:class="{ 'bk-big-width': item.layout === 'COL_12' }"
Expand Down Expand Up @@ -116,11 +116,13 @@
import RenderView from '../../../components/renderview/RenderView';
import { deepClone } from '../../../utils/util.js';
import { getCustomTableDisplayValue } from '@/components/RenderField/fieldUtils';
import RichTextEditor from '../../../components/form/richTextEditor/richTextEditor.vue.vue';

export default {
name: 'fieldPreview',
components: {
RenderView,
RichTextEditor,
},
props: {
fields: {
Expand Down
Loading