mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 03:01:12 +00:00
no message
This commit is contained in:
parent
9d9e22451d
commit
ae5ccfd775
@ -2542,6 +2542,7 @@ class UsersController extends AbstractController
|
|||||||
* @apiName device__edit
|
* @apiName device__edit
|
||||||
*
|
*
|
||||||
* @apiParam {Object} detail 设备信息
|
* @apiParam {Object} detail 设备信息
|
||||||
|
* @apiParam {String} detail.device_name 设备名称
|
||||||
* @apiParam {String} detail.app_brand 设备品牌
|
* @apiParam {String} detail.app_brand 设备品牌
|
||||||
* @apiParam {String} detail.app_model 设备型号
|
* @apiParam {String} detail.app_model 设备型号
|
||||||
* @apiParam {String} detail.app_os 设备操作系统
|
* @apiParam {String} detail.app_os 设备操作系统
|
||||||
@ -2555,7 +2556,7 @@ class UsersController extends AbstractController
|
|||||||
User::auth();
|
User::auth();
|
||||||
//
|
//
|
||||||
$detail = Base::json2array(Request::input('detail'));
|
$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)) {
|
if (empty($detail)) {
|
||||||
return Base::retError('参数错误');
|
return Base::retError('参数错误');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -208,6 +208,7 @@ export default {
|
|||||||
if (this.$isEEUiApp) {
|
if (this.$isEEUiApp) {
|
||||||
this.umengAliasTimer && clearTimeout(this.umengAliasTimer)
|
this.umengAliasTimer && clearTimeout(this.umengAliasTimer)
|
||||||
if (this.userId > 0) {
|
if (this.userId > 0) {
|
||||||
|
// 给 APP 发送初始化消息
|
||||||
$A.eeuiAppSendMessage({
|
$A.eeuiAppSendMessage({
|
||||||
action: 'initApp',
|
action: 'initApp',
|
||||||
apiUrl: $A.apiUrl(''),
|
apiUrl: $A.apiUrl(''),
|
||||||
@ -216,6 +217,29 @@ export default {
|
|||||||
language: languageName,
|
language: languageName,
|
||||||
userAgent: window.navigator.userAgent,
|
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 = setTimeout(_ => {
|
||||||
this.umengAliasTimer = null;
|
this.umengAliasTimer = null;
|
||||||
$A.eeuiAppSendMessage({
|
$A.eeuiAppSendMessage({
|
||||||
@ -224,6 +248,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}, 6000)
|
}, 6000)
|
||||||
} else {
|
} else {
|
||||||
|
// 删除友盟别名
|
||||||
$A.eeuiAppSendMessage({
|
$A.eeuiAppSendMessage({
|
||||||
action: 'delUmengAlias',
|
action: 'delUmengAlias',
|
||||||
url: $A.apiUrl('users/umeng/alias')
|
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"
|
"zh-CHT": "zh-Hant"
|
||||||
};
|
};
|
||||||
return specialMappings[languageName] || languageName;
|
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';
|
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 = [];
|
const array = [];
|
||||||
if (/web/i.test(app_type)) {
|
if (/web/i.test(app_type)) {
|
||||||
array.push(...[browser, this.$L("浏览器")]);
|
array.push(...[browser, this.$L("浏览器")]);
|
||||||
|
} else if (device_name) {
|
||||||
|
return device_name
|
||||||
} else if (app_brand) {
|
} else if (app_brand) {
|
||||||
array.push(...[app_brand, app_model])
|
array.push(...[app_brand, app_model])
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit a1745375245f66d9681d2c7ba8a1da413f351469
|
Subproject commit 5596d130c5f73f0b8143a3734261f5d3df0c6410
|
||||||
Loading…
x
Reference in New Issue
Block a user