|
固定字符串也是乱码了
var fs = api.require('fs');
fs.createFile({
path: 'fs://door/D1.txt'
}, function (ret, err) {
if (ret.status) {
var fs = api.require('fs');
fs.writeByLength({
path: 'fs://door/D1.txt',
content: '测试1234地址',
place: {
start: 0,
strategy: -1
}
}, function (ret, err) {
if (ret.status) {
api.toast({
msg: '設置成功',
duration: 2000,
location: 'bottom'
});
} else {
api.toast({
msg: '設置失敗',
duration: 2000,
location: 'bottom'
});
}
});
} else {
var fs = api.require('fs');
fs.writeByLength({
path: 'fs://door/D1.txt',
content: '测试1234地址',
place: {
start: 0,
strategy: -1
}
}, function (ret, err) {
if (ret.status) {
api.toast({
msg: '設置成功',
duration: 2000,
location: 'bottom'
});
} else {
api.toast({
msg: '設置失敗',
duration: 2000,
location: 'bottom'
});
}
});
}
}); |
|