cursor-vip update

This commit is contained in:
kingparks@jeter.eu.org
2025-02-26 20:09:05 +08:00
parent ba39655a81
commit 3106cf05e5
7 changed files with 26 additions and 10 deletions

View File

@@ -84,7 +84,13 @@ fi;
# 如果是windows系统
if [[ $os_name == "windows" ]]; then
# 停掉正在运行cursor-vip
taskkill -f -im cursor-vip.exe > nul 2>&1 || true
if [ -n "$MSYSTEM" ]; then
# Git Bash 环境
taskkill -f -im cursor-vip.exe > /dev/null 2>&1 || true
else
# CMD 或 PowerShell 环境
taskkill -f -im cursor-vip.exe > nul 2>&1 || true
fi
# 判断如果有powershell则通过powershell来获取桌面路径,否则通过cmd来获取桌面路径
desktop_dir="${USERPROFILE}/Desktop"
if command -v powershell > /dev/null; then

3
go.mod
View File

@@ -23,7 +23,7 @@ require (
github.com/tidwall/gjson v1.17.1
github.com/tidwall/sjson v1.2.5
github.com/unknwon/i18n v0.0.0-20210904045753-ff3a8617e361
golang.org/x/sys v0.22.0
golang.org/x/sys v0.30.0
gorm.io/driver/mysql v1.5.7
gorm.io/gorm v1.25.11
howett.net/plist v1.0.1
@@ -93,6 +93,7 @@ require (
)
replace (
github.com/denisbrodbeck/machineid => ./auth/machineid
github.com/lqqyt2423/go-mitmproxy => ./auth/go-mitmproxy
github.com/ugorji/go => github.com/ugorji/go v1.2.12
github.com/ugorji/go/codec => github.com/ugorji/go/codec v1.2.12

6
go.sum
View File

@@ -38,8 +38,6 @@ github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGii
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMSRhl4D7AQ=
github.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
@@ -303,8 +301,8 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=

View File

@@ -1,6 +1,7 @@
package main
import (
"github.com/gofrs/flock"
"github.com/kingparks/cursor-vip/auth"
"github.com/kingparks/cursor-vip/tui"
"github.com/kingparks/cursor-vip/tui/params"
@@ -11,13 +12,16 @@ import (
"syscall"
)
var lock *flock.Flock
var pidFilePath string
func main() {
lock, pidFilePath, _ = tool.EnsureSingleInstance("cursor-vip")
productSelected, modelIndexSelected := tui.Run()
startServer(productSelected, modelIndexSelected)
}
func startServer(productSelected string, modelIndexSelected int) {
lock, pidFilePath, _ := tool.EnsureSingleInstance("cursor-vip")
params.Sigs = make(chan os.Signal, 1)
signal.Notify(params.Sigs, os.Interrupt, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGKILL)
go func() {

View File

@@ -191,11 +191,17 @@ func (c *Client) GetMyInfo(deviceID string) (sCount, sPayCount, isPay, ticket, e
}
res, err := httplib.Post(c.host+"/my").Header("sign", sign.Sign(deviceID)).Header("deviceName", deviceName).Body(body).String()
if err != nil {
fmt.Println(fmt.Sprintf("\u001B[31m%s\u001B[0m", err))
_, _ = fmt.Fprintf(params.ColorOut, params.Red, "Error,please contact cursor-vip@jeter.eu.org:\n"+err.Error())
_, _ = fmt.Scanln()
panic(fmt.Sprintf("\u001B[31m%s\u001B[0m", err))
return
}
if gjson.Get(res, "error").String() != "" {
_, _ = fmt.Fprintf(params.ColorOut, params.Red, "Error,please contact cursor-vip@jeter.eu.org:\n"+gjson.Get(res, "error").String())
_, _ = fmt.Scanln()
panic(fmt.Sprintf("\u001B[31m%s\u001B[0m", gjson.Get(res, "error").String()))
return
}
sCount = gjson.Get(res, "sCount").String()
sPayCount = gjson.Get(res, "sPayCount").String()
isPay = gjson.Get(res, "isPay").String()

View File

@@ -1,6 +1,6 @@
package params
var Version = 250
var Version = 251
var Hosts = []string{"https://cursor.jeter.eu.org", "http://129.154.205.7:7193"}

View File

@@ -6,7 +6,8 @@ import (
"os"
)
var Mode int64 // 1模式1 2模式2
var Mode int64 // 1模式1 2模式2
var CursorVersion string // cursor版本号
var Lang string
var ExclusiveToken string
var Promotion string