Skip to content
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
5 changes: 4 additions & 1 deletion apps/system_manage/serializers/chat_user_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ def create_token_and_cache(access_token, user, request):
if not is_authorized:
raise AppApiException(1005, _("The user does not have permission to access the application"))
token = ChatToken(
user.id, AuthenticationType.CHAT_USER, str(Operate.LOCAL).lower(), application_id=application_id
str(user.id),
AuthenticationType.CHAT_USER,
str(Operate.LOCAL).lower(),
application_id=str(application_id),
).to_token()
status = 200
return token
Expand Down
4 changes: 2 additions & 2 deletions ui/src/api/chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ Chat 业务接口统一调用后端 v3 路由(`/chat/api/v3/...`);文件
`auth.ts` 维护门户与单应用的认证:`getApplicationAuthProfile(accessToken)` 请求 `/profile`,
`getPortalAuthProfile()` 请求 `/portal/profile`,两者返回结构相同的 `AuthProfile`,差异字段在 `meta`。
`postAnonymousAuth(accessToken?)` 与 `postLogin(loginRequest, accessToken?)` 传入 accessToken 时为应用认证,
否则为门户认证。`getCaptcha(username, accessToken)` 获取应用登录验证码,后端目前以 `application_id`
查询参数接收 accessToken,暂不支持门户。`chat-user.ts` 的 `getChatUserProfile()` 获取当前对话用户。
否则为门户认证。`getCaptcha(username, accessToken)` 获取应用登录验证码,后端以 `accessToken`
查询参数接收应用令牌,暂不支持门户。`chat-user.ts` 的 `getChatUserProfile()` 获取当前对话用户。
4 changes: 2 additions & 2 deletions ui/src/api/chat/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ const getDingTalkCallback = (code: string, accessToken?: string) => {

/**
* 获取应用登录验证码;无需验证码时返回空字符串。
* 后端当前以 `application_id` 查询参数接收 accessToken,且仅支持应用场景。
* 后端以 `accessToken` 查询参数接收应用令牌,且仅支持应用场景。
*/
const getCaptcha = (username: string, accessToken: string) => {
return get<ChatCaptchaResponse>('/v3/captcha', { username, application_id: accessToken })
return get<ChatCaptchaResponse>('/v3/captcha', { username, accessToken })
}

/** 退出当前对话用户登录状态。 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { MsgError, MsgSuccess } from '@/utils/message'
import { useApplicationDetailContext } from '../../context'
import DisplaySettingPreview from './components/DisplaySettingPreview.vue'
import { APPLICATION_DISPLAY_SETTING_DEFAULT } from '@/constants/application'
import ApplicationApi from '@/api/admin/workspace/application/application'

defineOptions({ name: 'XpackDisplaySettingDialog' })

Expand Down Expand Up @@ -46,8 +47,7 @@ const languageOptions = [
function loadSetting() {
if (loading.value) return
loading.value = true
return resourceApi.application
.getAccessToken(applicationId.value)
return ApplicationApi.getDisplaySetting(applicationId.value)
.then((config) => {
// 旧版接口可能省略展示字段,嵌套配置分别补齐默认值。
const setting: ApplicationDisplaySetting = cloneDeep(APPLICATION_DISPLAY_SETTING_DEFAULT)
Expand Down
Loading