1- import { Result } from '@/request/Result'
1+ import { Result } from '@/request/Result'
22import {
33 get ,
44 post ,
@@ -9,17 +9,17 @@ import {
99 download ,
1010 exportFile ,
1111} from '@/request/chat/index'
12- import { type ChatProfile } from '@/api/type/chat'
13- import { type Ref } from 'vue'
14- import type { ResetPasswordRequest } from '@/api/type/user.ts'
12+ import { type ChatProfile } from '@/api/type/chat'
13+ import { type Ref } from 'vue'
14+ import type { ResetPasswordRequest } from '@/api/type/user.ts'
1515
1616import useStore from '@/stores'
17- import type { LoginRequest } from '@/api/type/user'
17+ import type { LoginRequest } from '@/api/type/user'
1818
19- const prefix : any = { _value : '/workspace/' }
19+ const prefix : any = { _value : '/workspace/' }
2020Object . defineProperty ( prefix , 'value' , {
2121 get : function ( ) {
22- const { user } = useStore ( )
22+ const { user} = useStore ( )
2323 return this . _value + user . getWorkspaceId ( ) + '/application'
2424 } ,
2525} )
@@ -51,7 +51,7 @@ const chatProfile: (assessToken: string, loading?: Ref<boolean>) => Promise<Resu
5151 assessToken ,
5252 loading ,
5353) => {
54- return get ( '/profile' , { access_token : assessToken } , loading )
54+ return get ( '/profile' , { access_token : assessToken } , loading )
5555}
5656/**
5757 * 匿名认证
@@ -63,7 +63,7 @@ const anonymousAuthentication: (
6363 assessToken : string ,
6464 loading ?: Ref < boolean > ,
6565) => Promise < Result < any > > = ( assessToken , loading ) => {
66- return post ( '/auth/anonymous' , { access_token : assessToken } , { } , loading )
66+ return post ( '/auth/anonymous' , { access_token : assessToken } , { } , loading )
6767}
6868/**
6969 * 密码认证
@@ -77,7 +77,7 @@ const passwordAuthentication: (
7777 password : string ,
7878 loading ?: Ref < boolean > ,
7979) => Promise < Result < any > > = ( assessToken , password , loading ) => {
80- return post ( 'auth/password' , { access_token : assessToken , password : password } , { } , loading )
80+ return post ( 'auth/password' , { access_token : assessToken , password : password } , { } , loading )
8181}
8282/**
8383 * 获取应用相关信息
@@ -122,38 +122,40 @@ const getCaptcha: (loading?: Ref<boolean>) => Promise<Result<any>> = (loading) =
122122 * 获取二维码类型
123123 */
124124const getQrType : ( loading ?: Ref < boolean > ) => Promise < Result < any > > = ( loading ) => {
125- return get ( 'qr_type' , undefined , loading )
125+ return get ( 'auth/ qr_type' , undefined , loading )
126126}
127127
128128const getQrSource : ( loading ?: Ref < boolean > ) => Promise < Result < any > > = ( loading ) => {
129- return get ( 'qr_type/source' , undefined , loading )
129+ return get ( 'auth/ qr_type/source' , undefined , loading )
130130}
131131
132- const getDingCallback : ( code : string , loading ?: Ref < boolean > ) => Promise < Result < any > > = (
132+ const getDingCallback : ( code : string , accessToken : string , loading ?: Ref < boolean > ) => Promise < Result < any > > = (
133133 code ,
134+ accessToken ,
134135 loading ,
135136) => {
136- return get ( 'dingtalk' , { code } , loading )
137+ return get ( 'auth/ dingtalk' , { code, accessToken : accessToken } , loading )
137138}
138139
139140const getDingOauth2Callback : ( code : string , loading ?: Ref < boolean > ) => Promise < Result < any > > = (
140141 code ,
141142 loading ,
142143) => {
143- return get ( 'dingtalk/oauth2' , { code } , loading )
144+ return get ( 'auth/ dingtalk/oauth2' , { code} , loading )
144145}
145146
146- const getWecomCallback : ( code : string , loading ?: Ref < boolean > ) => Promise < Result < any > > = (
147+ const getWecomCallback : ( code : string , accessToken : string , loading ?: Ref < boolean > ) => Promise < Result < any > > = (
147148 code ,
149+ accessToken ,
148150 loading ,
149151) => {
150- return get ( 'wecom' , { code } , loading )
152+ return get ( 'auth/ wecom' , { code, accessToken : accessToken } , loading )
151153}
152154const getLarkCallback : ( code : string , loading ?: Ref < boolean > ) => Promise < Result < any > > = (
153155 code ,
154156 loading ,
155157) => {
156- return get ( 'lark/oauth2' , { code } , loading )
158+ return get ( 'auth/ lark/oauth2' , { code} , loading )
157159}
158160
159161/**
@@ -274,17 +276,17 @@ const deleteChat: (chat_id: string, loading?: Ref<boolean>) => Promise<Result<an
274276 chat_id ,
275277 loading ,
276278) => {
277- return del ( `historical_conversation/${ chat_id } ` , undefined , undefined , loading )
279+ return del ( `historical_conversation/${ chat_id } ` , undefined , undefined , loading )
278280}
279281/**
280- *
281- * @param loading
282- * @returns
282+ *
283+ * @param loading
284+ * @returns
283285 */
284286const clearChat : ( loading ?: Ref < boolean > ) => Promise < Result < any > > = (
285287 loading
286288) => {
287- return del ( `historical_conversation/clear` , undefined , undefined , loading )
289+ return del ( `historical_conversation/clear` , undefined , undefined , loading )
288290}
289291/**
290292 *
0 commit comments