fix bug
This commit is contained in:
@@ -107,12 +107,12 @@ watch(
|
|||||||
);
|
);
|
||||||
|
|
||||||
function calcRealX(num) {
|
function calcRealX(num) {
|
||||||
const len = 20 + num;
|
const len = 20.4 + num;
|
||||||
return `calc(${(len / 40) * 100}% - 8px)`;
|
return `calc(${(len / 40.8) * 100}% - 8px)`;
|
||||||
}
|
}
|
||||||
function calcRealY(num) {
|
function calcRealY(num) {
|
||||||
const len = num < 0 ? Math.abs(num) + 20 : 20 - num;
|
const len = num < 0 ? Math.abs(num) + 20.4 : 20.4 - num;
|
||||||
return `calc(${(len / 40) * 100}% - 8px)`;
|
return `calc(${(len / 40.8) * 100}% - 8px)`;
|
||||||
}
|
}
|
||||||
const simulShoot = async () => {
|
const simulShoot = async () => {
|
||||||
if (device.value.deviceId) await simulShootAPI(device.value.deviceId);
|
if (device.value.deviceId) await simulShootAPI(device.value.deviceId);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import Avatar from "@/components/Avatar.vue";
|
import Avatar from "@/components/Avatar.vue";
|
||||||
import SButton from "@/components/SButton.vue";
|
import SButton from "@/components/SButton.vue";
|
||||||
import { getMyDevicesAPI, loginAPI } from "@/apis";
|
import { getMyDevicesAPI, loginAPI, getHomeData } from "@/apis";
|
||||||
import useStore from "@/store";
|
import useStore from "@/store";
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { updateUser, updateDevice } = store;
|
const { updateUser, updateDevice } = store;
|
||||||
@@ -54,11 +54,8 @@ const handleLogin = () => {
|
|||||||
const avatarBase64 = fileManager.readFileSync(avatarUrl.value, "base64");
|
const avatarBase64 = fileManager.readFileSync(avatarUrl.value, "base64");
|
||||||
const base64Url = `data:image/png;base64,${avatarBase64}`;
|
const base64Url = `data:image/png;base64,${avatarBase64}`;
|
||||||
const result = await loginAPI(nickName.value, base64Url, code);
|
const result = await loginAPI(nickName.value, base64Url, code);
|
||||||
updateUser({
|
const data = await getHomeData();
|
||||||
...result.user,
|
if (data.user) updateUser(data.user);
|
||||||
nickName: nickName.value,
|
|
||||||
avatarUrl: avatarUrl.value,
|
|
||||||
});
|
|
||||||
const devices = await getMyDevicesAPI();
|
const devices = await getMyDevicesAPI();
|
||||||
if (devices.bindings && devices.bindings.length) {
|
if (devices.bindings && devices.bindings.length) {
|
||||||
updateDevice(
|
updateDevice(
|
||||||
|
|||||||
Reference in New Issue
Block a user