commit
ba22480128
|
@ -138,12 +138,13 @@ export default class Runtime {
|
||||||
*
|
*
|
||||||
* @param targetType all: 所有用户均可, cookie:查询用户必须具备Cookie
|
* @param targetType all: 所有用户均可, cookie:查询用户必须具备Cookie
|
||||||
* @param option MysApi option
|
* @param option MysApi option
|
||||||
|
* @param isSr 是否为星穹铁道
|
||||||
* @returns {Promise<boolean|MysApi>}
|
* @returns {Promise<boolean|MysApi>}
|
||||||
*/
|
*/
|
||||||
async getMysApi (targetType = 'all', option = {}) {
|
async getMysApi (targetType = 'all', option = {}, isSr = false) {
|
||||||
let mys = await this.getMysInfo(targetType)
|
let mys = await this.getMysInfo(targetType)
|
||||||
if (mys.uid && mys?.ckInfo?.ck) {
|
if (mys.uid && mys?.ckInfo?.ck) {
|
||||||
return new MysApi(mys.uid, mys.ckInfo.ck, option)
|
return new MysApi(mys.uid, mys.ckInfo.ck, option, isSr)
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -153,10 +154,11 @@ export default class Runtime {
|
||||||
* @param uid
|
* @param uid
|
||||||
* @param ck
|
* @param ck
|
||||||
* @param option
|
* @param option
|
||||||
|
* @param isSr 是否为星穹铁道
|
||||||
* @returns {Promise<MysApi>}
|
* @returns {Promise<MysApi>}
|
||||||
*/
|
*/
|
||||||
async createMysApi (uid, ck, option) {
|
async createMysApi (uid, ck, option, isSr = false) {
|
||||||
return new MysApi(uid, ck, option)
|
return new MysApi(uid, ck, option, isSr)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -29,7 +29,7 @@ export default class MysInfo {
|
||||||
|
|
||||||
this.gtest = false
|
this.gtest = false
|
||||||
this.mysButton = segment.button([
|
this.mysButton = segment.button([
|
||||||
{ text: "米游社", link: "https://miyoushe.com" },
|
{ text: '米游社', link: 'https://miyoushe.com' }
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,9 +96,11 @@ export default class MysInfo {
|
||||||
let atUser = await NoteUser.create(at)
|
let atUser = await NoteUser.create(at)
|
||||||
uid = atUser.getUid(e)
|
uid = atUser.getUid(e)
|
||||||
if (uid) return String(uid)
|
if (uid) return String(uid)
|
||||||
if (e.noTips !== true) e.reply(['尚未绑定uid', segment.button([
|
if (e.noTips !== true) {
|
||||||
{ text: "绑定UID", input: "#绑定uid" },
|
e.reply(['尚未绑定uid', segment.button([
|
||||||
|
{ text: '绑定UID', input: '#绑定uid' }
|
||||||
])], false, { at })
|
])], false, { at })
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,9 +118,11 @@ export default class MysInfo {
|
||||||
return user.autoRegUid(uid, e)
|
return user.autoRegUid(uid, e)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.noTips !== true) e.reply(['请先#绑定uid', segment.button([
|
if (e.noTips !== true) {
|
||||||
{ text: "绑定UID", input: "#绑定uid" },
|
e.reply(['请先#绑定uid', segment.button([
|
||||||
|
{ text: '绑定UID', input: '#绑定uid' }
|
||||||
])], false, { at: at || true })
|
])], false, { at: at || true })
|
||||||
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -136,9 +140,11 @@ export default class MysInfo {
|
||||||
let selfUser = at ? await NoteUser.create(at) : user
|
let selfUser = at ? await NoteUser.create(at) : user
|
||||||
|
|
||||||
if (!selfUser.hasCk) {
|
if (!selfUser.hasCk) {
|
||||||
if (e.noTips !== true) e.reply(['尚未绑定Cookie', segment.button([
|
if (e.noTips !== true) {
|
||||||
{ text: "Cookie帮助", callback: "#Cookie帮助" },
|
e.reply(['尚未绑定Cookie', segment.button([
|
||||||
|
{ text: 'Cookie帮助', callback: '#Cookie帮助' }
|
||||||
])], false, { at: selfUser.qq })
|
])], false, { at: selfUser.qq })
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,13 +320,13 @@ export default class MysInfo {
|
||||||
|
|
||||||
if (!this.uid) {
|
if (!this.uid) {
|
||||||
this.e.reply(['请先#绑定uid', segment.button([
|
this.e.reply(['请先#绑定uid', segment.button([
|
||||||
{ text: "绑定UID", input: "#绑定uid" },
|
{ text: '绑定UID', input: '#绑定uid' }
|
||||||
])], false, { at: true })
|
])], false, { at: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.ckInfo.ck) {
|
if (!this.ckInfo.ck) {
|
||||||
this.e.reply(['暂无可用CK,请绑定更多用户或设置公共ck..', segment.button([
|
this.e.reply(['暂无可用CK,请绑定更多用户或设置公共ck..', segment.button([
|
||||||
{ text: "Cookie帮助", callback: "#Cookie帮助" },
|
{ text: 'Cookie帮助', callback: '#Cookie帮助' }
|
||||||
])])
|
])])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,7 +346,7 @@ export default class MysInfo {
|
||||||
let mysUser = await MysUser.getByQueryUid(this.uid, game, onlySelfCk)
|
let mysUser = await MysUser.getByQueryUid(this.uid, game, onlySelfCk)
|
||||||
if (mysUser) {
|
if (mysUser) {
|
||||||
if (mysUser.ck) {
|
if (mysUser.ck) {
|
||||||
this.ckInfo = mysUser.getCkInfo()
|
this.ckInfo = mysUser.getCkInfo(game)
|
||||||
this.ckUser = mysUser
|
this.ckUser = mysUser
|
||||||
// 暂时直接记录请求uid,后期优化分析MysApi请求结果分状态记录结果
|
// 暂时直接记录请求uid,后期优化分析MysApi请求结果分状态记录结果
|
||||||
await mysUser.addQueryUid(this.uid, game)
|
await mysUser.addQueryUid(this.uid, game)
|
||||||
|
|
Loading…
Reference in New Issue