-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
116 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "chatgpt-web-midjourney-proxy", | ||
"version": "2.14.2", | ||
"version": "2.14.3", | ||
"private": false, | ||
"description": "ChatGPT Web Midjourney Proxy", | ||
"author": "Dooy <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
//import { reactive } from 'vue' | ||
|
||
import { gptConfigStore, gptConfigType } from "@/store"; | ||
import { ss } from '@/utils/storage' | ||
|
||
export class chatSetting{ | ||
private uuid: number; | ||
private localKey='chat-setting'; | ||
//private gptConfig: gptConfigType | ||
// 构造函数 | ||
constructor(uuid: number) { | ||
this.uuid = uuid; | ||
//this.gptConfig = gptConfigStore.myData; | ||
//this.init(); | ||
} | ||
|
||
public setUuid(uuid: number){ | ||
this.uuid = uuid; | ||
return this | ||
} | ||
public getGptConfig():gptConfigType { | ||
const index = this.findIndex(); | ||
if( index<=-1) return gptConfigStore.myData; | ||
const arr = this.getObjs(); | ||
return arr[index]; | ||
} | ||
private getObjs():gptConfigType[]{ | ||
const obj = ss.get( this.localKey ) as undefined| gptConfigType[]; | ||
if(!obj) return []; | ||
return obj; | ||
} | ||
private findIndex(){ | ||
return this.getObjs().findIndex(v=>v.uuid && v.uuid==this.uuid ) | ||
} | ||
public save( obj : Partial<gptConfigType>){ | ||
let sobj ={ ...gptConfigStore.myData , ...obj }; | ||
sobj.uuid= this.uuid; | ||
const index = this.findIndex(); | ||
let arr = this.getObjs(); | ||
if( index>-1 )arr[index]= sobj; | ||
else arr.push( sobj ); | ||
ss.set(this.localKey, arr ); | ||
return this ; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters