首页 APP开发 正文

uniapp开发h5企业管理系统(uniapp做企业管理系统)

APP开发 1564
本篇文章给大家谈谈uniapp开发h5企业管理系统,以及uniapp做企业管理系统对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。 本文目录一览: 1、将 Hello uniCloud 发布H5到“前端网页托管”

本篇文章给大家谈谈uniapp开发h5企业管理系统,以及uniapp做企业管理系统对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

将 Hello uniCloud 发布H5到“前端网页托管”

1、用 Hbuilderx 创建一个项目:选:uniapp-Hello uniCloud;

2、关联阿里云服务空间,初始化服务空间;

3、发行-上传网站到服务器

4、打开 uniCloud Web 控制台,进行跨域设置

新增域名:

api.bspapp.com

static-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.bspapp.com

5、访问: 即可

实际应用:可以使用 uniapp 开发小程序作为前端,连接 uniCloud 云服务空间,获取数据;使用 uni-admin 开发后台管理程序(H5),发布到云服务空间的“前端网页托管”,就可以实现不用单独申请云主机,使用uniCloud云服务空间实现前后端系统的部署,而且云服务空间提供一定的免费流量,在开发测试阶段使用是完全没有问题的。

uni-app发布H5流程

首先在manifest.json文件中进行基础配置,获取uni-app的ID号,填写应用名称,应用描述,版本名称以及版本号。

然后在H5配置模块,填写页面标题等基础信息。

点击发行-》网站-PC Web 或手机H5-》填写网站标题,网站域名。

点击发布以后本地会生成一份打包文件,将打包文件上传至设置的网站,访问网站域名即可。

uniApp实现企业公众号oauth2静默授权登录H5前端部分

appid,服务器域名(域名下的资源文件要能访问,跟后端沟通,先放个html文件进去,比如: 能访问到)

企业H5应用工作台 可信域名配置 找管理员扫码登录 还有 应用主页配置

// 存

function setCookie(key, value) {

var initDate = new Date();

initDate.setTime(initDate.getTime() + 30 * 60 * 1000);

document.cookie = key + "=" + value + ";expires=" + initDate.toGMTString() + ";path=/";

}

// 取

function getCookie(key) {

if (document.cookie.length 0) {

var i = document.cookie.indexOf(key + "=")

if (i != -1) {

i = i + key.length + 1

var end = document.cookie.indexOf(";", i)

if (end == -1) end = document.cookie.length

return unescape(document.cookie.substring(i, end))

}

}

return undefined

}

//删

function removeCookie(key) {

var exp = new Date();

exp.setTime(exp.getTime() - 1);

var val = getCookie(key);

if (val != null) {

document.cookie = key + "=" + val + ";expires=" + exp.toGMTString();

}

}

export const Cookie = {

set: setCookie,

get: getCookie,

remove: removeCookie

}

import { Cookie } from "@/utils/cookie.js";

created() {

let local = 'http:xxxx.com/index.html'; // 这个是如果没有code需要配合微信重定向获取code的页面,也就是你后端放静态资源文件的路径,一定要可以访问到

if (!Cookie.get("weCode")) {

window.location.href =

"" +

'企业号的appid' +

"redirect_uri=" + encodeURIComponent(local) +

"response_type=codescope=snsapi_userinfowechat_redirect";

} else {

uni.reLaunch({

url: '/pages/index'

});

}

}

import { Cookie } from "@/utils/cookie.js"

onLaunch: function() {

this.getCode()

},

getCode() {

let weCode = this.getUrlParam("code"); //查看code是否存在

if (weCode) {

Cookie.set("weCode", weCode)

getUserInfo({   // 这个是请求接口把code 给后台,然后后台给你用户的一些信息 getUserInfo不要照抄 这是一个请求方法

code: weCode

}).then(res = {

if (res.data.code == 200) {

Cookie.set('userId', res.data.data)

}

})

}

},

//判断code信息是否存在

getUrlParam(name) {

var reg = new RegExp("(^|)" + name + "=([^]*)(|$)");

var r = window.location.search.substr(1).match(reg);

if (r != null) {

return unescape(r[2]);

}

return null;

}

{

"pages": [ 

{

"path": "pages/login/login",

"style": {

"navigationBarTitleText": "微信授权",

"navigationStyle": "custom",

"app-plus": {

"titleView": false,

"animationType": "none"

}

}

},{

"path": "pages/index",

"style": {

"navigationBarTitleText": "小测试首页",

"navigationStyle": "custom",

"app-plus": {

"titleView": false

}

}

}

],

"tabBar": {

"list": [{

"pagePath": "pages/index",

"iconPath": "static/tabIndexOff.png",

"selectedIconPath": "static/tabIndexOn.png",

"text": "首页"

}]

比如 你就写 baidu.com

比如: 端口  你就写  ms:xxx:7000 

记得看微信官方文档!!!

贴出你需要看的链接:

uniapp开发h5企业管理系统的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于uniapp做企业管理系统、uniapp开发h5企业管理系统的信息别忘了在本站进行查找喔。

扫码二维码