mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
no message
This commit is contained in:
parent
9d9e22451d
commit
ae5ccfd775
@ -2541,10 +2541,11 @@ class UsersController extends AbstractController
|
||||
* @apiGroup users
|
||||
* @apiName device__edit
|
||||
*
|
||||
* @apiParam {Object} detail 设备信息
|
||||
* @apiParam {String} detail.app_brand 设备品牌
|
||||
* @apiParam {String} detail.app_model 设备型号
|
||||
* @apiParam {String} detail.app_os 设备操作系统
|
||||
* @apiParam {Object} detail 设备信息
|
||||
* @apiParam {String} detail.device_name 设备名称
|
||||
* @apiParam {String} detail.app_brand 设备品牌
|
||||
* @apiParam {String} detail.app_model 设备型号
|
||||
* @apiParam {String} detail.app_os 设备操作系统
|
||||
*
|
||||
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
|
||||
* @apiSuccess {String} msg 返回信息(错误描述)
|
||||
@ -2555,7 +2556,7 @@ class UsersController extends AbstractController
|
||||
User::auth();
|
||||
//
|
||||
$detail = Base::json2array(Request::input('detail'));
|
||||
$detail = array_intersect_key($detail, array_flip(['app_brand', 'app_model', 'app_os']));
|
||||
$detail = array_intersect_key($detail, array_flip([ 'device_name', 'app_brand', 'app_model','app_os']));
|
||||
if (empty($detail)) {
|
||||
return Base::retError('参数错误');
|
||||
}
|
||||
|
||||
@ -208,6 +208,7 @@ export default {
|
||||
if (this.$isEEUiApp) {
|
||||
this.umengAliasTimer && clearTimeout(this.umengAliasTimer)
|
||||
if (this.userId > 0) {
|
||||
// 给 APP 发送初始化消息
|
||||
$A.eeuiAppSendMessage({
|
||||
action: 'initApp',
|
||||
apiUrl: $A.apiUrl(''),
|
||||
@ -216,6 +217,29 @@ export default {
|
||||
language: languageName,
|
||||
userAgent: window.navigator.userAgent,
|
||||
});
|
||||
|
||||
// 更新设备信息
|
||||
$A.eeuiAppGetDeviceInfo().then(async info => {
|
||||
let deviceName = info.deviceName || info.modelName
|
||||
if (info.systemName === 'Android') {
|
||||
if ($A.strExists(info.modelName, info.brand)) {
|
||||
deviceName = info.modelName
|
||||
} else {
|
||||
deviceName = info.brand + ' ' + info.model
|
||||
}
|
||||
}
|
||||
await this.$store.dispatch("call", {
|
||||
url: "users/device/edit",
|
||||
data: {
|
||||
device_name: deviceName,
|
||||
app_brand: info.brand,
|
||||
app_model: info.model,
|
||||
app_os: info.systemName + ' ' + info.systemVersion,
|
||||
}
|
||||
})
|
||||
}).catch(console.log)
|
||||
|
||||
// 设置友盟别名
|
||||
this.umengAliasTimer = setTimeout(_ => {
|
||||
this.umengAliasTimer = null;
|
||||
$A.eeuiAppSendMessage({
|
||||
@ -224,6 +248,7 @@ export default {
|
||||
});
|
||||
}, 6000)
|
||||
} else {
|
||||
// 删除友盟别名
|
||||
$A.eeuiAppSendMessage({
|
||||
action: 'delUmengAlias',
|
||||
url: $A.apiUrl('users/umeng/alias')
|
||||
|
||||
17
resources/assets/js/functions/eeui.js
vendored
17
resources/assets/js/functions/eeui.js
vendored
@ -330,6 +330,23 @@ import {languageName} from "../language";
|
||||
"zh-CHT": "zh-Hant"
|
||||
};
|
||||
return specialMappings[languageName] || languageName;
|
||||
},
|
||||
|
||||
// 获取设备信息
|
||||
eeuiAppGetDeviceInfo() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
const eeui = await $A.eeuiModulePromise();
|
||||
eeui.getDeviceInfo(result => {
|
||||
if (result.status !== 'success') {
|
||||
return reject({msg: result.error || "get failed"});
|
||||
}
|
||||
resolve(result);
|
||||
});
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -92,10 +92,12 @@ export default {
|
||||
return 'web';
|
||||
},
|
||||
|
||||
getName({app_brand, app_model, app_type, app_name, browser}) {
|
||||
getName({app_brand, app_model, device_name, app_type, app_name, browser}) {
|
||||
const array = [];
|
||||
if (/web/i.test(app_type)) {
|
||||
array.push(...[browser, this.$L("浏览器")]);
|
||||
} else if (device_name) {
|
||||
return device_name
|
||||
} else if (app_brand) {
|
||||
array.push(...[app_brand, app_model])
|
||||
} else {
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit a1745375245f66d9681d2c7ba8a1da413f351469
|
||||
Subproject commit 5596d130c5f73f0b8143a3734261f5d3df0c6410
|
||||
Loading…
x
Reference in New Issue
Block a user