我正在使用Cordova 3.0.我能够创建一个骨架项目并运行它没有任何问题.现在我想添加设备插件.以下是我的步骤:
1.添加资产\ www\device.js
2.修改res\xml\config.xml并添加:
<feature name="Device">
<param name="android-package" value="org.apache.cordova.Device" />
</feature>
Run Code Online (Sandbox Code Playgroud)
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
Run Code Online (Sandbox Code Playgroud)
添加了src\Device.java
在index.html中我添加了脚本src:
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="device.js"></script>
<script type="text/javascript" src="js/index.js"></script>
Run Code Online (Sandbox Code Playgroud)
在index.js中我添加了以下代码:
onDeviceReady: function() {
app.receivedEvent('deviceready');
console.log('device.model=>' + device.model);
},
Run Code Online (Sandbox Code Playgroud)
我在Android模拟器上构建并运行并获取错误:
10-03 12:22:49.998:E/Web控制台(637):未捕获的ReferenceError:在文件中未定义require:///android_asset/www/device.js:22
10-03 12:22:50.489:I/Web Console(637):device.model => undefined at file:///android_asset/www/js/index.js:40
关于什么我失踪的任何想法?我已按照phonegap网站上的说明 http://docs.phonegap.com/en/edge/cordova_device_device.md.html#Device
我有以下代码在运行对抗babel时有效.现在我正在使用和声,我收到以下错误:
let adResult = await ad.isUserValid(domainPath, password);
^^
SyntaxError: Unexpected identifier
Run Code Online (Sandbox Code Playgroud)
以下类函数:
class ActiveDirectoryHelper {
constructor(options) {
this.config = options.config
this.ad = null;
}
connect() {
var config = {
url: this.config.url,
baseDN: this.config.baseDN,
attributes: this.config.attributes
};
if (this.config.account.user.length > 0) {
config.username = this.config.account.user;
config.password = this.config.account.password;
}
this.ad = new ActiveDirectory(config);
}
async isUserValid(user, password) {
return new Promise((resolve, reject) => {
this.ad.authenticate(user, password, (err, auth) => {
if (err) {
reject({
code: 500,
message: "Unknown authentication error", …Run Code Online (Sandbox Code Playgroud) 我不明白为什么我的 ToolButton 这么小。工具栏是顶部的橙色矩形。下面的代码:
Item{
ToolBar{
id: toolbar
width: parent.width
height: scaleDP(0.29)
anchors.top: parent.top
background: Rectangle{
color: "orange"
}
RowLayout{
anchors.fill: parent
ToolButton {
id: buttonBack
height: parent.height
width: parent.height
Image {
id: imageBack
source: "qrc:/assets/images/left-filled-black-50.png"
anchors.fill: parent
anchors.margins: 4
}
}
Run Code Online (Sandbox Code Playgroud)
显示我的工具按钮太小:
我可以更改图像的高度并使其变大,但它位于工具按钮之外。当我尝试调整 ToolButton 的高度时,没有任何反应
发现
看来问题出在 RowLayout 上。如果我将其更改为“行”或“矩形”,则图标会按预期调整大小。
即时通讯使用mariadb和heidisql执行sql:
宣告@AccountID INT;
插入帐户(名字,mi,姓氏,电子邮件,is_admin,is_enabled,date_created)值('testfirstname','a','testlastname','user @ email.com',1、1,NOW());
设置@AccountID = Last_Insert_Id();
我不断收到错误消息:
QL错误(1064):您的SQL语法有错误;检查与您的MariaDB服务器版本相对应的手册以获取正确的语法,以在第1行的'@AccountID INT'附近使用* /
我在查看Declare的用法,但它说它在Function中使用。香港专业教育学院尝试与BEGIN / END在DECLARE之前和之后出现相同的错误。
我是mysql语法的新手,它将在sql server中工作。因此,如果有人可以让我知道我做错了,将不胜感激。
谢谢
我正在使用Weather API将天气信息作为我项目的一项服务。我试图了解一些我似乎找不到信息的时区偏移量。
我使用的网址是:
https://api.weather.gov/gridpoints/VEF/154,48
Run Code Online (Sandbox Code Playgroud)
这是一些示例返回值:
"temperature": {
"sourceUnit": "F",
"uom": "unit:degC",
"values": [
{
"validTime": "2019-05-11T16:00:00+00:00/PT1H",
"value": 18.333333333333371
},
{
"validTime": "2019-05-12T04:00:00+00:00/PT2H",
"value": 16.1111111111112
},
{
"validTime": "2019-05-12T21:00:00+00:00/PT4H",
"value": 26.666666666666742
},
...
]
}
Run Code Online (Sandbox Code Playgroud)
我知道PT的意思是太平洋时区。但是我似乎找不到像1H,2H等字符旁边的任何信息。
如果有人可以建议,将不胜感激-谢谢
我正在使用最新的 Docker PostgreSQL 14.1 映像并尝试更改文件 pg_hba.conf 以使用 md5(开发机器):
# host all all all scram-sha-256
host all all all md5
Run Code Online (Sandbox Code Playgroud)
我在本地有一个修改后的 pg_hba.conf 文件,我正在尝试使用它。在我的 Dockerfile 中,我执行以下操作:
RUN rm -f /var/lib/postgresql/data/pg_hba.conf
COPY ./postgresql/pg_hba.conf /var/lib/postgresql/data/pg_hba.conf
Run Code Online (Sandbox Code Playgroud)
其中 ./postgresql/pg_hba.conf 是允许使用 md5 的修改版本
当我运行 docker-compose build 时,一切似乎都按预期工作。
Step 5/7 : RUN rm -f /var/lib/postgresql/data/pg_hba.conf
---> Using cache
---> 20e82128335a
Step 6/7 : COPY ./postgresql/pg_hba.conf /var/lib/postgresql/data/pg_hba.conf
---> Using cache
---> cc41cb9267d8
Step 7/7 : CMD ["tail", "-F", "-n0", "/etc/hosts"]
---> Using cache
---> 9cb31d31a1a3
Successfully built 9cb31d31a1a3
Successfully …Run Code Online (Sandbox Code Playgroud) async-await ×1
cordova ×1
es6-promise ×1
heidisql ×1
javascript ×1
mariadb ×1
postgresql ×1
qml ×1
qt ×1
qtquick2 ×1
sql ×1
timezone ×1