我正在开发一个IONIC应用程序,我已经检查过用户是否已经登录,如果用户已经登录,那么应用程序应该重定向到仪表板上.此功能运行良好,但应用程序首先显示登录页面几秒钟,然后重定向到仪表板.
app.js
$rootScope.$on("$locationChangeStart", function (event, next, current) {
var prefs = plugins.appPreferences;
prefs.fetch('iuserid').then(function (value) {
if (value != '') {
$state.go('app.dashboard');
}
});
.config(function ($stateProvider, $urlRouterProvider, $httpProvider) {
$stateProvider
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu.html",
controller: 'AppCtrl'
})
.state('login', {
url: "/login",
templateUrl: "templates/login.html",
controller: 'LoginCtrl'
})
.state('app.dashboard', {
url: "/dashboard",
views: {
'menuContent': {
templateUrl: "templates/dashboard.html",
controller: 'DashboardCtrl'
}
}
})
;
// if none of the above states are matched, use this as the …
Run Code Online (Sandbox Code Playgroud) 我被困在mysql中的一个查询中.
我想从表中获取最新评论
记录应该是这样的
表格结构为表格博客
blog_id int - primary (auto increment) blog_title -varchar blog_desc -varchar blog_image -varchar blog_tags -varchar tot_comments -int blog_creater -varchar blog_create_date -datetime blog_status -enum ('Enable','Disable')
表blog_comment的表结构
comment_id -int (auto increment) fk_blog_id -int comment -varchar comment_by -varchar email -varchar comment_date -datetime comment_status -enum ('Enable','Disable')
以下是我写的查询,但我得到的结果是错误的.
SELECT b.blog_title,b.blog_image, bc.*
FROM blog_comments bc, blog b
WHERE bc.comment_status='Enable'
AND b.blog_status='Enable'
AND b.blog_id=bc.fk_blog_id
GROUP BY bc.fk_blog_id
ORDER BY bc.comment_date DESC
LIMIT 0,3
Run Code Online (Sandbox Code Playgroud)
产量
我刚刚开始学习 React Native,想在页面中添加输入字段。我已经完成了本教程以添加输入字段。但是每当我运行 React App 时,它都会抛出以下错误。
./src/Inputs.js
Module not found: Can't resolve 'react-native' in 'E:\hybrid\reactDemo\src'
Run Code Online (Sandbox Code Playgroud)
我已经检查过 react-native node-modules 是否存在,然后我才知道 react-native 模块不存在。我安装它再次运行该应用程序,但它显示相同的错误。我已经为此花费了 8 多个小时,但无法解决此错误。我已经尝试了谷歌的所有解决方案,但没有一个对我有用。
注意: 我使用的是 Windows PC
更新 1:我正在导入 react-native,如下所示
import { View, Text, TouchableOpacity, TextInput, StyleSheet } from 'react-native'
Run Code Online (Sandbox Code Playgroud)
更新 2:
这是我的 package.json 文件
{
"name": "reactDemo",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-native": "^0.54.4",
"react-router": "^3.0.5",
"react-scripts": "1.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom", …
Run Code Online (Sandbox Code Playgroud) 我已经在我的 Ionic 3 应用程序中集成了谷歌地图,它运行良好,但一段时间后它停止工作。它给了我错误ERROR TypeError: Cannot read property 'constructor' of undefined
。
所以我已经卸载了 Ionic Native Google Maps 插件,并按照此处的建议再次安装。
但是当我安装它时,它给了我一个TypeError: Object(...) is not a function
关于 ionic native core的错误,它使我的应用程序崩溃。所以我再次将 ionic native core plugin 降级到4.18.0
(最新版本是 v. 5.10.0),应用程序再次开始工作,但我的谷歌地图仍然无法工作。
我的谷歌地图代码如下。
import {
GoogleMaps,
GoogleMap,
GoogleMapsEvent,
GoogleMapOptions,
CameraPosition,
MarkerOptions,
Marker,
Environment
} from "@ionic-native/google-maps";
export class MapPage {
map: GoogleMap;
constructor() {
}
ionViewDidLoad() {
this.loadMap();
}
loadMap() {
//https://github.com/ionic-team/ionic-native-google-maps/blob/master/documents/markeroptions/README.md'
// This code is necessary for browser
Environment.setEnv({
API_KEY_FOR_BROWSER_RELEASE: …
Run Code Online (Sandbox Code Playgroud) 我是 Strapi 框架的新手(今天开始自己学习),我的前端仅使用 Instagram 登录。因此无需删除http://localhost:1337/auth/local/register端点的电子邮件和密码验证 。
我已经从 .chache/admin/containers/AuthPage/forms.js 中删除了验证,但它没有受到影响。
我哪里出错了?我已经搜索了答案,但没有得到。