File tree Expand file tree Collapse file tree 2 files changed +18
-16
lines changed
Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ const account = computed(() => userStore.getAccount)
3434const currentLanguage = computed (() => userStore .getLanguage )
3535const isAdmin = computed (() => userStore .isAdmin )
3636const isLocalUser = computed (() => ! userStore .getOrigin )
37+
38+ const platFlag = computed (() => {
39+ const platformInfo = userStore .getPlatformInfo
40+ return platformInfo ?.flag || 0
41+ })
3742const dialogVisible = ref (false )
3843const apikeyDialogVisible = ref (false )
3944const aboutRef = ref ()
@@ -125,7 +130,7 @@ const logout = async () => {
125130 </el-icon >
126131 <div class =" datasource-name" >{{ $t('common.system_manage') }}</div >
127132 </div >
128- <div v-if =" isLocalUser" class =" popover-item" @click =" openPwd" >
133+ <div v-if =" isLocalUser && !platFlag " class =" popover-item" @click =" openPwd" >
129134 <el-icon size =" 16" >
130135 <icon _key_outlined ></icon _key_outlined >
131136 </el-icon >
@@ -177,7 +182,7 @@ const logout = async () => {
177182 <div class =" datasource-name" >{{ $t('common.help') }}</div >
178183 </div >
179184 <div style =" height : 4px ; width : 100% " ></div >
180- <div class =" popover-item mr4" @click =" logout" >
185+ <div v-if = " platFlag <= 5 " class =" popover-item mr4" @click =" logout" >
181186 <el-icon size =" 16" >
182187 <icon _logout_outlined ></icon _logout_outlined >
183188 </el-icon >
Original file line number Diff line number Diff line change @@ -75,27 +75,24 @@ export const loadClient = (category: LoginCategory) => {
7575}
7676
7777const dingtalkClientRequest = async ( id : string | null ) => {
78- const dd = window [ 'dd' ]
79- if ( dd ?. requestAuthCode ) {
78+ if ( ! id ) {
8079 const clientInfoRes = await queryClientInfo ( 7 )
81- const corpId = id || clientInfoRes [ 'corpid' ]
82- const client_id = clientInfoRes [ 'client_id' ]
83- dd . requestAuthCode ( {
84- corpId : corpId ,
85- clientId : client_id ,
86- onSuccess : function ( result : any ) {
87- ElMessage . success ( JSON . stringify ( result ) )
88- const code = result . code
80+ id = clientInfoRes [ 'corpid' ]
81+ }
82+ const dd = window [ 'dd' ]
83+ dd . ready ( function ( ) {
84+ dd . runtime . permission . requestAuthCode ( {
85+ corpId : id ,
86+ onSuccess : function ( info : any ) {
87+ const code = info . code
8988 const state = `fit2cloud-dingtalk-client`
9089 toUrl ( `?code=${ code } &state=${ state } ` )
9190 } ,
9291 onFail : function ( err : any ) {
93- console . error ( err )
92+ ElMessage . error ( err )
9493 } ,
9594 } )
96- } else {
97- ElMessage . error ( 'not success' )
98- }
95+ } )
9996}
10097
10198const larkClientRequest = async ( ) => {
You can’t perform that action at this time.
0 commit comments