Browse Source

feat: Oauth

lejianwen 5 months ago
parent
commit
ffe0961b4a
1 changed files with 14 additions and 9 deletions
  1. 14 9
      src/views/oauth/index.vue

+ 14 - 9
src/views/oauth/index.vue

@@ -58,14 +58,18 @@
58 58
         </el-form-item>
59 59
         <el-form-item label="ClientSecret" prop="client_secret">
60 60
           <el-input
61
-            v-model="formData.client_secret"
62
-            :type="formData.id ? 'password' : 'text'"
63
-            :show-password="!formData.id"
64
-            >
61
+              v-model="formData.client_secret"
62
+              :type="formData.id ? 'password' : 'text'"
63
+              :show-password="!formData.id"
64
+          >
65 65
           </el-input>
66 66
         </el-form-item>
67 67
         <el-form-item label="RedirectUrl" prop="redirect_url">
68
-          <div @click="copyRedirectUrl">{{formData.redirect_url}} <el-icon><CopyDocument></CopyDocument></el-icon></div>
68
+          <div @click="copyRedirectUrl">{{ defaultRedirect() }}
69
+            <el-icon>
70
+              <CopyDocument></CopyDocument>
71
+            </el-icon>
72
+          </div>
69 73
         </el-form-item>
70 74
         <el-form-item label="PkceEnable" prop="pkce_enable">
71 75
           <el-switch v-model="formData.pkce_enable"
@@ -106,8 +110,9 @@
106 110
   import { CopyDocument } from '@element-plus/icons'
107 111
 
108 112
   const app = useAppStore()
113
+
109 114
   const copyRedirectUrl = (e) => {
110
-    handleClipboard(formData.redirect_url, e)
115
+    handleClipboard(defaultRedirect(), e)
111 116
   }
112 117
 
113 118
   const listRes = reactive({
@@ -200,7 +205,7 @@
200 205
   }
201 206
 
202 207
   const defaultRedirect = () => {
203
-    return `${app.setting.rustdeskConfig.api_server||window.location.origin}/api/oidc/callback`
208
+    return `${app.setting.rustdeskConfig.api_server || window.location.origin}/api/oidc/callback`
204 209
   }
205 210
 
206 211
   const toEdit = (row) => {
@@ -211,7 +216,7 @@
211 216
     formData.issuer = row.issuer
212 217
     formData.client_id = row.client_id
213 218
     formData.client_secret = row.client_secret
214
-    formData.redirect_url = row.redirect_url || defaultRedirect()
219
+    // formData.redirect_url = row.redirect_url || defaultRedirect()
215 220
     formData.scopes = row.scopes
216 221
     formData.auto_register = row.auto_register
217 222
     formData.pkce_enable = row.pkce_enable
@@ -225,7 +230,7 @@
225 230
     formData.issuer = ''
226 231
     formData.client_id = ''
227 232
     formData.client_secret = ''
228
-    formData.redirect_url = defaultRedirect()
233
+    // formData.redirect_url = defaultRedirect()
229 234
     formData.scopes = ''
230 235
     formData.auto_register = false
231 236
     formData.pkce_enable = false