diff --git a/changelog.md b/changelog.md
index d20d3e17141562e1b1decb7331d3196ac15ae021..a9b30ca1a154e90672becd22eab5a02a42747ab3 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,6 @@
+## 1.0.39(2021-07-19)
+1. 强制登陆配置,新增白名单模式
+2. 强制登陆配置,支持正则表达式
## 1.0.38(2021-07-17)
删除多余文件
## 1.0.37(2021-07-14)
diff --git a/common/appInit.js b/common/appInit.js
index e5b66a655c5d30e180d722d00b5416f1389eef3a..a896d02279f27cfb5330666c6a605e8f83d5f903 100644
--- a/common/appInit.js
+++ b/common/appInit.js
@@ -1,391 +1,435 @@
-import uniStarterConfig from '@/uni-starter.config.js';
-import store from '@/store'
-//应用初始化页
-// #ifdef APP-PLUS
-import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
-import callCheckVersion from '@/uni_modules/uni-upgrade-center-app/utils/call-check-version';
-import interceptorChooseImage from '@/uni_modules/json-interceptor-chooseImage/js_sdk/main.js';
-// #endif
-const db = uniCloud.database()
-export default async function() {
- let loginConfig = uniStarterConfig.router.login
-//清除有配置但设备环境不支持的登陆项
- // #ifdef APP-PLUS
- await new Promise((callBack)=>{
- plus.oauth.getServices(oauthServices => {
- loginConfig = loginConfig.filter(item=>{
- if(["univerify", "weixin", "apple"].includes(item)){
- let index = oauthServices.findIndex(e=>e.id==item)
- if(index==-1){
- return false
- }else{
- return oauthServices[index].nativeClient
+import uniStarterConfig from '@/uni-starter.config.js';
+import store from '@/store'
+//应用初始化页
+// #ifdef APP-PLUS
+import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
+import callCheckVersion from '@/uni_modules/uni-upgrade-center-app/utils/call-check-version';
+import interceptorChooseImage from '@/uni_modules/json-interceptor-chooseImage/js_sdk/main.js';
+// #endif
+const db = uniCloud.database()
+export default async function() {
+ let loginConfig = uniStarterConfig.router.login
+ //清除有配置但设备环境不支持的登陆项
+ // #ifdef APP-PLUS
+ await new Promise((callBack) => {
+ plus.oauth.getServices(oauthServices => {
+ loginConfig = loginConfig.filter(item => {
+ if (["univerify", "weixin", "apple"].includes(item)) {
+ let index = oauthServices.findIndex(e => e.id == item)
+ if (index == -1) {
+ return false
+ } else {
+ return oauthServices[index].nativeClient
+ }
+ } else {
+ return true
+ }
+ })
+ if (loginConfig.includes('univerify')) { //一键登录 功能预登录
+ uni.preLogin({
+ provider: 'univerify',
+ complete: e => {
+ console.log(e);
+ }
+ })
+ }
+ callBack()
+ }, err => {
+ console.error('获取服务供应商失败:' + JSON.stringify(err));
+ })
+ })
+ // #endif
+
+ //非app移除:一键登录、苹果登陆;h5移除微信登陆,如果你做微信公众号登陆需要将此行移除
+ // #ifndef APP-PLUS
+ loginConfig = loginConfig.filter(item => {
+ return ![
+ 'univerify',
+ 'apple',
+ // #ifdef H5
+ 'weixin'
+ // #endif
+ ].includes(item)
+ })
+ // #endif
+
+ uniStarterConfig.router.login = loginConfig
+
+ // uniStarterConfig挂载到getApp().globalData.config
+ setTimeout(() => {
+ getApp({
+ allowDefault: true
+ }).globalData.config = uniStarterConfig;
+ }, 1)
+
+
+ // 初始化appVersion(仅app生效)
+ initAppVersion();
+
+ // #ifdef APP-PLUS
+ // 实现,路由拦截。当应用无访问摄像头/相册权限,引导跳到设置界面
+ interceptorChooseImage()
+ // #endif
+
+
+ //clientDB的错误提示
+ function onDBError({
+ code, // 错误码详见https://uniapp.dcloud.net.cn/uniCloud/clientdb?id=returnvalue
+ message
+ }) {
+ console.log('onDBError');
+ // 处理错误
+ console.log(code, message);
+ if ([
+ 'TOKEN_INVALID_INVALID_CLIENTID',
+ 'TOKEN_INVALID',
+ 'TOKEN_INVALID_TOKEN_EXPIRED',
+ 'TOKEN_INVALID_WRONG_TOKEN',
+ 'TOKEN_INVALID_ANONYMOUS_USER',
+ ].includes(code)) {
+ uni.navigateTo({
+ url: '/pages/ucenter/login-page/index/index'
+ })
+ }
+ }
+ // 绑定clientDB错误事件
+ db.on('error', onDBError)
+
+ // 解绑clientDB错误事件
+ //db.off('error', onDBError)
+ db.on('refreshToken', function({
+ token,
+ tokenExpired
+ }) {
+ console.log('监听到clientDB的refreshToken', {
+ token,
+ tokenExpired
+ });
+ store.commit('user/login', {
+ token,
+ tokenExpired
+ })
+ })
+
+ const Debug = true;
+ //拦截器封装callFunction
+ let callFunctionOption;
+ uniCloud.addInterceptor('callFunction', {
+ async invoke(option) {
+ // #ifdef APP-PLUS
+ // 判断如果是执行登陆(无论是哪种登陆方式),就记录用户的相关设备id
+ if (option.name == 'uni-id-cf' && (option.data.action == 'register' || option.data.action.slice(0, 5) == 'login')) {
+ let oaid = await new Promise((callBack, fail) => {
+ if (uni.getSystemInfoSync().platform == "android") {
+ plus.device.getOAID({
+ success: function(e) {
+ callBack(e.oaid)
+ // console.log('getOAID success: '+JSON.stringify(e));
+ },
+ fail: function(e) {
+ callBack()
+ console.log('getOAID failed: ' + JSON.stringify(e));
+ }
+ });
+ } else {
+ callBack()
+ }
+ })
+
+ let imei = await new Promise((callBack, fail) => {
+ if (uni.getSystemInfoSync().platform == "android") {
+ plus.device.getInfo({
+ success: function(e) {
+ callBack(e.imei)
+ // console.log('getOAID success: '+JSON.stringify(e));
+ },
+ fail: function(e) {
+ callBack()
+ console.log('getOAID failed: ' + JSON.stringify(e));
+ }
+ });
+ } else {
+ callBack()
+ }
+ })
+
+ let push_clientid = '',
+ idfa = plus.storage.getItem('idfa') || ''; //idfa有需要的用户在应用首次启动时自己获取存储到storage中
+
+ try {
+ push_clientid = plus.push.getClientInfo().clientid
+ } catch (e) {
+ uni.showModal({
+ content: '获取推送标识失败。如果你的应用不需要推送功能,请注释掉本代码块',
+ showCancel: false,
+ confirmText: "好的"
+ });
+ console.log(e)
+ }
+
+ let deviceInfo = {
+ push_clientid, // 获取匿名设备标识符
+ imei,
+ oaid,
+ idfa
+ }
+ console.log("重新登陆/注册,获取设备id", deviceInfo);
+ option.data.deviceInfo = deviceInfo
+
+ // #ifndef H5
+ //注册可能不仅仅走register接口,还有登陆并注册的接口
+ option.data.inviteCode = await new Promise((callBack) => {
+ uni.getClipboardData({
+ success: function(res) {
+ if (res.data.slice(0, 18) == 'uniInvitationCode:') {
+ let uniInvitationCode = res.data.slice(18, 38)
+ console.log('当前用户是其他用户推荐下载的,推荐者的code是:' +
+ uniInvitationCode);
+ // uni.showModal({
+ // content: '当前用户是其他用户推荐下载的,推荐者的code是:'+uniInvitationCode,
+ // showCancel: false
+ // });
+ callBack(uniInvitationCode)
+ //当前用户是其他用户推荐下载的。这里登记他的推荐者id 为当前用户的myInviteCode。判断如果是注册
+ } else {
+ callBack(false)
+ }
+ },
+ fail() {
+ callBack(false)
+ }
+ });
+ })
+ // #endif
+ }
+ // #endif
+ // console.log(JSON.stringify(option));
+ callFunctionOption = option
+ },
+ complete(e) {
+ // console.log(JSON.stringify(e));
+ },
+ fail(e) { // 失败回调拦截
+ if (Debug) {
+ uni.showModal({
+ content: JSON.stringify(e),
+ showCancel: false
+ });
+ console.error(e);
+ } else {
+ uni.showModal({
+ content: "系统错误请稍后再试!",
+ showCancel: false,
+ confirmText: "知道了"
+ });
+ }
+ //如果执行错误,检查是否断网
+ uni.getNetworkType({
+ complete: res => {
+ // console.log(res);
+ if (res.networkType == 'none') {
+ uni.showToast({
+ title: '手机网络异常',
+ icon: 'none'
+ });
+ console.log('手机网络异常');
+ let callBack = res => {
+ console.log(res);
+ if (res.isConnected) {
+ uni.showToast({
+ title: '恢复联网自动重新执行',
+ icon: 'none'
+ });
+ console.log(res.networkType, "恢复联网自动重新执行");
+ uni.offNetworkStatusChange(e => {
+ console.log("移除监听成功", e);
+ })
+ //恢复联网自动重新执行
+ uniCloud.callFunction(callFunctionOption)
+ uni.offNetworkStatusChange(callBack);
+ }
+ }
+ uni.onNetworkStatusChange(callBack);
+ }
+ }
+ });
+ },
+ success: (e) => {
+ console.log(e);
+ const {
+ token,
+ tokenExpired
+ } = e.result
+ if (token && tokenExpired) {
+ store.commit('user/login', {
+ token,
+ tokenExpired
+ })
+ }
+ switch (e.result.code) {
+ case 403:
+ uni.navigateTo({
+ url: "/pages/ucenter/login-page/index/index"
+ })
+ break;
+ case 30203:
+ uni.navigateTo({
+ url: "/pages/ucenter/login-page/index/index"
+ })
+ break;
+ case 50101:
+ uni.showToast({
+ title: e.result.msg,
+ icon: 'none',
+ duration: 2000
+ });
+ break;
+ default:
+ console.log('code的值是:' + e.result.code, '可以在这里插入,自动处理响应体');
+ break;
+ }
+ }
+ })
+
+ //自定义路由拦截
+ const {
+ "router": {
+ needLogin,
+ visitor,
+ login
+ }
+ } = uniStarterConfig //需要登录的页面
+ let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
+ list.forEach(item => { //用遍历的方式分别为,uni.navigateTo,uni.redirectTo,uni.reLaunch,uni.switchTab这4个路由方法添加拦截器
+ uni.addInterceptor(item, {
+ invoke(e) { // 调用前拦截
+ // console.log(e);
+ //获取用户的token
+ const token = uni.getStorageSync('uni_id_token'),
+ //token是否已失效
+ tokenExpired = uni.getStorageSync('uni_id_token_expired') < Date.now(),
+ //获取要跳转的页面路径(url去掉"?"和"?"后的参数)
+ url = e.url.split('?')[0],
+ //获取要前往的页面路径(即url去掉"?"和"?"后的参数)
+ pages = getCurrentPages(),
+ fromUrl = pages[pages.length - 1].route;
+
+
+ let inLoginPage = fromUrl.split('/')[2] == 'login-page'
+
+ //控制登录优先级
+ if ( //判断当前窗口是否为登陆页面,如果是则不重定向路由
+ url == '/pages/ucenter/login-page/index/index' &&
+ !inLoginPage
+ ) {
+ // console.log(9527777,login);
+ //一键登录(univerify)、账号(username)、验证码登录(短信smsCode)
+ if (login[0] == 'username') {
+ e.url = "/pages/ucenter/login-page/pwd-login/pwd-login"
+ } else {
+ if (e.url == url) {
+ e.url += '?'
+ } //添加参数之前判断是否带了`?`号如果没有就补上,因为当开发场景本身有参数的情况下是已经带了`?`号
+ e.url += "type=" + login[0]
}
- }else{
- return true
- }
- })
- if(loginConfig.includes('univerify')){ //一键登录 功能预登录
- uni.preLogin({
- provider:'univerify',
- complete: e => {
- console.log(e);
- }
- })
- }
- callBack()
- }, err => {
- console.error('获取服务供应商失败:' + JSON.stringify(err));
- })
- })
- // #endif
-
- //非app移除:一键登录、苹果登陆;h5移除微信登陆,如果你做微信公众号登陆需要将此行移除
- // #ifndef APP-PLUS
- loginConfig = loginConfig.filter(item=>{
- return ![
- 'univerify',
- 'apple',
- // #ifdef H5
- 'weixin'
- // #endif
- ].includes(item)
- })
- // #endif
-
- uniStarterConfig.router.login = loginConfig
-
- // uniStarterConfig挂载到getApp().globalData.config
- setTimeout(()=>{
- getApp({allowDefault: true}).globalData.config = uniStarterConfig;
- },1)
-
-
- // 初始化appVersion(仅app生效)
- initAppVersion();
-
- // #ifdef APP-PLUS
- // 实现,路由拦截。当应用无访问摄像头/相册权限,引导跳到设置界面
- interceptorChooseImage()
- // #endif
-
-
- //clientDB的错误提示
- function onDBError({
- code, // 错误码详见https://uniapp.dcloud.net.cn/uniCloud/clientdb?id=returnvalue
- message
- }) {
- console.log('onDBError');
- // 处理错误
- console.log(code,message);
- if([
- 'TOKEN_INVALID_INVALID_CLIENTID',
- 'TOKEN_INVALID',
- 'TOKEN_INVALID_TOKEN_EXPIRED',
- 'TOKEN_INVALID_WRONG_TOKEN',
- 'TOKEN_INVALID_ANONYMOUS_USER',
- ].includes(code)){
- uni.navigateTo({
- url:'/pages/ucenter/login-page/index/index'
- })
- }
- }
- // 绑定clientDB错误事件
- db.on('error', onDBError)
-
- // 解绑clientDB错误事件
- //db.off('error', onDBError)
- db.on('refreshToken', function({
- token,
- tokenExpired
- }) {
- console.log('监听到clientDB的refreshToken',{token,tokenExpired});
- store.commit('user/login', {
- token,
- tokenExpired
- })
- })
-
- const Debug = true;
- //拦截器封装callFunction
- let callFunctionOption;
- uniCloud.addInterceptor('callFunction',{
- async invoke(option){
- // #ifdef APP-PLUS
- // 判断如果是执行登陆(无论是哪种登陆方式),就记录用户的相关设备id
- if(option.name == 'uni-id-cf'&&(option.data.action == 'register' || option.data.action.slice(0,5) =='login')){
- let oaid = await new Promise((callBack,fail)=>{
- if (uni.getSystemInfoSync().platform == "android") {
- plus.device.getOAID({
- success:function(e){
- callBack(e.oaid)
- // console.log('getOAID success: '+JSON.stringify(e));
- },
- fail:function(e){
- callBack()
- console.log('getOAID failed: '+JSON.stringify(e));
- }
- });
- }else{
- callBack()
- }
- })
-
- let imei = await new Promise((callBack,fail)=>{
- if (uni.getSystemInfoSync().platform == "android") {
- plus.device.getInfo({
- success:function(e){
- callBack(e.imei)
- // console.log('getOAID success: '+JSON.stringify(e));
- },
- fail:function(e){
- callBack()
- console.log('getOAID failed: '+JSON.stringify(e));
- }
- });
- }else{
- callBack()
- }
- })
-
- let push_clientid = '',
- idfa = plus.storage.getItem('idfa')||'';//idfa有需要的用户在应用首次启动时自己获取存储到storage中
-
- try{
- push_clientid = plus.push.getClientInfo().clientid
- }catch(e){
- uni.showModal({
- content: '获取推送标识失败。如果你的应用不需要推送功能,请注释掉本代码块',
- showCancel: false,
- confirmText:"好的"
- });
- console.log(e)
- }
-
- let deviceInfo = {
- push_clientid,// 获取匿名设备标识符
- imei,oaid,idfa
- }
- console.log("重新登陆/注册,获取设备id",deviceInfo);
- option.data.deviceInfo = deviceInfo
-
- // #ifndef H5
- //注册可能不仅仅走register接口,还有登陆并注册的接口
- option.data.inviteCode = await new Promise((callBack)=>{
- uni.getClipboardData({
- success: function (res) {
- if(res.data.slice(0,18) =='uniInvitationCode:'){
- let uniInvitationCode = res.data.slice(18,38)
- console.log('当前用户是其他用户推荐下载的,推荐者的code是:'+uniInvitationCode);
- // uni.showModal({
- // content: '当前用户是其他用户推荐下载的,推荐者的code是:'+uniInvitationCode,
- // showCancel: false
- // });
- callBack(uniInvitationCode)
- //当前用户是其他用户推荐下载的。这里登记他的推荐者id 为当前用户的myInviteCode。判断如果是注册
- }else{
- callBack(false)
- }
- },
- fail() {
- callBack(false)
- }
- });
+ } else {
+ //拦截强制登录页面
+ let pass = true
+ //pattern
+ if (needLogin) {
+ pass = needLogin.every((item) => {
+ if (item.slice(0, 8) == 'pattern:') {
+ return !eval(item.slice(8, item.length)).test(url)
+ }
+ return url != item
})
- // #endif
- }
- // #endif
- // console.log(JSON.stringify(option));
- callFunctionOption = option
- },
- complete(e){
- // console.log(JSON.stringify(e));
- },
- fail(e) { // 失败回调拦截
- if(Debug){
- uni.showModal({
- content:JSON.stringify(e),
- showCancel: false
- });
- console.error(e);
- }else{
- uni.showModal({
- content: "系统错误请稍后再试!",
- showCancel: false,
- confirmText:"知道了"
- });
- }
- //如果执行错误,检查是否断网
- uni.getNetworkType({
- complete:res => {
- // console.log(res);
- if (res.networkType == 'none') {
- uni.showToast({
- title: '手机网络异常',
- icon: 'none'
- });
- console.log('手机网络异常');
- let callBack = res=>{
- console.log(res);
- if (res.isConnected) {
- uni.showToast({
- title: '恢复联网自动重新执行',
- icon: 'none'
- });
- console.log(res.networkType,"恢复联网自动重新执行");
- uni.offNetworkStatusChange(e=>{
- console.log("移除监听成功",e);
- })
- //恢复联网自动重新执行
- uniCloud.callFunction(callFunctionOption)
- uni.offNetworkStatusChange(callBack);
- }
- }
- uni.onNetworkStatusChange(callBack);
- }
- }
- });
- },
- success:(e)=>{
- console.log(e);
- const {token,tokenExpired} = e.result
- if (token && tokenExpired) {
- store.commit('user/login', {
- token,
- tokenExpired
- })
- }
- switch (e.result.code){
- case 403:
- uni.navigateTo({
- url: "/pages/ucenter/login-page/index/index"
- })
- break;
- case 30203:
- uni.navigateTo({
- url: "/pages/ucenter/login-page/index/index"
- })
- break;
- case 50101:
- uni.showToast({
- title: e.result.msg,
- icon: 'none',
- duration:2000
- });
- break;
- default:
- console.log('code的值是:'+e.result.code,'可以在这里插入,自动处理响应体');
- break;
- }
- }
- })
-
- //自定义路由拦截
- const {"router": {needLogin,login} } = uniStarterConfig //需要登录的页面
- let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
- list.forEach(item => { //用遍历的方式分别为,uni.navigateTo,uni.redirectTo,uni.reLaunch,uni.switchTab这4个路由方法添加拦截器
- uni.addInterceptor(item, {
- invoke(e) { // 调用前拦截
- // console.log(e);
- //获取用户的token
- const token = uni.getStorageSync('uni_id_token')
- //token是否已失效
- const tokenExpired = uni.getStorageSync('uni_id_token_expired') < Date.now()
- //获取当前页面路径(即url去掉"?"和"?"后的参数)
- const url = e.url.split('?')[0]
- //控制登录优先级
- let pages = getCurrentPages();
- if ( //判断当前窗口是否为登陆页面,如果是则不重定向路由
- url == '/pages/ucenter/login-page/index/index'
- &&
- pages[pages.length - 1].route.split('/')[2]!='login-page'
- ) {
-
- console.log(9527777,login);
-
- //一键登录(univerify)、账号(username)、验证码登录(短信smsCode)
- if (login[0] == 'username') {
- e.url = "/pages/ucenter/login-page/pwd-login/pwd-login"
- }else{
- if(e.url == url) { e.url += '?' } //添加参数之前判断是否带了`?`号如果没有就补上,因为当开发场景本身有参数的情况下是已经带了`?`号
- e.url += "type="+login[0]
- }
- }else{
- //拦截强制登录页面
- if (needLogin.includes(url) && (token == ''||tokenExpired)) {
- uni.showToast({
- title: '请先登录',
- icon: 'none'
- })
- uni.navigateTo({
- url: "/pages/ucenter/login-page/index/index"
+ // console.log(pass)
+ }
+ if (visitor&&!inLoginPage) {
+ pass = visitor.some((item) => {
+ if (item.slice(0, 8) == 'pattern:') {
+ return eval(item.slice(8, item.length)).test(url)
+ }
+ return url == item
})
- return false
- }
- }
- },
- fail(err) { // 失败回调拦截
- console.log(err);
- if(Debug){
- console.log(err);
- uni.showModal({
- content: JSON.stringify(err),
- showCancel: false
- });
- }
- },
- })
- })
-// #ifdef APP-PLUS
-// 监听并提示设备网络状态变化
- uni.onNetworkStatusChange(res=> {
- console.log(res.isConnected);
- console.log(res.networkType);
- if(res.networkType!='none'){
- uni.showToast({
- title:'当前网络类型:'+res.networkType,
- icon:'none',
- duration:3000
- })
- }else{
- uni.showToast({
- title:'网络类型:'+res.networkType,
- icon:'none',
- duration:3000
- })
- }
- });
-// #endif
-
+ console.log(pass)
+ }
+
+ if (!pass && (token == '' || tokenExpired)) {
+ uni.showToast({
+ title: '请先登录',
+ icon: 'none'
+ })
+ uni.navigateTo({
+ url: "/pages/ucenter/login-page/index/index"
+ })
+ return false
+ }
+ }
+ return e
+ },
+ fail(err) { // 失败回调拦截
+ console.log(err);
+ if (Debug) {
+ console.log(err);
+ uni.showModal({
+ content: JSON.stringify(err),
+ showCancel: false
+ });
+ }
+ }
+ })
+ })
+ // #ifdef APP-PLUS
+ // 监听并提示设备网络状态变化
+ uni.onNetworkStatusChange(res => {
+ console.log(res.isConnected);
+ console.log(res.networkType);
+ if (res.networkType != 'none') {
+ uni.showToast({
+ title: '当前网络类型:' + res.networkType,
+ icon: 'none',
+ duration: 3000
+ })
+ } else {
+ uni.showToast({
+ title: '网络类型:' + res.networkType,
+ icon: 'none',
+ duration: 3000
+ })
+ }
+ });
+ // #endif
+
+}
+/**
+ * // 初始化appVersion
+ */
+function initAppVersion() {
+ // #ifdef APP-PLUS
+ let appid = plus.runtime.appid;
+ plus.runtime.getProperty(appid, (wgtInfo) => {
+ let appVersion = plus.runtime;
+ let currentVersion = appVersion.versionCode > wgtInfo.versionCode ? appVersion : wgtInfo;
+ getApp({
+ allowDefault: true
+ }).appVersion = {
+ ...currentVersion,
+ appid,
+ hasNew: false
+ }
+ // 检查更新小红点
+ callCheckVersion().then(res => {
+ // console.log('检查是否有可以更新的版本', res);
+ if (res.result.code > 0) {
+ // 有新版本
+ getApp({
+ allowDefault: true
+ }).appVersion.hasNew = true;
+ }
+ })
+ });
+ // 检查更新
+ checkUpdate();
+ // #endif
}
-/**
- * // 初始化appVersion
- */
-function initAppVersion() {
- // #ifdef APP-PLUS
- let appid = plus.runtime.appid;
- plus.runtime.getProperty(appid, (wgtInfo) => {
- let appVersion = plus.runtime;
- let currentVersion = appVersion.versionCode > wgtInfo.versionCode ? appVersion : wgtInfo;
- getApp({
- allowDefault: true
- }).appVersion = {
- ...currentVersion,
- appid,
- hasNew: false
- }
- // 检查更新小红点
- callCheckVersion().then(res => {
- // console.log('检查是否有可以更新的版本', res);
- if (res.result.code > 0) {
- // 有新版本
- getApp({
- allowDefault: true
- }).appVersion.hasNew = true;
- }
- })
- });
- // 检查更新
- checkUpdate();
- // #endif
-}
\ No newline at end of file
diff --git a/manifest.json b/manifest.json
index 690f7a60b53ddf243711c1002f7a25903ef6edda..d16274cb086e53880d333da2e4f05c47a6c7baae 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,119 +1,137 @@
{
- "name" : "uni-starter",
- "appid" : "__UNI__03B096E",
- "description" : "云端一体应用快速开发模版",
- "versionName" : "1.0.0",
- "versionCode" : "100",
- "transformPx" : false,
- "app-plus" : {
- "privacy" : {
- "prompt" : "template",
- "template" : {
- "title" : "服务协议和隐私政策",
- "message" : " 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。
你可阅读《服务协议》和《隐私政策》了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
- "buttonAccept" : "同意",
- "buttonRefuse" : "暂不同意"
- }
- },
- "compatible" : {
- "ignoreVersion" : true
+ "name": "uni-starter",
+ "appid": "请点击重新获取",
+ "description": "云端一体应用快速开发模版",
+ "versionName": "1.0.0",
+ "versionCode": "100",
+ "transformPx": false,
+ "app-plus": {
+ "privacy": {
+ "prompt": "template",
+ "template": {
+ "title": "服务协议和隐私政策",
+ "message": " 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。
你可阅读《服务协议》和《隐私政策》了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
+ "buttonAccept": "同意",
+ "buttonRefuse": "暂不同意"
+ }
+ },
+ "compatible": {
+ "ignoreVersion": true
+ },
+ "usingComponents": true,
+ "nvueStyleCompiler": "uni-app",
+ "compilerVersion": 3,
+ "splashscreen": {
+ "alwaysShowBeforeRender": true,
+ "waiting": true,
+ "autoclose": true,
+ "delay": 0
+ },
+ "modules": {
+ "Fingerprint": {
+ },
+ "Share": {
+ },
+ "OAuth": {
+ },
+ "FaceID": {
+ },
+ "Push": {
+ }
+ },
+ "distribute": {
+ "android": {
+ "permissions": [
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ],
+ "abiFilters": [
+ "armeabi-v7a",
+ "arm64-v8a",
+ "x86"
+ ]
+ },
+ "ios": {
+ "capabilities": {
+ "entitlements": {
+ "com.apple.developer.associated-domains": [
+ "applinks:static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com"
+ ]
+ }
+ }
+ },
+ "sdkConfigs": {
+ "oauth": {
+ "apple": {
+ },
+ "weixin": {
+ "appid": "wxffdd8fa6ec4ef2a0",
+ "appsecret": "",
+ "UniversalLinks": "https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com/uni-universallinks/__UNI__03B096E"
+ },
+ "univerify": {
+ }
},
- "usingComponents" : true,
- "nvueStyleCompiler" : "uni-app",
- "compilerVersion" : 3,
- "splashscreen" : {
- "alwaysShowBeforeRender" : true,
- "waiting" : true,
- "autoclose" : true,
- "delay" : 0
+ "ad": {
},
- "modules" : {
- "Fingerprint" : {},
- "Share" : {},
- "OAuth" : {},
- "FaceID" : {},
- "Push" : {}
+ "share": {
+ "weixin": {
+ "appid": "wxffdd8fa6ec4ef2a0",
+ "UniversalLinks": "https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com/uni-universallinks/__UNI__03B096E"
+ }
},
- "distribute" : {
- "android" : {
- "permissions" : [
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- ""
- ],
- "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
- },
- "ios" : {
- "capabilities" : {
- "entitlements" : {
- "com.apple.developer.associated-domains" : [ "applinks:static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com" ]
- }
- }
- },
- "sdkConfigs" : {
- "oauth" : {
- "apple" : {},
- "weixin" : {
- "appid" : "wxffdd8fa6ec4ef2a0",
- "appsecret" : "",
- "UniversalLinks" : "https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com/uni-universallinks/__UNI__03B096E"
- },
- "univerify" : {}
- },
- "ad" : {},
- "share" : {
- "weixin" : {
- "appid" : "wxffdd8fa6ec4ef2a0",
- "UniversalLinks" : "https://static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com/uni-universallinks/__UNI__03B096E"
- }
- },
- "geolocation" : {},
- "push" : {
- "unipush" : {}
- },
- "payment" : {}
- }
+ "geolocation": {
},
- "nvueLaunchMode" : ""
- },
- "quickapp" : {},
- "mp-weixin" : {
- "appid" : "wx81dbb061d2258234",
- "setting" : {
- "urlCheck" : false,
- "es6" : false
+ "push": {
+ "unipush": {
+ }
},
- "usingComponents" : true,
- "betterScopedSlots" : true
- },
- "mp-alipay" : {
- "usingComponents" : true
- },
- "mp-baidu" : {
- "usingComponents" : true
- },
- "mp-toutiao" : {
- "usingComponents" : true
- },
- "uniStatistics" : {
- "enable" : false
+ "payment": {
+ }
+ }
},
- "h5" : {
- "template" : ""
+ "nvueLaunchMode": ""
+ },
+ "quickapp": {
+ },
+ "mp-weixin": {
+ "appid": "",
+ "setting": {
+ "urlCheck": false,
+ "es6": false
},
- "_spaceID" : "76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e"
-}
+ "usingComponents": true,
+ "betterScopedSlots": true
+ },
+ "mp-alipay": {
+ "usingComponents": true
+ },
+ "mp-baidu": {
+ "usingComponents": true
+ },
+ "mp-toutiao": {
+ "usingComponents": true
+ },
+ "uniStatistics": {
+ "enable": false
+ },
+ "h5": {
+ "template": ""
+ },
+ "_spaceID": "76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e"
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index 51979dafb25348ad69e7dda43fecf726120472f0..2fcb64ba7cab2299c5612170d66e7a312864fdc8 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-starter",
"displayName": "uni-starter",
- "version": "1.0.38",
+ "version": "1.0.39",
"description": "云端一体应用快速开发基本项目模版",
"keywords": [
"uni-starter",
diff --git a/pages/grid/grid.vue b/pages/grid/grid.vue
index 145465b22b50a8b5a3e8b0adc606e9d82a4b0064..346d1bef50add8f7d04384f9ba879ec039461d3f 100644
--- a/pages/grid/grid.vue
+++ b/pages/grid/grid.vue
@@ -1,11 +1,9 @@
-
-
-
+