File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const app = {
7
7
isValidated ( ) {
8
8
const inputText = this . u . trim ( ) ;
9
9
// 使用正则表达式匹配以 "sk-" 开头的密钥,并排除非匹配项
10
- const regex = / ^ s k - .{ 21 , } $ / ;
10
+ const regex = / ^ ( s k - | s e s s - ) .{ 21 , } $ / ;
11
11
const keys = inputText . split ( '\n' ) . filter ( key => regex . test ( key . trim ( ) ) ) ;
12
12
return keys
13
13
} ,
@@ -22,7 +22,7 @@ const app = {
22
22
23
23
async submit ( $refs ) {
24
24
if ( ! this . u ) {
25
- this . alert = { type : 'error' , message : '请输入以sk-开头的key ...' }
25
+ this . alert = { type : 'error' , message : '请输入以sess-开头的Authorization ...' }
26
26
return
27
27
}
28
28
const keys = this . isValidated ( ) ;
@@ -92,7 +92,7 @@ const app = {
92
92
}
93
93
this . total . push ( {
94
94
key : key ,
95
- msgkey : key . replace ( / ( s k - .{ 5 } ) .+ ( .{ 5 } ) / , '$1****$2' ) ,
95
+ msgkey : key . replace ( / ( s e s s - .{ 5 } ) .+ ( .{ 5 } ) / , '$1****$2' ) ,
96
96
total_granted : 0 ,
97
97
total_used : 0 ,
98
98
total_available : 0 ,
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ <h2>查询 OpenaiAPI 余额</h2>
45
45
</ div >
46
46
< main x-data ="app " x-cloak >
47
47
< p x-show.transition.opacity ="alert " :class ="alert?.type " x-text ="alert?.message "> </ p >
48
- < textarea class ="form-control " rows ="5 " placeholder ="请输入以sk-开头的key... " x-model ="u "> </ textarea > </ p >
48
+ < textarea class ="form-control " rows ="5 " placeholder ="请输入以sess-xxxx开头的Authorization " x-model ="u "> </ textarea > </ p >
49
49
< div class ="d-grid gap-2 d-sm-block ">
50
50
< button :class ="{ loading } " class ="btn btn-primary me-sm-3 " :disabled ="loading "
51
51
@click ="submit($refs) "> 查询</ button >
You can’t perform that action at this time.
0 commit comments