优化ai对话页面
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -22,6 +22,8 @@ class CKApp : Application() {
|
||||
|
||||
var activitys = mutableListOf<TTBaseActivity>()
|
||||
lateinit var token : String
|
||||
var isUserLoggedIn: Boolean = false
|
||||
private set
|
||||
var wxJump = 0
|
||||
var userInfo : UserInfoModel? = null
|
||||
companion object {
|
||||
@@ -33,7 +35,8 @@ class CKApp : Application() {
|
||||
super.onCreate()
|
||||
app = this
|
||||
|
||||
token = PreferencesUtils.getString(this, Const.TOKEN,"").toString()
|
||||
token = PreferencesUtils.getString(this, Const.TOKEN, "").orEmpty()
|
||||
isUserLoggedIn = token.isNotBlank()
|
||||
var userData = PreferencesUtils.getString(this, Const.USER_DATA,"").toString()
|
||||
if (!TextUtils.isEmpty(userData)){
|
||||
userInfo = Gson().fromJson<UserInfoModel>(userData, UserInfoModel::class.java)
|
||||
@@ -62,5 +65,22 @@ class CKApp : Application() {
|
||||
TTLog.isLogEable(true)
|
||||
}
|
||||
|
||||
fun setLoginToken(value: String) {
|
||||
token = value
|
||||
isUserLoggedIn = value.isNotBlank()
|
||||
PreferencesUtils.putString(this, Const.TOKEN, value)
|
||||
if (isUserLoggedIn) {
|
||||
PreferencesUtils.putBoolean(this, Const.FIRST, false)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
fun clearLoginState() {
|
||||
token = ""
|
||||
userInfo = null
|
||||
isUserLoggedIn = false
|
||||
PreferencesUtils.putString(this, Const.TOKEN, "")
|
||||
PreferencesUtils.putString(this, Const.USER_DATA, "")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ck.ckcollar.app.ui.act.customer
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
@@ -173,7 +174,10 @@ class MineCustomerActivity : CKBaseActivity() {
|
||||
|
||||
binding.conetnt1.setOnClickListener {
|
||||
if (TextUtils.isEmpty(path)) {
|
||||
takePhoto()
|
||||
getPermissionRequst(
|
||||
Manifest.permission.CAMERA,
|
||||
REQUEST_CAMERA_PERMISSION
|
||||
)
|
||||
} else {
|
||||
toast(getString(R.string.only_one_photo))
|
||||
}
|
||||
@@ -181,12 +185,15 @@ class MineCustomerActivity : CKBaseActivity() {
|
||||
}
|
||||
binding.conetnt2.setOnClickListener {
|
||||
if (TextUtils.isEmpty(path)) {
|
||||
//相册
|
||||
val i = Intent(
|
||||
Intent.ACTION_PICK,
|
||||
MediaStore.Images.Media.EXTERNAL_CONTENT_URI
|
||||
val permission = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
Manifest.permission.READ_MEDIA_IMAGES
|
||||
} else {
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
}
|
||||
getPermissionRequst(
|
||||
permission,
|
||||
REQUEST_PHOTO_PERMISSION
|
||||
)
|
||||
startActivityForResult(i, 56)
|
||||
} else {
|
||||
toast(getString(R.string.only_one_photo))
|
||||
}
|
||||
@@ -195,6 +202,23 @@ class MineCustomerActivity : CKBaseActivity() {
|
||||
|
||||
}
|
||||
|
||||
override fun onPermissionsGranted(requestCode: Int, permissions: Array<String>) {
|
||||
when (requestCode) {
|
||||
REQUEST_CAMERA_PERMISSION -> takePhoto()
|
||||
REQUEST_PHOTO_PERMISSION -> openPhotoAlbum()
|
||||
}
|
||||
}
|
||||
|
||||
private fun openPhotoAlbum() {
|
||||
val intent = Intent(
|
||||
Intent.ACTION_PICK,
|
||||
MediaStore.Images.Media.EXTERNAL_CONTENT_URI
|
||||
).apply {
|
||||
setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*")
|
||||
}
|
||||
startActivityForResult(intent, 56)
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
|
||||
//getList()
|
||||
@@ -476,6 +500,11 @@ class MineCustomerActivity : CKBaseActivity() {
|
||||
startActivityForResult(openCameraIntent, 55)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val REQUEST_CAMERA_PERMISSION = 1201
|
||||
private const val REQUEST_PHOTO_PERMISSION = 1202
|
||||
}
|
||||
|
||||
class CustomerMessageAdapter(
|
||||
var context: Context,
|
||||
var data: List<CustomerMessageModel.MessageItemModel>,
|
||||
@@ -556,4 +585,4 @@ class MineCustomerActivity : CKBaseActivity() {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ck.ckcollar.app.ui.act.customer
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Rect
|
||||
@@ -211,16 +212,10 @@ class PeopleCustomerActivity : CKBaseActivity() {
|
||||
|
||||
binding.conetnt1.setOnClickListener {
|
||||
if (TextUtils.isEmpty(path)) {
|
||||
if (!checkCameraPermissions()){
|
||||
CKAlertDialog(this@PeopleCustomerActivity,getString(R.string.alert),getString(R.string.camera_alert),object : CKAlertDialog.AlertClickListener{
|
||||
override fun onBack(isConfirm: Boolean) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
}).show()
|
||||
return@setOnClickListener
|
||||
}
|
||||
takePhoto()
|
||||
getPermissionRequst(
|
||||
Manifest.permission.CAMERA,
|
||||
REQUEST_CAMERA_PERMISSION
|
||||
)
|
||||
} else {
|
||||
toast(getString(R.string.only_one_photo))
|
||||
}
|
||||
@@ -228,12 +223,15 @@ class PeopleCustomerActivity : CKBaseActivity() {
|
||||
}
|
||||
binding.conetnt2.setOnClickListener {
|
||||
if (TextUtils.isEmpty(path)) {
|
||||
//相册
|
||||
val i = Intent(
|
||||
Intent.ACTION_PICK,
|
||||
MediaStore.Images.Media.EXTERNAL_CONTENT_URI
|
||||
val permission = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
Manifest.permission.READ_MEDIA_IMAGES
|
||||
} else {
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
}
|
||||
getPermissionRequst(
|
||||
permission,
|
||||
REQUEST_PHOTO_PERMISSION
|
||||
)
|
||||
startActivityForResult(i, 56)
|
||||
} else {
|
||||
toast(getString(R.string.only_one_photo))
|
||||
}
|
||||
@@ -243,6 +241,23 @@ class PeopleCustomerActivity : CKBaseActivity() {
|
||||
|
||||
}
|
||||
|
||||
override fun onPermissionsGranted(requestCode: Int, permissions: Array<String>) {
|
||||
when (requestCode) {
|
||||
REQUEST_CAMERA_PERMISSION -> takePhoto()
|
||||
REQUEST_PHOTO_PERMISSION -> openPhotoAlbum()
|
||||
}
|
||||
}
|
||||
|
||||
private fun openPhotoAlbum() {
|
||||
val intent = Intent(
|
||||
Intent.ACTION_PICK,
|
||||
MediaStore.Images.Media.EXTERNAL_CONTENT_URI
|
||||
).apply {
|
||||
setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*")
|
||||
}
|
||||
startActivityForResult(intent, 56)
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
|
||||
|
||||
@@ -607,6 +622,11 @@ class PeopleCustomerActivity : CKBaseActivity() {
|
||||
startActivityForResult(openCameraIntent, 55)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val REQUEST_CAMERA_PERMISSION = 1301
|
||||
private const val REQUEST_PHOTO_PERMISSION = 1302
|
||||
}
|
||||
|
||||
class CustomerMessageAdapter(
|
||||
var context: TTBaseActivity,
|
||||
var data: List<CustomerMessageModel.MessageItemModel>,
|
||||
@@ -733,4 +753,4 @@ class PeopleCustomerActivity : CKBaseActivity() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,12 @@ package com.ck.ckcollar.app.ui.act.home
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.SystemClock
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.WindowInsets
|
||||
import android.widget.TextView
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
|
||||
import com.ck.ckcollar.app.R
|
||||
@@ -35,6 +37,8 @@ import com.tt.kit.utils.TTUtils
|
||||
|
||||
|
||||
class MainActivity : CKLHBaseActivity(),View.OnClickListener {
|
||||
private var lastBackPressedAt = 0L
|
||||
|
||||
lateinit var mainBinding: ActivityMainBinding
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
@@ -43,6 +47,18 @@ class MainActivity : CKLHBaseActivity(),View.OnClickListener {
|
||||
setContentView(mainBinding.root)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
|
||||
override fun handleOnBackPressed() {
|
||||
val now = SystemClock.elapsedRealtime()
|
||||
if (lastBackPressedAt != 0L && now - lastBackPressedAt <= EXIT_INTERVAL_MS) {
|
||||
finish()
|
||||
} else {
|
||||
lastBackPressedAt = now
|
||||
toast(getString(R.string.press_again_to_exit))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// if (Build.VERSION.SDK_INT >= 36){
|
||||
//
|
||||
@@ -192,4 +208,8 @@ class MainActivity : CKLHBaseActivity(),View.OnClickListener {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val EXIT_INTERVAL_MS = 2_000L
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,11 +91,7 @@ class BoundPhoneActivity : CKBaseActivity() {
|
||||
override fun onSuccess(data: String) {
|
||||
|
||||
var token = JSONObject(data).getString("token")
|
||||
PreferencesUtils.putString(
|
||||
this@BoundPhoneActivity,
|
||||
Const.TOKEN, token
|
||||
)
|
||||
CKApp.app.token = token
|
||||
CKApp.app.setLoginToken(token)
|
||||
|
||||
|
||||
|
||||
@@ -140,4 +136,4 @@ class BoundPhoneActivity : CKBaseActivity() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,11 +232,7 @@ class LoginActivity : CKBaseActivity() {
|
||||
|
||||
try {
|
||||
var model = Gson().fromJson<LoginModel>(data, LoginModel::class.java)
|
||||
PreferencesUtils.putString(
|
||||
this@LoginActivity,
|
||||
Const.TOKEN, model.token.toString()
|
||||
)
|
||||
CKApp.app.token = model.token.toString()
|
||||
CKApp.app.setLoginToken(model.token.orEmpty())
|
||||
|
||||
getUserInfo()
|
||||
} catch (e: Exception) {
|
||||
@@ -262,11 +258,7 @@ class LoginActivity : CKBaseActivity() {
|
||||
|
||||
try {
|
||||
var model = Gson().fromJson<LoginModel>(data, LoginModel::class.java)
|
||||
PreferencesUtils.putString(
|
||||
this@LoginActivity,
|
||||
Const.TOKEN, model.token.toString()
|
||||
)
|
||||
CKApp.app.token = model.token.toString()
|
||||
CKApp.app.setLoginToken(model.token.orEmpty())
|
||||
|
||||
getUserInfo()
|
||||
} catch (e: Exception) {
|
||||
@@ -338,11 +330,7 @@ class LoginActivity : CKBaseActivity() {
|
||||
finish()
|
||||
|
||||
}else{
|
||||
PreferencesUtils.putString(
|
||||
this@LoginActivity,
|
||||
Const.TOKEN, model.token.toString()
|
||||
)
|
||||
CKApp.app.token = model.token.toString()
|
||||
CKApp.app.setLoginToken(model.token.orEmpty())
|
||||
|
||||
getUserInfo()
|
||||
}
|
||||
@@ -360,4 +348,4 @@ class LoginActivity : CKBaseActivity() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,11 +122,7 @@ class RegisterActivity : CKBaseActivity() {
|
||||
|
||||
try {
|
||||
var model = Gson().fromJson<LoginModel>(data, LoginModel::class.java)
|
||||
PreferencesUtils.putString(
|
||||
this@RegisterActivity,
|
||||
Const.TOKEN, model.token.toString()
|
||||
)
|
||||
CKApp.app.token = model.token.toString()
|
||||
CKApp.app.setLoginToken(model.token.orEmpty())
|
||||
|
||||
getUserInfo()
|
||||
} catch (e: Exception) {
|
||||
@@ -171,4 +167,4 @@ class RegisterActivity : CKBaseActivity() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class FeedBackActivity : CKBaseActivity() {
|
||||
binding = ActivityFeedBackBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
super.onCreate(savedInstanceState)
|
||||
checkAppPermissions()
|
||||
// checkAppPermissions()
|
||||
setTitleText(getString(R.string.feedback))
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class ReturnDeviceActivity : CKBaseActivity() {
|
||||
binding = ActivityReturnDeviceBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
super.onCreate(savedInstanceState)
|
||||
checkAppPermissions()
|
||||
// checkAppPermissions()
|
||||
setTitleText(getString(R.string.device_return))
|
||||
|
||||
setActionBarColor(getColor(R.color.white))
|
||||
|
||||
@@ -109,6 +109,8 @@ class AccountCancellationActivity: CKBaseActivity() {
|
||||
},object : ICallback{
|
||||
override fun onSuccess(data: String) {
|
||||
PreferencesUtils.clear(this@AccountCancellationActivity)
|
||||
PreferencesUtils.putBoolean(this@AccountCancellationActivity, Const.FIRST, false)
|
||||
CKApp.app.clearLoginState()
|
||||
toActivityNewTaskClear(LoginActivity::class.java, DataCollection())
|
||||
finish()
|
||||
}
|
||||
@@ -176,4 +178,4 @@ class AccountCancellationActivity: CKBaseActivity() {
|
||||
binding.check.setImageResource(R.mipmap.image_check_unselect)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,13 +3,13 @@ package com.ck.ckcollar.app.ui.act.setting
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.ck.ckcollar.app.CKApp
|
||||
import com.ck.ckcollar.app.R
|
||||
import com.ck.ckcollar.app.databinding.ActivitySettingBinding
|
||||
import com.ck.ckcollar.app.ui.act.login.AgreementActivity
|
||||
import com.ck.ckcollar.app.ui.act.login.LoginActivity
|
||||
import com.ck.ckcollar.app.ui.base.CKBaseActivity
|
||||
import com.ck.ckcollar.app.ui.dialog.CKAlertDialog
|
||||
import com.cyclone.shadowsocks.utils.PreferencesUtils
|
||||
import com.tt.kit.model.Data
|
||||
import com.tt.kit.model.DataCollection
|
||||
|
||||
@@ -70,7 +70,7 @@ class SettingActivity : CKBaseActivity(), View.OnClickListener {
|
||||
CKAlertDialog(this@SettingActivity,getString(R.string.logout),getString(R.string.logout_alert),object : CKAlertDialog.AlertClickListener{
|
||||
override fun onBack(isConfirm: Boolean) {
|
||||
if (isConfirm){
|
||||
PreferencesUtils.clear(this@SettingActivity)
|
||||
CKApp.app.clearLoginState()
|
||||
toActivityNewTaskClear(LoginActivity::class.java, DataCollection())
|
||||
finish()
|
||||
}
|
||||
@@ -80,4 +80,4 @@ class SettingActivity : CKBaseActivity(), View.OnClickListener {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ class ProductDetailsActivity : CKBaseActivity() {
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
)
|
||||
imageView.setScaleType(ImageView.ScaleType.FIT_XY)
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP)
|
||||
return BannerViewHolder(imageView)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ck.ckcollar.app.ui.act.user
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
@@ -20,7 +21,6 @@ import com.ck.ckcollar.app.model.UserInfoModel
|
||||
import com.ck.ckcollar.app.ui.act.home.MainActivity
|
||||
import com.ck.ckcollar.app.ui.act.login.BoundPhoneActivity
|
||||
import com.ck.ckcollar.app.ui.base.CKBaseActivity
|
||||
import com.ck.ckcollar.app.ui.dialog.CKAlertDialog
|
||||
import com.ck.ckcollar.app.ui.dialog.CKEditDialog
|
||||
import com.ck.ckcollar.app.ui.dialog.CKEditNameDialog
|
||||
import com.ck.ckcollar.app.ui.dialog.CKEditPhoneDialog
|
||||
@@ -55,7 +55,7 @@ class UserInfoActivity: CKBaseActivity() {
|
||||
api = WXAPIFactory.createWXAPI(this, Const.WX_APP_ID)
|
||||
CKApp.app.wxJump = 1
|
||||
|
||||
checkAppPermissions()
|
||||
// checkAppPermissions()
|
||||
setStatusBarColor(resources.getColor(R.color.white))
|
||||
setActionBarColor(resources.getColor(R.color.white))
|
||||
|
||||
@@ -111,16 +111,10 @@ class UserInfoActivity: CKBaseActivity() {
|
||||
override fun onBack(mark: Int, position: Int) {
|
||||
try {
|
||||
if (mark == 0){
|
||||
if (!checkCameraPermissions()){
|
||||
CKAlertDialog(this@UserInfoActivity,getString(R.string.alert),getString(R.string.camera_alert),object : CKAlertDialog.AlertClickListener{
|
||||
override fun onBack(isConfirm: Boolean) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
}).show()
|
||||
return
|
||||
}
|
||||
takePhoto()
|
||||
getPermissionRequst(
|
||||
Manifest.permission.CAMERA,
|
||||
REQUEST_CAMERA_PERMISSION
|
||||
)
|
||||
}else{
|
||||
//相册
|
||||
val i = Intent(
|
||||
@@ -148,6 +142,12 @@ class UserInfoActivity: CKBaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPermissionsGranted(requestCode: Int, permissions: Array<String>) {
|
||||
if (requestCode == REQUEST_CAMERA_PERMISSION) {
|
||||
takePhoto()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
|
||||
@@ -242,6 +242,10 @@ class UserInfoActivity: CKBaseActivity() {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val REQUEST_CAMERA_PERMISSION = 1101
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
|
||||
binding.textNick.text= CKApp.app.userInfo?.custName
|
||||
@@ -322,4 +326,4 @@ class UserInfoActivity: CKBaseActivity() {
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import android.text.TextUtils
|
||||
import com.ck.ckcollar.app.CKApp
|
||||
import com.ck.ckcollar.app.databinding.ActivityIndexBinding
|
||||
import com.ck.ckcollar.app.ui.act.home.MainActivity
|
||||
@@ -25,7 +24,7 @@ class IndexActivity : CKBaseActivity() {
|
||||
}
|
||||
var handler = object : Handler(Looper.getMainLooper()){
|
||||
override fun handleMessage(msg: Message) {
|
||||
if (TextUtils.isEmpty(CKApp.app.token)){
|
||||
if (!CKApp.app.isUserLoggedIn){
|
||||
var isFirst = PreferencesUtils.getBolean(this@IndexActivity, Const.FIRST,true) as Boolean
|
||||
if (isFirst){
|
||||
toActivity(WelcomeActivity::class.java, DataCollection())
|
||||
@@ -46,4 +45,4 @@ class IndexActivity : CKBaseActivity() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,10 @@ class CKPhotoDialog(
|
||||
}
|
||||
})
|
||||
|
||||
dialogMakePhotoBinding.cancelButton.setOnClickListener {
|
||||
cancel()
|
||||
}
|
||||
|
||||
setContentView(dialogMakePhotoBinding.root,ViewGroup.LayoutParams(TTUtils.width, ViewGroup.LayoutParams.WRAP_CONTENT))
|
||||
|
||||
} catch (e: Exception) {
|
||||
@@ -48,4 +52,4 @@ class CKPhotoDialog(
|
||||
interface PhotoClickListener {
|
||||
fun onBack(mark: Int, position: Int)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ck.ckcollar.app.utils.networkone.interceptor
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.ck.ckcollar.app.CKApp
|
||||
import com.ck.ckcollar.app.ui.act.login.LoginActivity
|
||||
import com.google.gson.Gson
|
||||
import com.tt.kit.networktwo.model.TTResposeData
|
||||
@@ -22,6 +23,7 @@ class ResponseInterceptor(val context : Context) : Interceptor{
|
||||
TTLog.i("ResponseInterceptor", "intercept model:" + body)
|
||||
// token失效,统一处理
|
||||
if (model.code == 401){
|
||||
CKApp.app.clearLoginState()
|
||||
var intent = Intent(context, LoginActivity::class.java)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
context.startActivity(intent)
|
||||
@@ -49,4 +51,4 @@ class ResponseInterceptor(val context : Context) : Interceptor{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -588,6 +588,7 @@
|
||||
<string name="please_choose_data">请选择原因</string>
|
||||
<string name="camera_alert">宠盾需要您的授权,使用相机功能来进行扫码和拍照</string>
|
||||
<string name="photo_permission_alert">宠盾需要您的授权,访问相册以选择照片</string>
|
||||
<string name="press_again_to_exit">再按一次退出应用</string>
|
||||
<string name="input_question">请输入问题</string>
|
||||
<string name="pet_note">宠物常识</string>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user