chenhaozhe
2026-01-19 da32252d08f2a52f1ddcdac62e11febb2be3f711
utils/getuiUtils.js
@@ -1,16 +1,58 @@
import {
    CommonUtils
} from "./common";
class getuiInstance {
    constructor() {
        this.cid = ""
    }
    getClientID() {
    getClientID(Userbm, UserName) {
        // #ifdef APP-PLUS
        plus.push.getClientInfoAsync((info) => {
            this.cid = info["clientid"]
            console.log('cid: ', this.cid);
        });
        const info = plus.push.getClientInfo()
        this.cid = info["clientid"]
        console.log('cid: ', this.cid);
        this.setUserClientIDRelative(Userbm, UserName, this.cid, 1)
        // #endif
    };
    async setUserClientIDRelative(Userbm, UserName, ClientID, Online) {
        try {
            let res = await CommonUtils.doRequest2Async({
                url: "/Web/SetGy_UserClientIdConnection",
                method: "POST",
                data: {
                    HUserbm: Userbm,
                    HUserName: UserName,
                    HClientID: ClientID,
                    HOnline: Online
                }
            })
            let {
                data,
                count,
                Message
            } = res.data
            if(count != 1) {
                CommonUtils.showTips({
                    title: "温馨提示",
                    message: Message
                })
            }
        }catch(err) {
            CommonUtils.showTips({
                title: "温馨提示",
                message: err
            })
        }
    }
}
export default new getuiInstance()