Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-id-pages-x
提交
7c6d5005
H
hello uni-id-pages-x
项目概览
DCloud
/
hello uni-id-pages-x
通知
43
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-id-pages-x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
7c6d5005
编写于
1月 24, 2024
作者:
雪洛
提交者:
Anne_LXM
1月 29, 2024
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 兼容uni-app-x web端
上级
00389755
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
17 addition
and
13 deletion
+17
-13
index.html
index.html
+1
-1
pages/index/index.uvue
pages/index/index.uvue
+3
-3
uni_modules/uni-id-pages-x/components/uni-id-pages-x-avatar/uni-id-pages-x-avatar.uvue
...mponents/uni-id-pages-x-avatar/uni-id-pages-x-avatar.uvue
+2
-2
uni_modules/uni-id-pages-x/init.uts
uni_modules/uni-id-pages-x/init.uts
+6
-4
uni_modules/uni-id-pages-x/lib/Univerify.uts
uni_modules/uni-id-pages-x/lib/Univerify.uts
+1
-1
uni_modules/uni-id-pages-x/lib/autoReportPushClientId.uts
uni_modules/uni-id-pages-x/lib/autoReportPushClientId.uts
+1
-1
uni_modules/uni-id-pages-x/pages/login/login.uvue
uni_modules/uni-id-pages-x/pages/login/login.uvue
+3
-1
未找到文件。
index.html
浏览文件 @
7c6d5005
...
...
@@ -15,6 +15,6 @@
</head>
<body>
<div
id=
"app"
>
<!--app-html-->
</div>
<script
type=
"module"
src=
"/main
.js
"
></script>
<script
type=
"module"
src=
"/main"
></script>
</body>
</html>
pages/index/index.uvue
浏览文件 @
7c6d5005
...
...
@@ -40,9 +40,9 @@
},
openName():string{
if(this.isLogin){
let nickname = userInfo.getString("nickname")
let username = userInfo.getString("username")
let mobile = userInfo.getString("mobile")
let nickname =
this.
userInfo.getString("nickname")
let username =
this.
userInfo.getString("username")
let mobile =
this.
userInfo.getString("mobile")
if(nickname == null){
nickname = "";
...
...
uni_modules/uni-id-pages-x/components/uni-id-pages-x-avatar/uni-id-pages-x-avatar.uvue
浏览文件 @
7c6d5005
...
...
@@ -26,7 +26,7 @@
</template>
<script>
import { state, mutations
, UserInfo, AvatarFile
} from '@/uni_modules/uni-id-pages-x/store.uts';
import { state, mutations } from '@/uni_modules/uni-id-pages-x/store.uts';
/**
* uni-id-pages-x-avatar
* @description 用户头像组件
...
...
@@ -67,7 +67,7 @@
},
computed: {
hasLogin() : boolean {
return state.isLogin as
B
oolean
return state.isLogin as
b
oolean
},
userInfo() : UTSJSONObject {
return state.userInfo
...
...
uni_modules/uni-id-pages-x/init.uts
浏览文件 @
7c6d5005
...
...
@@ -13,8 +13,10 @@ const uniIdCo = uniCloud.importObject('uni-id-co', {
// 用户配置的登录方式、是否打开调试模式
const loginTypes = config.getArray<string>('loginTypes');
const debug = config.getBoolean('debug') as boolean;
// #ifdef APP
import Univerify from '@/uni_modules/uni-id-pages-x/lib/Univerify.uts'
// #endif
export default async function () {
// 有打开调试模式的情况下
...
...
@@ -23,7 +25,7 @@ export default async function () {
// 调用云对象,获取服务端已正确配置的登录方式
uniIdCo.getSupportedLoginType().then(res=>{
// console.log('7777res',res)
let supportedLoginType = res.getArray
<string>
('supportedLoginType')
let supportedLoginType = res.getArray('supportedLoginType')
if(supportedLoginType == null){
supportedLoginType = []
}
...
...
@@ -59,7 +61,7 @@ export default async function () {
})
}
// #ifdef
uniVersion > 3.99 || uniVersion == 3.99
// #ifdef
APP
// 如果uni-id-pages配置的登录功能有一键登录,有则执行预登录(异步)
if (loginTypes != null && loginTypes.includes('univerify')) {
const myUniverify = new Univerify()
...
...
@@ -134,7 +136,7 @@ export default async function () {
// needLogin相关代码-start(此代码仅为版本兼容提示使用,如已知晓可删除)
const needLogin = config.getArray<string>('needLogin')
const uniCompileVersionCode = uni.getSystemInfoSync().
get('uniCompileVersionCode')
as number
const uniCompileVersionCode = uni.getSystemInfoSync().
uniCompileVersionCode
as number
if(needLogin != null && (uniCompileVersionCode > 3.99 || uniCompileVersionCode == 3.99) ){
const tipText = "uni-id-pages x v1.0.4+ 不再支持配置项config.needLogin,请升级HBuilderX 版本为3.99+,使用更强大 uni-id-router替代。详情查看:https://uniapp.dcloud.net.cn/uniCloud/uni-id/summary.html#uni-id-router"
console.error(tipText)
...
...
uni_modules/uni-id-pages-x/lib/Univerify.uts
浏览文件 @
7c6d5005
...
...
@@ -21,7 +21,7 @@ const loginTypes = config.getArray<string>('loginTypes');
// #endif
// #ifdef
uniVersion > 3.99 || uniVersion == 3.99
// #ifdef
APP && (uniVersion > 3.99 || uniVersion == 3.99)
const univerifyManager = uni.getUniverifyManager();
export default class Univerify {
...
...
uni_modules/uni-id-pages-x/lib/autoReportPushClientId.uts
浏览文件 @
7c6d5005
...
...
@@ -17,7 +17,7 @@ const reportPushClientId = () => {
fail(e) {
// console.log(e)
}
})
}
as GetPushClientIdOptions
)
}
export default reportPushClientId;
...
...
uni_modules/uni-id-pages-x/pages/login/login.uvue
浏览文件 @
7c6d5005
...
...
@@ -33,7 +33,9 @@
<script>
import { state } from '@/uni_modules/uni-id-pages-x/store.uts';
import config from '@/uni_modules/uni-id-pages-x/config.uts';
// #ifdef APP
import Univerify from '@/uni_modules/uni-id-pages-x/lib/Univerify.uts'
// #endif
export default {
computed: {
//大快捷登录按钮图
...
...
@@ -62,7 +64,7 @@
methods: {
login(){},
verify(){
// #ifdef
uniVersion > 3.99 || uniVersion == 3.99
// #ifdef
APP
const univerifyManager = new Univerify()
univerifyManager.verify(true)
// #endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录