🎨 代码格式化

This commit is contained in:
BTMuli
2023-05-28 15:27:51 +08:00
parent ad2d5ca657
commit 01962fffb8
4 changed files with 7 additions and 21 deletions

View File

@@ -12,7 +12,7 @@
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
// store // store
import { useUserStore } from "../../store/modules/user"; import { useUserStore } from "../../store/modules/user";
// request // utils
import TGRequest from "../../web/request/TGRequest"; import TGRequest from "../../web/request/TGRequest";
import TGSqlite from "../../utils/TGSqlite"; import TGSqlite from "../../utils/TGSqlite";

View File

@@ -10,7 +10,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
// vue // vue
import { computed, onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
// store // store
import { useUserStore } from "../../store/modules/user"; import { useUserStore } from "../../store/modules/user";
// utils // utils
@@ -21,10 +21,6 @@ import TGSqlite from "../../utils/TGSqlite";
const userStore = useUserStore(); const userStore = useUserStore();
// data // data
const cookie_token = computed(() => userStore.getCookieItem("cookie_token"));
const account_id = computed(() => userStore.getCookieItem("account_id"));
const ltoken = computed(() => userStore.getCookieItem("ltoken"));
const ltuid = computed(() => userStore.getCookieItem("ltuid"));
const user = ref({} as TGApp.Sqlite.Account.Game); const user = ref({} as TGApp.Sqlite.Account.Game);
onMounted(async () => { onMounted(async () => {
@@ -36,23 +32,13 @@ onMounted(async () => {
}); });
async function getInfo1 () { async function getInfo1 () {
const ck = { const ck = userStore.getCookieGroup2() as Record<string, string>;
cookie_token: cookie_token.value,
account_id: account_id.value,
};
console.log(ck);
const res = await TGRequest.User.getRecord(ck, user.value); const res = await TGRequest.User.getRecord(ck, user.value);
console.log(res);
} }
async function getInfo2 () { async function getInfo2 () {
const ck = { const ck = userStore.getCookieGroup3() as Record<string, string>;
ltoken: ltoken.value,
ltuid: ltuid.value,
};
console.log(ck);
const res = await TGRequest.User.getRecord(ck, user.value); const res = await TGRequest.User.getRecord(ck, user.value);
console.log(res);
} }
</script> </script>
<style lang="css" scoped> <style lang="css" scoped>

View File

@@ -55,7 +55,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="lottery-json" v-if="showJson"> <div v-if="showJson" class="lottery-json">
<JsonViewer :value="jsonData" copyable boxed /> <JsonViewer :value="jsonData" copyable boxed />
</div> </div>
</template> </template>

View File

@@ -18,12 +18,12 @@ import TGUtils from "../utils/TGUtils";
* @param {TGApp.Sqlite.Account.Game} account 游戏账号 * @param {TGApp.Sqlite.Account.Game} account 游戏账号
* @returns {Promise<TGApp.Game.Character.ListItem[]|TGApp.BBS.Response.Base>} 用户角色列表 * @returns {Promise<TGApp.Game.Character.ListItem[]|TGApp.BBS.Response.Base>} 用户角色列表
*/ */
export async function getGameRoleListByLToken(cookie: TGApp.BBS.Constant.CookieGroup4, account: TGApp.Sqlite.Account.Game): Promise<TGApp.Game.Character.ListItem[] | TGApp.BBS.Response.Base> { export async function getGameRoleListByLToken (cookie: TGApp.BBS.Constant.CookieGroup4, account: TGApp.Sqlite.Account.Game): Promise<TGApp.Game.Character.ListItem[] | TGApp.BBS.Response.Base> {
const url = TGApi.GameData.byCookie.getCharacter; const url = TGApi.GameData.byCookie.getCharacter;
const uid = account.gameUid; const uid = account.gameUid;
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
const data = { role_id: uid, server: TGUtils.Tools.getServerByUid(uid) }; const data = { role_id: uid, server: TGUtils.Tools.getServerByUid(uid) };
const header = TGUtils.User.getHeader(cookie as unknown as Record<string,string>, "POST", JSON.stringify(data), "common"); const header = TGUtils.User.getHeader(cookie as unknown as Record<string, string>, "POST", JSON.stringify(data), "common");
return await http.fetch<TGApp.Game.Character.ListResponse>(url, { return await http.fetch<TGApp.Game.Character.ListResponse>(url, {
method: "POST", method: "POST",
headers: header, headers: header,