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